Created
September 23, 2017 18:44
-
-
Save bjorkstromm/c26371e8e4ce9cab0a6e4069561e2246 to your computer and use it in GitHub Desktop.
gitversion - restore - build - pack /w Cake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#tool gitversion.commandline | |
DotNetCoreMSBuildSettings msBuildSettings; | |
Setup(context => | |
{ | |
var version = GitVersion(); | |
msBuildSettings = new DotNetCoreMSBuildSettings() | |
.WithProperty("Version", version.SemVer) | |
.WithProperty("AssemblyVersion", version.MajorMinorPatch) | |
.WithProperty("FileVersion", version.MajorMinorPatch); | |
}); | |
Task("Restore") | |
.Does(() => | |
{ | |
DotNetCoreRestore("./FooLib.sln", new DotNetCoreRestoreSettings { | |
MSBuildSettings = msBuildSettings | |
}); | |
}); | |
Task("Build") | |
.IsDependentOn("Restore") | |
.Does(() => | |
{ | |
DotNetCoreBuild("./FooLib.sln", new DotNetCoreBuildSettings { | |
Configuration = "Release", | |
MSBuildSettings = msBuildSettings | |
}); | |
}); | |
Task("Pack") | |
.IsDependentOn("Build") | |
.Does(() => | |
{ | |
DotNetCorePack("./FooLib.csproj", new DotNetCorePackSettings { | |
Configuration = "Release", | |
MSBuildSettings = msBuildSettings | |
}); | |
}); | |
Task("Default") | |
.IsDependentOn("Pack"); | |
RunTarget("Default"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment