-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Cake for automatic packaging and publishing
- Loading branch information
Showing
15 changed files
with
463 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -242,4 +242,5 @@ ModelManifest.xml | |
.paket/paket.exe | ||
|
||
# FAKE - F# Make | ||
.fake/ | ||
.fake/ | ||
Tools/** |
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Cake" version="0.20.0" /> | ||
</packages> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
version: 1.0.{build} | ||
image: Visual Studio 2015 | ||
build_script: | ||
- cmd: PowerShell -Version 2.0 .\build.ps1 | ||
test: off |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
#tool nuget:?package=NUnit.ConsoleRunner&version=3.6.0 | ||
////////////////////////////////////////////////////////////////////// | ||
// ARGUMENTS | ||
////////////////////////////////////////////////////////////////////// | ||
|
||
var target = Argument("target", "Default"); | ||
var configuration = Argument("configuration", "Release"); | ||
|
||
////////////////////////////////////////////////////////////////////// | ||
// CONSTANTS | ||
////////////////////////////////////////////////////////////////////// | ||
|
||
var PROJECT_DIR = Context.Environment.WorkingDirectory.FullPath + "/"; | ||
var PACKAGE_DIR = PROJECT_DIR + "package/"; | ||
|
||
////////////////////////////////////////////////////////////////////// | ||
// PREPARATION | ||
////////////////////////////////////////////////////////////////////// | ||
|
||
// Define directories. | ||
var buildDirs = new List<string>() | ||
{ | ||
Directory("./Source/AsyncGenerator/bin") + Directory(configuration), | ||
Directory("./Source/AsyncGenerator.CommandLine/bin") + Directory(configuration), | ||
Directory("./Source/AsyncGenerator.Configuration.Yaml/bin") + Directory(configuration), | ||
Directory("./Source/AsyncGenerator.Core/bin") + Directory(configuration) | ||
}; | ||
|
||
////////////////////////////////////////////////////////////////////// | ||
// TASKS | ||
////////////////////////////////////////////////////////////////////// | ||
|
||
Task("Clean") | ||
.Does(() => | ||
{ | ||
foreach(var buildDir in buildDirs) | ||
{ | ||
CleanDirectory(buildDir); | ||
} | ||
}); | ||
|
||
Task("Restore-NuGet-Packages") | ||
.IsDependentOn("Clean") | ||
.Does(() => | ||
{ | ||
NuGetRestore("./Source/AsyncGenerator.sln"); | ||
}); | ||
|
||
Task("Build") | ||
.IsDependentOn("Restore-NuGet-Packages") | ||
.Does(() => | ||
{ | ||
if(IsRunningOnWindows()) | ||
{ | ||
// Use MSBuild | ||
MSBuild("./Source/AsyncGenerator.sln", settings => | ||
settings.SetConfiguration(configuration)); | ||
} | ||
else | ||
{ | ||
// Use XBuild | ||
XBuild("./Source/AsyncGenerator.sln", settings => | ||
settings.SetConfiguration(configuration)); | ||
} | ||
}); | ||
|
||
Task("Run-Unit-Tests") | ||
.IsDependentOn("Build") | ||
.Does(() => | ||
{ | ||
NUnit3("./Source/**/bin/" + configuration + "/*.Tests.dll", new NUnit3Settings { | ||
NoResults = true | ||
}); | ||
}); | ||
|
||
////////////////////////////////////////////////////////////////////// | ||
// PACKAGE | ||
////////////////////////////////////////////////////////////////////// | ||
|
||
Task("Pack-NuGet-Packages") | ||
.IsDependentOn("Build") | ||
.Description("Creates NuGet packages") | ||
.Does(() => | ||
{ | ||
CreateDirectory(PACKAGE_DIR); | ||
NuGetPack("Source/AsyncGenerator.Core/AsyncGenerator.Core.csproj", new NuGetPackSettings() | ||
{ | ||
OutputDirectory = PACKAGE_DIR, | ||
Symbols = true, | ||
ArgumentCustomization = args => args | ||
.Append("-Prop Configuration=" + configuration) | ||
}); | ||
NuGetPack("Source/AsyncGenerator.Configuration.Yaml/AsyncGenerator.Configuration.Yaml.csproj", new NuGetPackSettings() | ||
{ | ||
OutputDirectory = PACKAGE_DIR, | ||
Symbols = true, | ||
ArgumentCustomization = args => args | ||
.Append("-Prop Configuration=" + configuration) | ||
}); | ||
NuGetPack("Source/AsyncGenerator/AsyncGenerator.csproj", new NuGetPackSettings() | ||
{ | ||
OutputDirectory = PACKAGE_DIR, | ||
Symbols = true, | ||
ArgumentCustomization = args => args | ||
.Append("-Prop Configuration=" + configuration) | ||
}); | ||
NuGetPack("Source/AsyncGenerator.CommandLine/AsyncGenerator.CommandLine.csproj", new NuGetPackSettings() | ||
{ | ||
OutputDirectory = PACKAGE_DIR, | ||
ArgumentCustomization = args => args | ||
.Append("-Tool") | ||
.Append("-Prop Configuration=" + configuration) | ||
}); | ||
}); | ||
|
||
Task("Publish-NuGet-Packages") | ||
.IsDependentOn("Run-Unit-Tests") | ||
.IsDependentOn("Pack-NuGet-Packages") | ||
.Does(() => | ||
{ | ||
foreach(var package in System.IO.Directory.GetFiles(PACKAGE_DIR, "*.nupkg").Where(o => !o.Contains("symbols"))) | ||
{ | ||
NuGetPush(package, new NuGetPushSettings() | ||
{ | ||
Source = "https://www.nuget.org/api/v2/package" | ||
}); | ||
} | ||
}); | ||
|
||
|
||
|
||
////////////////////////////////////////////////////////////////////// | ||
// TASK TARGETS | ||
////////////////////////////////////////////////////////////////////// | ||
|
||
Task("Default") | ||
.IsDependentOn("Run-Unit-Tests"); | ||
|
||
Task("Publish") | ||
.IsDependentOn("Publish-NuGet-Packages"); | ||
|
||
////////////////////////////////////////////////////////////////////// | ||
// EXECUTION | ||
////////////////////////////////////////////////////////////////////// | ||
|
||
RunTarget(target); |
Oops, something went wrong.