Merge rel/1.0.0 to master
This commit is contained in:
commit
b0a5d53ed5
72 changed files with 3664 additions and 231 deletions
|
@ -19,7 +19,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
}
|
||||
|
||||
[Required]
|
||||
public string RepoRoot { get; set; }
|
||||
public string ToolPath { get; set; }
|
||||
|
||||
[Required]
|
||||
public string SharedFrameworkVersion { get; set; }
|
||||
|
@ -27,25 +27,33 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
[Output]
|
||||
public String Version { get; set; }
|
||||
|
||||
private static string[] s_TemplatesToArchive = new string[]
|
||||
private static string[][] _templatesAndArgs = new string[][]
|
||||
{
|
||||
"CSharp_Console",
|
||||
new string[] { "mvc", "-au Individual -f netcoreapp1.0" },
|
||||
new string[] { "mvc", "-au Individual -f netcoreapp1.1" }
|
||||
};
|
||||
|
||||
public override bool Execute()
|
||||
{
|
||||
var dataToHash = string.Empty;
|
||||
|
||||
foreach (string templateToArchive in s_TemplatesToArchive)
|
||||
foreach (var newArgs in _templatesAndArgs)
|
||||
{
|
||||
var templatePath = Path.Combine(
|
||||
RepoRoot,
|
||||
"src",
|
||||
"dotnet",
|
||||
"commands",
|
||||
"dotnet-new",
|
||||
templateToArchive,
|
||||
"$projectName$.csproj");
|
||||
var targetDir = Path.GetTempFileName();
|
||||
File.Delete(targetDir);
|
||||
Directory.CreateDirectory(targetDir);
|
||||
var outputDir = Path.Combine(targetDir, newArgs[0]);
|
||||
Directory.CreateDirectory(outputDir);
|
||||
var newTask = new DotNetNew
|
||||
{
|
||||
ToolPath = ToolPath,
|
||||
TemplateType = newArgs[0],
|
||||
TemplateArgs = newArgs[1] + $" --debug:ephemeral-hive -n TempProject -o \"{outputDir}\"",
|
||||
HostObject = HostObject,
|
||||
BuildEngine = BuildEngine
|
||||
};
|
||||
newTask.Execute();
|
||||
var templatePath = Path.Combine(outputDir, "TempProject.csproj");
|
||||
|
||||
var rootElement = ProjectRootElement.Open(templatePath);
|
||||
var packageRefs = rootElement.Items.Where(i => i.ItemType == "PackageReference").ToList();
|
||||
|
@ -62,7 +70,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
}
|
||||
}
|
||||
|
||||
dataToHash += SharedFrameworkVersion;
|
||||
Directory.Delete(targetDir, true);
|
||||
}
|
||||
|
||||
Log.LogMessage($"NuGet Packages Archive Data To Hash: '{dataToHash}'");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue