Updating build script per RC1 branching

This commit is contained in:
Pranav K 2015-11-18 12:22:55 -08:00
parent 419d3a3ea5
commit 64fa41457b
3 changed files with 22 additions and 35 deletions

View File

@ -2,6 +2,7 @@
<configuration>
<packageSources>
<clear />
<add key="AspNetVNext" value="https://www.myget.org/f/aspnetmaster/api/v3/index.json" />
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>

View File

@ -221,7 +221,9 @@ var buildTarget = "compile"
"Coherence",
"Coherence-Signed",
"dnvm",
"Entropy"
"Entropy",
"Setup",
"libuv-build",
};
Exec("cmd", "/C dnu restore", @"tools\PinVersion");
@ -247,36 +249,12 @@ var buildTarget = "compile"
var repoPath = Path.Combine(Directory.GetCurrentDirectory(), repo);
Exec("dnx",
string.Format(@"run ""{0}"" ""{1}"" ""{2}"" ""{3}""",
string.Format(@"run ""{0}"" ""{1}"" ""{2}""",
Path.Combine(Directory.GetCurrentDirectory(), repo),
COHERENCE_FEED,
KOREBUILD_VERSION,
NUGET_VERSION),
KOREBUILD_VERSION),
@"tools\PinVersion");
// Build projects to produce project.lock.json
Exec("build.cmd", "compile", repo);
// Replace lock=true in project.lock.json
foreach(var file in Directory.GetFiles(repo, "project.lock.json", SearchOption.AllDirectories))
{
var contents = File.ReadAllText(file);
var newContents = contents.Replace("\"locked\": false", "\"locked\": true");
File.WriteAllText(file, newContents);
}
// Add the project.json and project.lock.json files
foreach(var file in Directory.GetFiles(repo, "project*.json", SearchOption.AllDirectories))
{
var gitFilePath = file.Substring(file.IndexOf(repo) + repo.Length + 1);
// Check if this needs to be included
if(ShouldIncludeProjectJson(gitFilePath))
{
GitCommand(repo, string.Format("add -f {0}", gitFilePath));
}
}
GitCommand(repo, "commit -am \"Updating json files to pin versions and build.cmd to pin KoreBuild and DNX\"");
}
@ -625,13 +603,6 @@ functions
Log.Warn(string.Format("Unable to clone repository at '{0}': {1}", repoUrl, ex.Message));
return;
}
// Configuring Git bug tracking settings hangs from time to time on Win7/2008 when running as part of the CI build
if (!IsTeamCity)
{
GitConfig("bugtraq.url", "http://github.com/aspnet/" + repo + "/issues/%BUGID%", repo);
GitConfig("bugtraq.logregex", @"#(\d+)", repo);
}
}
}

View File

@ -67,7 +67,7 @@ namespace PinVersion
using (var fileWriter = new JsonTextWriter(new StreamWriter(file)))
{
fileWriter.Formatting = Formatting.Indented;
fileWriter.Indentation = 4;
fileWriter.Indentation = 2;
projectJson.WriteTo(fileWriter);
}
}
@ -100,6 +100,21 @@ namespace PinVersion
// Replace all content of the file
File.WriteAllText(buildCmdFile, buildCmdFileContent);
// Pin the global.json
var globalJsonPath = Path.Combine(repositoryPath, "global.json");
var globalJson = JObject.Parse(File.ReadAllText(globalJsonPath));
globalJson["sdk"] = new JObject
{
["version"] = dnxPackage.Version.ToNormalizedString()
};
using (var fileWriter = new JsonTextWriter(new StreamWriter(globalJsonPath)))
{
fileWriter.Formatting = Formatting.Indented;
fileWriter.Indentation = 2;
globalJson.WriteTo(fileWriter);
}
}
}
}