Skip to content
Snippets Groups Projects
Select Git revision
  • fe4c3fa906be938bd77f67f155cd8bd2cee21505
  • main default protected
  • gitkeep
  • dev
  • ipynb
  • 81-add-id-to-figure-file-metadata
  • v0.3.2
  • v0.3.1
  • v0.3.0
  • v0.2.3
  • test_tag
  • v0.2.2
  • v.0.2.1
  • v0.2.1
  • v0.1.2
  • v0.1.1
  • v0.1.0
17 results

index.rst

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    build.cake 11.86 KiB
    #tool nuget:?package=NUnit.ConsoleRunner&version=3.10.0
    #tool nuget:?package=vswhere&version=2.8.4
    #tool nuget:?package=GitVersion.CommandLine&version=5.1.3
    
    #addin nuget:https://api.nuget.org/v3/index.json?package=Cake.Json&version=4.0.0
    #addin nuget:https://api.nuget.org/v3/index.json?package=Newtonsoft.Json&version=11.0.2
    #addin nuget:https://api.nuget.org/v3/index.json?package=Cake.FileHelpers&version=3.2.1
    
    using System.Net;
    using System.Net.Http;
    using System.Net.Http.Headers;
    
    // Commandline arguments
    var target = Argument("target", "Default");
    var configuration = Argument("configuration", "Release");
    var nugetApiKey = Argument<string>("nugetApiKey", null);
    var version = Argument("nugetVersion", "");
    var gitlabProjectPath = Argument("gitlabProjectPath", "");
    var gitlabProjectId = Argument("gitlabProjectId", "");
    var gitlabToken = Argument("gitlabToken", "");
    var branch = Argument("branch", "");
    var gitAuthorEmail = Argument("gitAuthorEmail", "");
    var gitAuthorName = Argument("gitAuthorName", "");
    
    // Define directories
    var projects = GetFiles("./**/*.csproj");
    var artifactsDir = Directory("./Artifacts");
    string nupkgDir;
    var solutionFile = GetFiles("./**/*.sln").First();
    var projectName = solutionFile.GetFilenameWithoutExtension().ToString();
    var nugetSource = "https://api.nuget.org/v3/index.json";
    var assemblyInfoSubPath = "Properties/AssemblyInfo.cs";
    var semanticVersion = "";
    string localNugetFeed;
    
    // get latest MSBuild version
    var vsLatest  = VSWhereLatest();	
    var msBuildPathX64 = (vsLatest == null) ? null : vsLatest.CombineWithFilePath("./MSBuild/Current/Bin/MSBuild.exe");
    
    Setup(context =>{
    	nupkgDir = $"{artifactsDir.ToString()}/nupkg";
    	var branch = GitVersion(new GitVersionSettings {
    			UpdateAssemblyInfo = false
    		}).BranchName.Replace("/", "-");
    
    	localNugetFeed = $"C:\\coscine\\LocalNugetFeeds\\{branch}";
    	Information("{0}", branch);
    	Information("Started at {0}", DateTime.Now);
    });
    
    Teardown(context =>{
    	Information("Finished at {0}", DateTime.Now);
    });
    
    Task("Clean")
    .Description("Cleans all build and artifacts directories")
    .Does(() =>{
    	var settings = new DeleteDirectorySettings {
    		Recursive = true,
    		Force = true
    	};
    	
    	var directoriesToClean = new List<DirectoryPath>();
    	
    	foreach(var project in projects) {
    		directoriesToClean.Add(Directory($"{project.GetDirectory()}/obj"));
    		directoriesToClean.Add(Directory($"{project.GetDirectory()}/bin"));
    	}
    	
    	directoriesToClean.Add(artifactsDir);