mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-22 06:22:50 +08:00
Merge pull request #49 from binarymash/feature/MacOSBuild
Fix #41 - get cake scripts running on Mac
This commit is contained in:
commit
b0333a0e82
32
build.cake
32
build.cake
@ -80,7 +80,7 @@ Task("Version")
|
|||||||
if (AppVeyor.IsRunningOnAppVeyor)
|
if (AppVeyor.IsRunningOnAppVeyor)
|
||||||
{
|
{
|
||||||
Information("Persisting version number...");
|
Information("Persisting version number...");
|
||||||
PersistVersion(nugetVersion);
|
PersistVersion(committedVersion, nugetVersion);
|
||||||
buildVersion = nugetVersion;
|
buildVersion = nugetVersion;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -158,7 +158,7 @@ Task("CreatePackages")
|
|||||||
{
|
{
|
||||||
EnsureDirectoryExists(packagesDir);
|
EnsureDirectoryExists(packagesDir);
|
||||||
|
|
||||||
GenerateReleaseNotes();
|
GenerateReleaseNotes(releaseNotesFile);
|
||||||
|
|
||||||
var settings = new DotNetCorePackSettings
|
var settings = new DotNetCorePackSettings
|
||||||
{
|
{
|
||||||
@ -189,7 +189,7 @@ Task("ReleasePackagesToUnstableFeed")
|
|||||||
.IsDependentOn("CreatePackages")
|
.IsDependentOn("CreatePackages")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
PublishPackages(nugetFeedUnstableKey, nugetFeedUnstableUploadUrl, nugetFeedUnstableSymbolsUploadUrl);
|
PublishPackages(packagesDir, artifactsFile, nugetFeedUnstableKey, nugetFeedUnstableUploadUrl, nugetFeedUnstableSymbolsUploadUrl);
|
||||||
});
|
});
|
||||||
|
|
||||||
Task("EnsureStableReleaseRequirements")
|
Task("EnsureStableReleaseRequirements")
|
||||||
@ -241,7 +241,7 @@ Task("ReleasePackagesToStableFeed")
|
|||||||
.IsDependentOn("DownloadGitHubReleaseArtifacts")
|
.IsDependentOn("DownloadGitHubReleaseArtifacts")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
PublishPackages(nugetFeedStableKey, nugetFeedStableUploadUrl, nugetFeedStableSymbolsUploadUrl);
|
PublishPackages(packagesDir, artifactsFile, nugetFeedStableKey, nugetFeedStableUploadUrl, nugetFeedStableSymbolsUploadUrl);
|
||||||
});
|
});
|
||||||
|
|
||||||
Task("Release")
|
Task("Release")
|
||||||
@ -262,9 +262,9 @@ private string GetNuGetVersionForCommit()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Updates project version in all of our projects
|
/// Updates project version in all of our projects
|
||||||
private void PersistVersion(string version)
|
private void PersistVersion(string committedVersion, string newVersion)
|
||||||
{
|
{
|
||||||
Information(string.Format("We'll search all project.json files for {0} and replace with {1}...", committedVersion, version));
|
Information(string.Format("We'll search all project.json files for {0} and replace with {1}...", committedVersion, newVersion));
|
||||||
|
|
||||||
var projectJsonFiles = GetFiles("./**/project.json");
|
var projectJsonFiles = GetFiles("./**/project.json");
|
||||||
|
|
||||||
@ -275,24 +275,30 @@ private void PersistVersion(string version)
|
|||||||
Information(string.Format("Updating {0}...", file));
|
Information(string.Format("Updating {0}...", file));
|
||||||
|
|
||||||
var updatedProjectJson = System.IO.File.ReadAllText(file)
|
var updatedProjectJson = System.IO.File.ReadAllText(file)
|
||||||
.Replace(committedVersion, version);
|
.Replace(committedVersion, newVersion);
|
||||||
|
|
||||||
System.IO.File.WriteAllText(file, updatedProjectJson);
|
System.IO.File.WriteAllText(file, updatedProjectJson);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// generates release notes based on issues closed in GitHub since the last release
|
/// generates release notes based on issues closed in GitHub since the last release
|
||||||
private void GenerateReleaseNotes()
|
private void GenerateReleaseNotes(string file)
|
||||||
{
|
{
|
||||||
Information("Generating release notes at " + releaseNotesFile);
|
if (!IsRunningOnWindows())
|
||||||
|
{
|
||||||
|
Warning("We can't generate release notes as we're not running on Windows.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Information("Generating release notes at " + file);
|
||||||
|
|
||||||
var releaseNotesExitCode = StartProcess(
|
var releaseNotesExitCode = StartProcess(
|
||||||
@"tools/GitReleaseNotes/tools/gitreleasenotes.exe",
|
@"tools/GitReleaseNotes/tools/gitreleasenotes.exe",
|
||||||
new ProcessSettings { Arguments = ". /o " + releaseNotesFile });
|
new ProcessSettings { Arguments = ". /o " + file });
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(System.IO.File.ReadAllText(releaseNotesFile)))
|
if (string.IsNullOrEmpty(System.IO.File.ReadAllText(file)))
|
||||||
{
|
{
|
||||||
System.IO.File.WriteAllText(releaseNotesFile, "No issues closed since last release");
|
System.IO.File.WriteAllText(file, "No issues closed since last release");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (releaseNotesExitCode != 0)
|
if (releaseNotesExitCode != 0)
|
||||||
@ -302,7 +308,7 @@ private void GenerateReleaseNotes()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Publishes code and symbols packages to nuget feed, based on contents of artifacts file
|
/// Publishes code and symbols packages to nuget feed, based on contents of artifacts file
|
||||||
private void PublishPackages(string feedApiKey, string codeFeedUrl, string symbolFeedUrl)
|
private void PublishPackages(string packagesDir, string artifactsFile, string feedApiKey, string codeFeedUrl, string symbolFeedUrl)
|
||||||
{
|
{
|
||||||
var artifacts = System.IO.File
|
var artifacts = System.IO.File
|
||||||
.ReadAllLines(artifactsFile)
|
.ReadAllLines(artifactsFile)
|
||||||
|
@ -38,9 +38,10 @@
|
|||||||
"xunit": "2.2.0-rc1-build3507"
|
"xunit": "2.2.0-rc1-build3507"
|
||||||
},
|
},
|
||||||
"runtimes": {
|
"runtimes": {
|
||||||
"win10-x64": {},
|
|
||||||
"osx.10.11-x64":{},
|
"osx.10.11-x64":{},
|
||||||
"win7-x64": {}
|
"osx.10.12-x64":{},
|
||||||
|
"win7-x64": {},
|
||||||
|
"win10-x64": {}
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"netcoreapp1.1": {
|
"netcoreapp1.1": {
|
||||||
|
@ -9,9 +9,10 @@
|
|||||||
"BenchmarkDotNet": "0.10.2"
|
"BenchmarkDotNet": "0.10.2"
|
||||||
},
|
},
|
||||||
"runtimes": {
|
"runtimes": {
|
||||||
"win10-x64": {},
|
|
||||||
"osx.10.11-x64":{},
|
"osx.10.11-x64":{},
|
||||||
"win7-x64": {}
|
"osx.10.12-x64":{},
|
||||||
|
"win7-x64": {},
|
||||||
|
"win10-x64": {}
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"netcoreapp1.1": {
|
"netcoreapp1.1": {
|
||||||
|
@ -19,9 +19,10 @@
|
|||||||
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
|
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
|
||||||
},
|
},
|
||||||
"runtimes": {
|
"runtimes": {
|
||||||
"win10-x64": {},
|
|
||||||
"osx.10.11-x64":{},
|
"osx.10.11-x64":{},
|
||||||
"win7-x64": {}
|
"osx.10.12-x64":{},
|
||||||
|
"win7-x64": {},
|
||||||
|
"win10-x64": {}
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"netcoreapp1.1": {
|
"netcoreapp1.1": {
|
||||||
|
@ -27,9 +27,10 @@
|
|||||||
"xunit": "2.2.0-rc1-build3507"
|
"xunit": "2.2.0-rc1-build3507"
|
||||||
},
|
},
|
||||||
"runtimes": {
|
"runtimes": {
|
||||||
"win10-x64": {},
|
|
||||||
"osx.10.11-x64":{},
|
"osx.10.11-x64":{},
|
||||||
"win7-x64": {}
|
"osx.10.12-x64":{},
|
||||||
|
"win7-x64": {},
|
||||||
|
"win10-x64": {}
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"netcoreapp1.1": {
|
"netcoreapp1.1": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user