Add support for pkgprojs in cli repp
- Move src\corehost\packaging to pkg\ directory. - Renamed PackageCoreHost to PackagePkgProjects and removed blocker - Updated copy of packages in PackagePkgProjects target to override (because there is no proper clean) - Update dir.props to match the package version for the runtime.json - Moved all CoreHost packages under Microsoft.NETCore.DotNetHost directory - Add the license files to the packages Add support for building Microsoft.NETCore.App meta-package - VersionNumber will be of form 1.0.0-rc2-<NETSTandard.Library build#>-<CLIbuild#> EX: 1.0.0-rc2-23931-002203
This commit is contained in:
parent
722cd3b681
commit
3ab4a30eb8
37 changed files with 315 additions and 31 deletions
|
@ -49,7 +49,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
return c.Success();
|
||||
}
|
||||
|
||||
[Target(nameof(PrepareTargets.Init), nameof(PackageCoreHost), nameof(CompileStage1), nameof(CompileStage2))]
|
||||
[Target(nameof(PrepareTargets.Init), nameof(PackagePkgProjects), nameof(CompileStage1), nameof(CompileStage2))]
|
||||
public static BuildTargetResult Compile(BuildTargetContext c)
|
||||
{
|
||||
return c.Success();
|
||||
|
@ -59,7 +59,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
private static string HostPolicyVer = "1.0.1";
|
||||
private static string HostFxrVer = "1.0.1";
|
||||
|
||||
[Target]
|
||||
[Target(nameof(PrepareTargets.Init))]
|
||||
public static BuildTargetResult CompileCoreHost(BuildTargetContext c)
|
||||
{
|
||||
var buildVersion = c.BuildContext.Get<BuildVersion>("BuildVersion");
|
||||
|
@ -144,12 +144,8 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
}
|
||||
|
||||
[Target(nameof(CompileCoreHost))]
|
||||
public static BuildTargetResult PackageCoreHost(BuildTargetContext c)
|
||||
public static BuildTargetResult PackagePkgProjects(BuildTargetContext c)
|
||||
{
|
||||
if (!string.Equals(Environment.GetEnvironmentVariable("BUILD_COREHOST_PACKAGES"), "1"))
|
||||
{
|
||||
return c.Success();
|
||||
}
|
||||
var buildVersion = c.BuildContext.Get<BuildVersion>("BuildVersion");
|
||||
var versionTag = buildVersion.ReleaseSuffix;
|
||||
var buildMajor = buildVersion.CommitCountString;
|
||||
|
@ -157,11 +153,11 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
|
||||
var version = buildVersion.NuGetVersion;
|
||||
var content = $@"{c.BuildContext["CommitHash"]}{Environment.NewLine}{version}{Environment.NewLine}";
|
||||
File.WriteAllText(Path.Combine(c.BuildContext.BuildDirectory, "src", "corehost", "packaging", "version.txt"), content);
|
||||
string corehostSrcDir = Path.Combine(c.BuildContext.BuildDirectory, "src", "corehost");
|
||||
var pkgDir = Path.Combine(c.BuildContext.BuildDirectory, "pkg");
|
||||
File.WriteAllText(Path.Combine(pkgDir, "version.txt"), content);
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
{
|
||||
Command.Create(Path.Combine(corehostSrcDir, "packaging", "pack.cmd"))
|
||||
Command.Create(Path.Combine(pkgDir, "pack.cmd"))
|
||||
// Workaround to arg escaping adding backslashes for arguments to .cmd scripts.
|
||||
.Environment("__WorkaroundCliCoreHostBuildArch", arch)
|
||||
.Environment("__WorkaroundCliCoreHostBinDir", Dirs.Corehost)
|
||||
|
@ -177,7 +173,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
}
|
||||
else
|
||||
{
|
||||
Exec(Path.Combine(corehostSrcDir, "packaging", "pack.sh"),
|
||||
Exec(Path.Combine(pkgDir, "pack.sh"),
|
||||
"--arch",
|
||||
"x64",
|
||||
"--hostbindir",
|
||||
|
@ -194,10 +190,10 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
versionTag);
|
||||
}
|
||||
int runtimeCount = 0;
|
||||
foreach (var file in Directory.GetFiles(Path.Combine(corehostSrcDir, "packaging", "bin", "packages"), "*.nupkg"))
|
||||
foreach (var file in Directory.GetFiles(Path.Combine(pkgDir, "bin", "packages"), "*.nupkg"))
|
||||
{
|
||||
var fileName = Path.GetFileName(file);
|
||||
File.Copy(file, Path.Combine(Dirs.Corehost, fileName));
|
||||
File.Copy(file, Path.Combine(Dirs.Corehost, fileName), true);
|
||||
runtimeCount += (fileName.StartsWith("runtime.") ? 1 : 0);
|
||||
}
|
||||
if (runtimeCount < 3)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue