Update dotnet-new project.json templates

Now that Microsoft.NETCore.App is built in a separate repo, we don't need the project.json.pretemplate files.
This commit is contained in:
Eric Erhardt 2016-05-26 09:43:37 -05:00
parent 06ec7ddf47
commit 70ed305171
5 changed files with 3 additions and 29 deletions

4
.gitignore vendored
View file

@ -34,10 +34,6 @@ cmake/
# stage0 install directory # stage0 install directory
.dotnet_stage0 .dotnet_stage0
# `dotnet new` project.json.template files are generated by a pre-build step.
# ignore these files
/src/dotnet/commands/dotnet-new/**/project.json.template
### VisualStudio.gitignore from https://raw.githubusercontent.com/github/gitignore/master/VisualStudio.gitignore ### ### VisualStudio.gitignore from https://raw.githubusercontent.com/github/gitignore/master/VisualStudio.gitignore ###
## Ignore Visual Studio temporary files, build results, and ## Ignore Visual Studio temporary files, build results, and

View file

@ -36,7 +36,6 @@ namespace Microsoft.DotNet.Cli.Build
// All major targets will depend on this in order to ensure variables are set up right if they are run independently // All major targets will depend on this in order to ensure variables are set up right if they are run independently
[Target( [Target(
nameof(GenerateVersions), nameof(GenerateVersions),
nameof(UpdateTemplateVersions),
nameof(CheckPrereqs), nameof(CheckPrereqs),
nameof(LocateStage0), nameof(LocateStage0),
nameof(ExpectedBuildArtifacts), nameof(ExpectedBuildArtifacts),
@ -87,27 +86,6 @@ namespace Microsoft.DotNet.Cli.Build
return c.Success(); return c.Success();
} }
/// <summary>
/// Updates the Microsoft.NETCore.App version number in the `dotnet new` project.json.template files.
/// </summary>
[Target]
public static BuildTargetResult UpdateTemplateVersions(BuildTargetContext c)
{
IEnumerable<string> templateFiles = Directory.GetFiles(
Path.Combine(Dirs.RepoRoot, "src", "dotnet", "commands", "dotnet-new"),
"project.json.pretemplate",
SearchOption.AllDirectories);
foreach (string templateFile in templateFiles)
{
JObject projectRoot = JsonUtils.ReadProject(templateFile);
projectRoot["dependencies"]["Microsoft.NETCore.App"]["version"] = DependencyVersions.SharedFrameworkVersion;
JsonUtils.WriteProject(projectRoot, Path.ChangeExtension(templateFile, "template"));
}
return c.Success();
}
[Target] [Target]
public static BuildTargetResult LocateStage0(BuildTargetContext c) public static BuildTargetResult LocateStage0(BuildTargetContext c)
{ {

View file

@ -90,7 +90,7 @@ namespace Microsoft.DotNet.Scripts
IEnumerable<string> projectJsonFiles = Enumerable.Union( IEnumerable<string> projectJsonFiles = Enumerable.Union(
Directory.GetFiles(Dirs.RepoRoot, "project.json", SearchOption.AllDirectories), Directory.GetFiles(Dirs.RepoRoot, "project.json", SearchOption.AllDirectories),
Directory.GetFiles(Path.Combine(Dirs.RepoRoot, @"src\dotnet\commands\dotnet-new"), "project.json.pretemplate", SearchOption.AllDirectories)) Directory.GetFiles(Path.Combine(Dirs.RepoRoot, @"src\dotnet\commands\dotnet-new"), "project.json.template", SearchOption.AllDirectories))
.Where(p => !File.Exists(Path.Combine(Path.GetDirectoryName(p), noUpdateFileName))); .Where(p => !File.Exists(Path.Combine(Path.GetDirectoryName(p), noUpdateFileName)));
JObject projectRoot; JObject projectRoot;

View file

@ -6,7 +6,7 @@
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": { "Microsoft.NETCore.App": {
"type": "platform", "type": "platform",
"version": "$(NetCoreAppVersion)" "version": "1.0.0-rc3-004306"
} }
}, },
"frameworks": { "frameworks": {

View file

@ -13,7 +13,7 @@
"Microsoft.FSharp.Core.netcore": "1.0.0-alpha-160316", "Microsoft.FSharp.Core.netcore": "1.0.0-alpha-160316",
"Microsoft.NETCore.App": { "Microsoft.NETCore.App": {
"type": "platform", "type": "platform",
"version": "$(NetCoreAppVersion)" "version": "1.0.0-rc3-004306"
} }
}, },
"tools": { "tools": {