Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ExampleProject
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This project is archived. Its data is
read-only
.
Show more breadcrumbs
Coscine
backend
scripts
ExampleProject
Commits
63113a76
Commit
63113a76
authored
May 29, 2019
by
L. Ellenbeck
Browse files
Options
Downloads
Patches
Plain Diff
New: better build script
parent
54288ca0
No related branches found
No related tags found
No related merge requests found
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
build.cake
+19
-18
19 additions, 18 deletions
build.cake
with
19 additions
and
18 deletions
build.cake
+
19
−
18
View file @
63113a76
...
@@ -21,7 +21,7 @@ var projectPaths = projects.Select(project => project.GetDirectory());
...
@@ -21,7 +21,7 @@ var projectPaths = projects.Select(project => project.GetDirectory());
var artifactsDir = Directory("./Artifacts");
var artifactsDir = Directory("./Artifacts");
var solutionFile = GetFiles("./**/*.sln").First();
var solutionFile = GetFiles("./**/*.sln").First();
var projectName = solutionFile.GetFilenameWithoutExtension().ToString();
var projectName = solutionFile.GetFilenameWithoutExtension().ToString();
var assemblyInfoSubPath = "
/
Properties/AssemblyInfo.cs";
var assemblyInfoSubPath = "Properties/AssemblyInfo.cs";
// get latest MSBuild version
// get latest MSBuild version
var vsLatest = VSWhereLatest();
var vsLatest = VSWhereLatest();
...
@@ -30,6 +30,9 @@ var msBuildPathX64 = (vsLatest == null) ? null : vsLatest.CombineWithFilePath(".
...
@@ -30,6 +30,9 @@ var msBuildPathX64 = (vsLatest == null) ? null : vsLatest.CombineWithFilePath(".
// Error rules for resharper
// Error rules for resharper
// Example: {"InconsistentNaming", "RedundantUsingDirective"};
// Example: {"InconsistentNaming", "RedundantUsingDirective"};
string[] resharperErrorRules = {};
string[] resharperErrorRules = {};
// Paths to exclude from dupFinder
List<string> dupFinderExcludePatterns = projectPaths.Select( x => $"{x.ToString()}/{assemblyInfoSubPath}").ToList();
string[] dupFinderExcludeCodeRegionsByNameSubstring = { "DupFinder Exclusion" };
Action <NpxSettings> requiredSemanticVersionPackages = settings =>
Action <NpxSettings> requiredSemanticVersionPackages = settings =>
settings.AddPackage("semantic-release")
settings.AddPackage("semantic-release")
...
@@ -62,14 +65,14 @@ Task("Clean")
...
@@ -62,14 +65,14 @@ Task("Clean")
Force = true
Force = true
};
};
// Clean solution directories.
var directoriesToDelete = new List<DirectoryPath>();
foreach(var path in projectPaths) {
foreach(var path in projectPaths) {
Information($"Cleaning path {path} ...");
directoriesToDelete.Add(Directory($"{path}/obj"));
var directoriesToDelete = new DirectoryPath[] {
directoriesToDelete.Add(Directory($"{path}/bin"));
Directory($"{path}/obj"),
}
Directory($"{path}/bin"),
artifactsDir
directoriesToDelete.Add(artifactsDir);
};
foreach(var dir in directoriesToDelete) {
foreach(var dir in directoriesToDelete) {
if (DirectoryExists(dir)) {
if (DirectoryExists(dir)) {
...
@@ -77,7 +80,6 @@ Task("Clean")
...
@@ -77,7 +80,6 @@ Task("Clean")
DeleteDirectory(dir, settings);
DeleteDirectory(dir, settings);
}
}
}
}
}
});
});
Task("Restore")
Task("Restore")
...
@@ -96,9 +98,8 @@ Task("DupFinder")
...
@@ -96,9 +98,8 @@ Task("DupFinder")
ShowStats = true,
ShowStats = true,
ShowText = true,
ShowText = true,
OutputFile = $"{artifactsDir}/dupfinder.xml",
OutputFile = $"{artifactsDir}/dupfinder.xml",
ExcludeCodeRegionsByNameSubstring = new string[] {
ExcludeCodeRegionsByNameSubstring = dupFinderExcludeCodeRegionsByNameSubstring,
"DupFinder Exclusion"
ExcludePattern = dupFinderExcludePatterns.ToArray(),
},
ThrowExceptionOnFindingDuplicates = true
ThrowExceptionOnFindingDuplicates = true
};
};
DupFinder(solutionFile, settings);
DupFinder(solutionFile, settings);
...
@@ -160,7 +161,7 @@ Task("UpdateAssemblyInfo")
...
@@ -160,7 +161,7 @@ Task("UpdateAssemblyInfo")
var assemblyVersion = $"{nextSemanticVersionNumber}.0";
var assemblyVersion = $"{nextSemanticVersionNumber}.0";
foreach(var project in projects) {
foreach(var project in projects) {
CreateAssemblyInfo(project.GetDirectory()
+
assemblyInfoSubPath, new AssemblyInfoSettings {
CreateAssemblyInfo(
$"
project.GetDirectory()
/{
assemblyInfoSubPath
}"
, new AssemblyInfoSettings {
Product = project.GetFilenameWithoutExtension().ToString(),
Product = project.GetFilenameWithoutExtension().ToString(),
Title = project.GetFilenameWithoutExtension().ToString(),
Title = project.GetFilenameWithoutExtension().ToString(),
Company = "IT Center, RWTH Aachen University",
Company = "IT Center, RWTH Aachen University",
...
...
...
...
This diff is collapsed.
Click to expand it.
Ghost User
@ghost
mentioned in commit
309d7d33
·
May 29, 2019
mentioned in commit
309d7d33
mentioned in commit 309d7d33e7456cde978ba9aebf12bafedf559686
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment