[Fixes #3255] Added a web template to dotnet new
This commit is contained in:
parent
c33117e259
commit
4a88cff185
81 changed files with 3459 additions and 41 deletions
|
@ -18,7 +18,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
{
|
||||
public class PrepareTargets
|
||||
{
|
||||
[Target(nameof(Init), nameof(DownloadHostAndSharedFxArtifacts), nameof(RestorePackages))]
|
||||
[Target(nameof(Init), nameof(DownloadHostAndSharedFxArtifacts), nameof(RestorePackages), nameof(ZipTemplates))]
|
||||
public static BuildTargetResult Prepare(BuildTargetContext c) => c.Success();
|
||||
|
||||
[Target(nameof(CheckPrereqCmakePresent), nameof(CheckPlatformDependencies))]
|
||||
|
@ -35,9 +35,9 @@ 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
|
||||
[Target(
|
||||
nameof(GenerateVersions),
|
||||
nameof(CheckPrereqs),
|
||||
nameof(LocateStage0),
|
||||
nameof(GenerateVersions),
|
||||
nameof(CheckPrereqs),
|
||||
nameof(LocateStage0),
|
||||
nameof(ExpectedBuildArtifacts),
|
||||
nameof(SetTelemetryProfile))]
|
||||
public static BuildTargetResult Init(BuildTargetContext c)
|
||||
|
@ -75,7 +75,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
ReleaseSuffix = branchInfo["RELEASE_SUFFIX"],
|
||||
CommitCount = commitCount
|
||||
};
|
||||
|
||||
|
||||
|
||||
c.BuildContext["BuildVersion"] = buildVersion;
|
||||
c.BuildContext["CommitHash"] = commitHash;
|
||||
|
@ -86,6 +86,26 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
return c.Success();
|
||||
}
|
||||
|
||||
[Target]
|
||||
public static BuildTargetResult ZipTemplates(BuildTargetContext c)
|
||||
{
|
||||
var templateDirectories = Directory.GetDirectories(
|
||||
Path.Combine(Dirs.RepoRoot, "src", "dotnet", "commands", "dotnet-new"));
|
||||
|
||||
foreach (var directory in templateDirectories)
|
||||
{
|
||||
var zipFile = Path.Combine(Path.GetDirectoryName(directory), Path.GetFileName(directory) + ".zip");
|
||||
if (File.Exists(zipFile))
|
||||
{
|
||||
File.Delete(zipFile);
|
||||
}
|
||||
|
||||
ZipFile.CreateFromDirectory(directory, zipFile);
|
||||
}
|
||||
|
||||
return c.Success();
|
||||
}
|
||||
|
||||
[Target]
|
||||
public static BuildTargetResult LocateStage0(BuildTargetContext c)
|
||||
{
|
||||
|
@ -137,8 +157,8 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
}
|
||||
|
||||
[Target(
|
||||
nameof(ExpectedBuildArtifacts),
|
||||
nameof(DownloadHostAndSharedFxArchives),
|
||||
nameof(ExpectedBuildArtifacts),
|
||||
nameof(DownloadHostAndSharedFxArchives),
|
||||
nameof(DownloadHostAndSharedFxInstallers))]
|
||||
public static BuildTargetResult DownloadHostAndSharedFxArtifacts(BuildTargetContext c) => c.Success();
|
||||
|
||||
|
@ -487,8 +507,8 @@ cmake is required to build the native host 'corehost'";
|
|||
}
|
||||
|
||||
private static void AddInstallerArtifactToContext(
|
||||
BuildTargetContext c,
|
||||
string artifactPrefix,
|
||||
BuildTargetContext c,
|
||||
string artifactPrefix,
|
||||
string contextPrefix,
|
||||
string version)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue