Skip to content
Snippets Groups Projects
Commit ec9d9ee0 authored by L. Ellenbeck's avatar L. Ellenbeck
Browse files

Merge branch 'Topic/570-gitVersion' into 'master'

Fix: nuget feed

See merge request coscine/cs/exampleproject!25
parents e370ade2 9ac4d842
No related branches found
No related tags found
1 merge request!25Fix: nuget feed
...@@ -17,11 +17,6 @@ var version = Argument("nugetVersion", ""); ...@@ -17,11 +17,6 @@ var version = Argument("nugetVersion", "");
var gitlabProjectPath = Argument("gitlabProjectPath", ""); var gitlabProjectPath = Argument("gitlabProjectPath", "");
var gitlabProjectId = Argument("gitlabProjectId", ""); var gitlabProjectId = Argument("gitlabProjectId", "");
var gitlabToken = Argument("gitlabToken", ""); var gitlabToken = Argument("gitlabToken", "");
var feed = new
{
Name = "LocalNuget",
Source = @"C:\LocalNuget"
};
// Define directories // Define directories
var projects = GetFiles("./**/*.csproj"); var projects = GetFiles("./**/*.csproj");
...@@ -32,6 +27,7 @@ var projectName = solutionFile.GetFilenameWithoutExtension().ToString(); ...@@ -32,6 +27,7 @@ var projectName = solutionFile.GetFilenameWithoutExtension().ToString();
var nugetSource = "https://api.nuget.org/v3/index.json"; var nugetSource = "https://api.nuget.org/v3/index.json";
var assemblyInfoSubPath = "Properties/AssemblyInfo.cs"; var assemblyInfoSubPath = "Properties/AssemblyInfo.cs";
var semanticVersion = ""; var semanticVersion = "";
string localNugetFeed;
// get latest MSBuild version // get latest MSBuild version
var vsLatest = VSWhereLatest(); var vsLatest = VSWhereLatest();
...@@ -39,6 +35,12 @@ var msBuildPathX64 = (vsLatest == null) ? null : vsLatest.CombineWithFilePath(". ...@@ -39,6 +35,12 @@ var msBuildPathX64 = (vsLatest == null) ? null : vsLatest.CombineWithFilePath(".
Setup(context =>{ Setup(context =>{
nupkgDir = $"{artifactsDir.ToString()}/nupkg"; 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); Information("Started at {0}", DateTime.Now);
}); });
...@@ -76,13 +78,9 @@ Task("Clean") ...@@ -76,13 +78,9 @@ Task("Clean")
Task("Restore") Task("Restore")
.Does(() =>{ .Does(() =>{
if (!NuGetHasSource(feed.Source))
{
NuGetAddSource(feed.Name, feed.Source);
}
NuGetRestore(solutionFile, new NuGetRestoreSettings { NuGetRestore(solutionFile, new NuGetRestoreSettings {
NoCache = true NoCache = true,
FallbackSource = new List<string>{ localNugetFeed },
}); });
}); });
...@@ -329,13 +327,14 @@ Task("NugetPushLocal") ...@@ -329,13 +327,14 @@ Task("NugetPushLocal")
.Does(() =>{ .Does(() =>{
var nupkgs = GetFiles($"{nupkgDir}/*.nupkg"); var nupkgs = GetFiles($"{nupkgDir}/*.nupkg");
foreach(var nupkg in nupkgs) { foreach(var nupkg in nupkgs) {
NuGetAdd(nupkg.ToString(), feed.Source); NuGetAdd(nupkg.ToString(), localNugetFeed);
} }
}); });
Task("Prerelease") Task("Prerelease")
.IsDependentOn("Build") .IsDependentOn("Build")
.IsDependentOn("CopyToArtifacts"); .IsDependentOn("CopyToArtifacts")
.IsDependentOn("NugetPushLocal");
Task("Release") Task("Release")
.IsDependentOn("NugetPack") .IsDependentOn("NugetPack")
......
...@@ -9,8 +9,8 @@ using System.Reflection; ...@@ -9,8 +9,8 @@ using System.Reflection;
[assembly: AssemblyDescription("ExampleProject.Tests is a part of the CoScInE group.")] [assembly: AssemblyDescription("ExampleProject.Tests is a part of the CoScInE group.")]
[assembly: AssemblyCompany("IT Center, RWTH Aachen University")] [assembly: AssemblyCompany("IT Center, RWTH Aachen University")]
[assembly: AssemblyProduct("ExampleProject.Tests")] [assembly: AssemblyProduct("ExampleProject.Tests")]
[assembly: AssemblyVersion("1.5.0")] [assembly: AssemblyVersion("1.7.1")]
[assembly: AssemblyFileVersion("1.5.0")] [assembly: AssemblyFileVersion("1.7.1")]
[assembly: AssemblyInformationalVersion("1.5.0-topic-570-gitver0076")] [assembly: AssemblyInformationalVersion("1.7.1")]
[assembly: AssemblyCopyright("2020 IT Center, RWTH Aachen University")] [assembly: AssemblyCopyright("2020 IT Center, RWTH Aachen University")]
...@@ -9,8 +9,8 @@ using System.Reflection; ...@@ -9,8 +9,8 @@ using System.Reflection;
[assembly: AssemblyDescription("ExampleProject.cmd is a part of the CoScInE group.")] [assembly: AssemblyDescription("ExampleProject.cmd is a part of the CoScInE group.")]
[assembly: AssemblyCompany("IT Center, RWTH Aachen University")] [assembly: AssemblyCompany("IT Center, RWTH Aachen University")]
[assembly: AssemblyProduct("ExampleProject.cmd")] [assembly: AssemblyProduct("ExampleProject.cmd")]
[assembly: AssemblyVersion("1.5.0")] [assembly: AssemblyVersion("1.7.1")]
[assembly: AssemblyFileVersion("1.5.0")] [assembly: AssemblyFileVersion("1.7.1")]
[assembly: AssemblyInformationalVersion("1.5.0-topic-570-gitver0076")] [assembly: AssemblyInformationalVersion("1.7.1")]
[assembly: AssemblyCopyright("2020 IT Center, RWTH Aachen University")] [assembly: AssemblyCopyright("2020 IT Center, RWTH Aachen University")]
...@@ -9,8 +9,8 @@ using System.Reflection; ...@@ -9,8 +9,8 @@ using System.Reflection;
[assembly: AssemblyDescription("ExampleProject is a part of the CoScInE group.")] [assembly: AssemblyDescription("ExampleProject is a part of the CoScInE group.")]
[assembly: AssemblyCompany("IT Center, RWTH Aachen University")] [assembly: AssemblyCompany("IT Center, RWTH Aachen University")]
[assembly: AssemblyProduct("ExampleProject")] [assembly: AssemblyProduct("ExampleProject")]
[assembly: AssemblyVersion("1.5.0")] [assembly: AssemblyVersion("1.7.1")]
[assembly: AssemblyFileVersion("1.5.0")] [assembly: AssemblyFileVersion("1.7.1")]
[assembly: AssemblyInformationalVersion("1.5.0-topic-570-gitver0076")] [assembly: AssemblyInformationalVersion("1.7.1")]
[assembly: AssemblyCopyright("2020 IT Center, RWTH Aachen University")] [assembly: AssemblyCopyright("2020 IT Center, RWTH Aachen University")]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment