diff --git a/Microsoft.DotNet.Cli.sln b/Microsoft.DotNet.Cli.sln
index bd9c2c513..03125bb8a 100644
--- a/Microsoft.DotNet.Cli.sln
+++ b/Microsoft.DotNet.Cli.sln
@@ -124,6 +124,11 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.Archive",
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "dotnet-build3.Tests", "test\dotnet-build3.Tests\dotnet-build3.Tests.xproj", "{49D7318E-D198-4E2B-BBEA-3A24D805F88D}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{89905EC4-BC0F-443B-8ADF-691321F10108}"
+ ProjectSection(SolutionItems) = preProject
+ build\Microsoft.DotNet.Cli.Prepare.targets = build\Microsoft.DotNet.Cli.Prepare.targets
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
diff --git a/build.proj b/build.proj
index 5ea2e224f..04246e6d5 100644
--- a/build.proj
+++ b/build.proj
@@ -1,7 +1,5 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
@@ -20,28 +24,75 @@
$(BaseOutputDirectory)/stage2
$(BaseOutputDirectory)/stage2compilation
$(BaseOutputDirectory)/intermediate
+ $(BaseOutputDirectory)/packages
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- @(BuildVersion ->'%(NugetVersion)')
+ $(BaseOutputDirectory)/$(VersionBadgeMoniker)_$(Configuration)_version_badge.svg
+ $(NugetVersion)
+
+ .zip
+ .tar.gz
+
+ .msi
+ .pkg
+ .deb
+
+ .exe
+ $(InstallerExtension)
+ $(InstallerExtension)
+
+ $(Rid)
+ $(OSName)-$(Architecture)
+
+
+ $(PackagesDirectory)/dotnet-sdk-$(ProductMonikerRid).$(SdkVersion)$(ArchiveExtension)
+ $(PackagesDirectory)/dotnet-sdk-$(ProductMonikerRid).$(SdkVersion)$(InstallerExtension)
+
+ $(PackagesDirectory)/dotnet-dev-$(ProductMonikerRid).$(SdkVersion)$(ArchiveExtension)
+ $(PackagesDirectory)/dotnet-dev-$(ProductMonikerRid).$(SdkVersion)$(BundleExtension)
+
+ $(PackagesDirectory)/dotnet-sharedframework-sdk-$(ProductMonikerRid).$(SdkVersion)$(ArchiveExtension)
+ $(PackagesDirectory)/dotnet-sharedframework-sdk-$(ProductMonikerRid).$(SdkVersion)$(BundleExtension)
+
+ $(PackagesDirectory)/dotnet-sdk-debug-$(ProductMonikerRid).$(SdkVersion)$(ArchiveExtension)
+ $(PackagesDirectory)/dotnet-sdk-debug-$(ProductMonikerRid).$(SdkVersion)$(InstallerExtension)
+
+
+ $(PackagesDirectory)/dotnet-host-$(ProductMonikerRid).$(SharedHostVersion)$(ArchiveExtension)
+ $(PackagesDirectory)/dotnet-host-$(ProductMonikerRid).$(SharedHostVersion)$(InstallerExtension)
+
+ $(PackagesDirectory)/dotnet-hostfxr-$(ProductMonikerRid).$(HostFxrVersion)$(ArchiveExtension)
+ $(PackagesDirectory)/dotnet-hostfxr-$(ProductMonikerRid).$(HostFxrVersion)$(InstallerExtension)
+
+ $(PackagesDirectory)/dotnet-sharedframework-$(ProductMonikerRid).$(SharedFrameworkVersion)$(ArchiveExtension)
+ $(PackagesDirectory)/dotnet-sharedframework-$(ProductMonikerRid).$(SharedFrameworkVersion)$(InstallerExtension)
+
+ $(PackagesDirectory)/dotnet-$(ProductMonikerRid).$(SharedFrameworkVersion)$(ArchiveExtension)
+ $(PackagesDirectory)/dotnet-$(ProductMonikerRid).$(SharedFrameworkVersion)$(BundleExtension)
+
Microsoft .NET Core 1.0.0 - SDK Preview 2
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/build_projects/dotnet-cli-build/Architecture.cs b/build_projects/dotnet-cli-build/Architecture.cs
deleted file mode 100644
index d807a1032..000000000
--- a/build_projects/dotnet-cli-build/Architecture.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.IO.Compression;
-using System.Runtime.InteropServices;
-using System.Net.Http;
-using Microsoft.Build.Utilities;
-using Microsoft.DotNet.Cli.Build.Framework;
-using Microsoft.DotNet.InternalAbstractions;
-using Microsoft.Build.Framework;
-using Microsoft.Build.Utilities;
-
-using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;
-
-namespace Microsoft.DotNet.Cli.Build
-{
- public class Architecture : Task
- {
- [Output]
- public string OutputArchitecture { get; set; }
-
- public override bool Execute()
- {
- OutputArchitecture = RuntimeEnvironment.RuntimeArchitecture;
-
- return true;
- }
- }
-}
diff --git a/build_projects/dotnet-cli-build/CheckPrereqs.cs b/build_projects/dotnet-cli-build/CheckPrereqs.cs
new file mode 100644
index 000000000..6b1894b06
--- /dev/null
+++ b/build_projects/dotnet-cli-build/CheckPrereqs.cs
@@ -0,0 +1,136 @@
+using System;
+using System.IO;
+using System.Linq;
+using System.Text;
+using Microsoft.Build.Utilities;
+using Microsoft.DotNet.Cli.Build.Framework;
+
+namespace Microsoft.DotNet.Cli.Build
+{
+ public class CheckPrereqs : Task
+ {
+ public override bool Execute()
+ {
+ Run(s => Log.LogMessage(s));
+
+ return true;
+ }
+
+ public static void Run(Action logInfo)
+ {
+ CheckCoreclrPlatformDependencies();
+ CheckInstallerBuildPlatformDependencies();
+
+ LocateStage0(logInfo);
+ }
+
+ private static void CheckCoreclrPlatformDependencies()
+ {
+ CheckUbuntuCoreclrAndCoreFxDependencies();
+ CheckCentOSCoreclrAndCoreFxDependencies();
+ }
+
+ private static void CheckInstallerBuildPlatformDependencies()
+ {
+ CheckUbuntuDebianPackageBuildDependencies();
+ }
+
+ private static void CheckUbuntuCoreclrAndCoreFxDependencies()
+ {
+ if (CurrentPlatform.IsPlatform(BuildPlatform.Ubuntu, "14.04"))
+ {
+ var errorMessageBuilder = new StringBuilder();
+ var stage0 = DotNetCli.Stage0.BinPath;
+
+ foreach (var package in PackageDependencies.UbuntuCoreclrAndCoreFxDependencies)
+ {
+ if (!AptDependencyUtility.PackageIsInstalled(package))
+ {
+ errorMessageBuilder.Append($"Error: Coreclr package dependency {package} missing.");
+ errorMessageBuilder.Append(Environment.NewLine);
+ errorMessageBuilder.Append($"-> install with apt-get install {package}");
+ errorMessageBuilder.Append(Environment.NewLine);
+ }
+ }
+
+ if (errorMessageBuilder.Length > 0)
+ {
+ throw new BuildFailureException(errorMessageBuilder.ToString());
+ }
+ }
+ }
+
+ private static void CheckCentOSCoreclrAndCoreFxDependencies()
+ {
+ if (CurrentPlatform.IsPlatform(BuildPlatform.CentOS))
+ {
+ var errorMessageBuilder = new StringBuilder();
+
+ foreach (var package in PackageDependencies.CentosCoreclrAndCoreFxDependencies)
+ {
+ if (!YumDependencyUtility.PackageIsInstalled(package))
+ {
+ errorMessageBuilder.Append($"Error: Coreclr package dependency {package} missing.");
+ errorMessageBuilder.Append(Environment.NewLine);
+ errorMessageBuilder.Append($"-> install with yum install {package}");
+ errorMessageBuilder.Append(Environment.NewLine);
+ }
+ }
+
+ if (errorMessageBuilder.Length > 0)
+ {
+ throw new BuildFailureException(errorMessageBuilder.ToString());
+ }
+ }
+ }
+
+ private static void CheckUbuntuDebianPackageBuildDependencies()
+ {
+ if (CurrentPlatform.IsPlatform(BuildPlatform.Ubuntu, "14.04"))
+ {
+ var messageBuilder = new StringBuilder();
+ var aptDependencyUtility = new AptDependencyUtility();
+
+
+ foreach (var package in PackageDependencies.DebianPackageBuildDependencies)
+ {
+ if (!AptDependencyUtility.PackageIsInstalled(package))
+ {
+ messageBuilder.Append($"Error: Debian package build dependency {package} missing.");
+ messageBuilder.Append(Environment.NewLine);
+ messageBuilder.Append($"-> install with apt-get install {package}");
+ messageBuilder.Append(Environment.NewLine);
+ }
+ }
+
+ if (messageBuilder.Length > 0)
+ {
+ throw new BuildFailureException(messageBuilder.ToString());
+ }
+ }
+ }
+
+ private static void LocateStage0(Action logInfo)
+ {
+ // We should have been run in the repo root, so locate the stage 0 relative to current directory
+ var stage0 = DotNetCli.Stage0.BinPath;
+
+ if (!Directory.Exists(stage0))
+ {
+ throw new BuildFailureException($"Stage 0 directory does not exist: {stage0}");
+ }
+
+ // Identify the version
+ string versionFile = Directory.GetFiles(stage0, ".version", SearchOption.AllDirectories).FirstOrDefault();
+
+ if (string.IsNullOrEmpty(versionFile))
+ {
+ throw new Exception($"'.version' file not found in '{stage0}' folder");
+ }
+
+ var version = File.ReadAllLines(versionFile);
+ logInfo($"Using Stage 0 Version: {version[1]}");
+ }
+ }
+}
+
diff --git a/build_projects/dotnet-cli-build/GenerateBuildVersion.cs b/build_projects/dotnet-cli-build/GenerateBuildVersion.cs
deleted file mode 100644
index c08887fc4..000000000
--- a/build_projects/dotnet-cli-build/GenerateBuildVersion.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.IO.Compression;
-using System.Runtime.InteropServices;
-using System.Net.Http;
-using Microsoft.Build.Utilities;
-using Microsoft.DotNet.Cli.Build.Framework;
-using Microsoft.DotNet.InternalAbstractions;
-using Microsoft.Build.Framework;
-using Microsoft.Build.Utilities;
-using System.Security.Cryptography;
-
-using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;
-
-namespace Microsoft.DotNet.Cli.Build
-{
- public class GenerateBuildVersionInfo : Task
- {
- [Required]
- public string RepoRoot { get; set; }
-
- [Output]
- public ITaskItem OutputBuildVersionInfo { get; set; }
-
- public override bool Execute()
- {
- var branchInfo = new BranchInfo(RepoRoot);
-
- var commitCount = GitUtils.GetCommitCount();
- var commitHash = GitUtils.GetCommitHash();
-
- var buildVersion = new BuildVersion()
- {
- Major = int.Parse(branchInfo.Entries["MAJOR_VERSION"]),
- Minor = int.Parse(branchInfo.Entries["MINOR_VERSION"]),
- Patch = int.Parse(branchInfo.Entries["PATCH_VERSION"]),
- ReleaseSuffix = branchInfo.Entries["RELEASE_SUFFIX"],
- CommitCount = commitCount
- };
-
- OutputBuildVersionInfo = ConstructBuildVersionInfoItem(buildVersion, commitHash);
-
- return true;
- }
-
- private ITaskItem ConstructBuildVersionInfoItem(BuildVersion buildVersion, string commitHash)
- {
- var versionInfo = new TaskItem();
- versionInfo.ItemSpec = "BuildVersionInfo";
-
- versionInfo.SetMetadata("CommitHash", commitHash);
- versionInfo.SetMetadata("Major", buildVersion.Major.ToString());
- versionInfo.SetMetadata("Minor", buildVersion.Minor.ToString());
- versionInfo.SetMetadata("Patch", buildVersion.Patch.ToString());
- versionInfo.SetMetadata("ReleaseSuffix", buildVersion.ReleaseSuffix);
- versionInfo.SetMetadata("CommitCount", buildVersion.CommitCountString);
- versionInfo.SetMetadata("VersionSuffix", buildVersion.VersionSuffix);
- versionInfo.SetMetadata("SimpleVersion", buildVersion.SimpleVersion);
- versionInfo.SetMetadata("NugetVersion", buildVersion.NuGetVersion);
- versionInfo.SetMetadata("MsiVersion", buildVersion.GenerateMsiVersion());
-
- return versionInfo;
- }
- }
-}
diff --git a/build_projects/dotnet-cli-build/GenerateBuildVersionInfo.cs b/build_projects/dotnet-cli-build/GenerateBuildVersionInfo.cs
new file mode 100644
index 000000000..1328998aa
--- /dev/null
+++ b/build_projects/dotnet-cli-build/GenerateBuildVersionInfo.cs
@@ -0,0 +1,84 @@
+using System.Globalization;
+using Microsoft.Build.Framework;
+using Microsoft.Build.Utilities;
+
+namespace Microsoft.DotNet.Cli.Build
+{
+ public class GenerateBuildVersionInfo : Task
+ {
+ [Required]
+ public string RepoRoot { get; set; }
+
+ [Output]
+ public int VersionMajor { get; set; }
+
+ [Output]
+ public int VersionMinor { get; set; }
+
+ [Output]
+ public int VersionPatch { get; set; }
+
+ [Output]
+ public string CommitHash { get; set; }
+
+ [Output]
+ public int CommitCount { get; set; }
+
+ [Output]
+ public string ReleaseSuffix { get; set; }
+
+ [Output]
+ public string VersionSuffix { get; set; }
+
+ [Output]
+ public string SimpleVersion { get; set; }
+
+ [Output]
+ public string NugetVersion { get; set; }
+
+ [Output]
+ public string MsiVersion { get; set; }
+
+ [Output]
+ public string VersionBadgeMoniker { get; set; }
+
+ [Output]
+ public string Channel { get; set; }
+
+ [Output]
+ public string BranchName { get; set; }
+
+ public override bool Execute()
+ {
+ var branchInfo = new BranchInfo(RepoRoot);
+
+ var commitCount = GitUtils.GetCommitCount();
+ var commitHash = GitUtils.GetCommitHash();
+
+ var buildVersion = new BuildVersion()
+ {
+ Major = int.Parse(branchInfo.Entries["MAJOR_VERSION"]),
+ Minor = int.Parse(branchInfo.Entries["MINOR_VERSION"]),
+ Patch = int.Parse(branchInfo.Entries["PATCH_VERSION"]),
+ ReleaseSuffix = branchInfo.Entries["RELEASE_SUFFIX"],
+ CommitCount = commitCount
+ };
+
+ VersionMajor = buildVersion.Major;
+ VersionMinor = buildVersion.Minor;
+ VersionPatch = buildVersion.Patch;
+ CommitHash = commitHash;
+ CommitCount = commitCount;
+ ReleaseSuffix = buildVersion.ReleaseSuffix;
+ VersionSuffix = buildVersion.VersionSuffix;
+ SimpleVersion = buildVersion.SimpleVersion;
+ NugetVersion = buildVersion.NuGetVersion;
+ MsiVersion = buildVersion.GenerateMsiVersion();
+ VersionBadgeMoniker = Monikers.GetBadgeMoniker();
+ Channel = branchInfo.Entries["CHANNEL"];
+ BranchName= branchInfo.Entries["BRANCH_NAME"];
+
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/build_projects/dotnet-cli-build/GetCurrentRuntimeInformation.cs b/build_projects/dotnet-cli-build/GetCurrentRuntimeInformation.cs
new file mode 100644
index 000000000..e11e40ed3
--- /dev/null
+++ b/build_projects/dotnet-cli-build/GetCurrentRuntimeInformation.cs
@@ -0,0 +1,27 @@
+using Microsoft.Build.Framework;
+using Microsoft.Build.Utilities;
+using Microsoft.DotNet.InternalAbstractions;
+
+namespace Microsoft.DotNet.Cli.Build
+{
+ public class GetCurrentRuntimeInformation : Task
+ {
+ [Output]
+ public string Rid { get; set; }
+
+ [Output]
+ public string Architecture { get; set; }
+
+ [Output]
+ public string OSName { get; set; }
+
+ public override bool Execute()
+ {
+ Rid = RuntimeEnvironment.GetRuntimeIdentifier();
+ Architecture = RuntimeEnvironment.RuntimeArchitecture;
+ OSName = Monikers.GetOSShortName();
+
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/build_projects/dotnet-cli-build/PrepareTargets.cs b/build_projects/dotnet-cli-build/PrepareTargets.cs
index 7661ba186..0f061c300 100644
--- a/build_projects/dotnet-cli-build/PrepareTargets.cs
+++ b/build_projects/dotnet-cli-build/PrepareTargets.cs
@@ -2,18 +2,13 @@
using System.Collections.Generic;
using System.Globalization;
using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Text.RegularExpressions;
+using System.IO.Compression;
+using Microsoft.Build.Utilities;
using Microsoft.DotNet.Cli.Build.Framework;
using Microsoft.DotNet.InternalAbstractions;
-using Newtonsoft.Json.Linq;
using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;
using static Microsoft.DotNet.Cli.Build.FS;
using static Microsoft.DotNet.Cli.Build.Utils;
-using System.IO.Compression;
-using Microsoft.Build.Utilities;
namespace Microsoft.DotNet.Cli.Build
{
@@ -38,43 +33,11 @@ namespace Microsoft.DotNet.Cli.Build
return c.Success();
}
- public static BuildTargetResult CheckPrereqs(BuildTargetContext c)
- {
- CheckPrereqCmakePresent(c);
- CheckPlatformDependencies(c);
-
- return c.Success();
- }
-
- public static BuildTargetResult CheckPlatformDependencies(BuildTargetContext c)
- {
- CheckCoreclrPlatformDependencies(c);
- CheckInstallerBuildPlatformDependencies(c);
-
- return c.Success();
- }
-
- public static BuildTargetResult CheckCoreclrPlatformDependencies(BuildTargetContext c)
- {
- CheckUbuntuCoreclrAndCoreFxDependencies(c);
- CheckCentOSCoreclrAndCoreFxDependencies(c);
-
- return c.Success();
- }
-
- public static BuildTargetResult CheckInstallerBuildPlatformDependencies(BuildTargetContext c)
- {
- CheckUbuntuDebianPackageBuildDependencies(c);
-
- return c.Success();
- }
-
// All major targets will depend on this in order to ensure variables are set up right if they are run independently
public static BuildTargetResult Init(BuildTargetContext c)
{
GenerateVersions(c);
- CheckPrereqs(c);
- LocateStage0(c);
+ CheckPrereqs.Run(s => c.Info(s));
ExpectedBuildArtifacts(c);
SetTelemetryProfile(c);
@@ -140,29 +103,7 @@ namespace Microsoft.DotNet.Cli.Build
return c.Success();
}
- public static BuildTargetResult LocateStage0(BuildTargetContext c)
- {
- // We should have been run in the repo root, so locate the stage 0 relative to current directory
- var stage0 = DotNetCli.Stage0.BinPath;
-
- if (!Directory.Exists(stage0))
- {
- return c.Failed($"Stage 0 directory does not exist: {stage0}");
- }
-
- // Identify the version
- string versionFile = Directory.GetFiles(stage0, ".version", SearchOption.AllDirectories).FirstOrDefault();
-
- if (string.IsNullOrEmpty(versionFile))
- {
- throw new Exception($"'.version' file not found in '{stage0}' folder");
- }
-
- var version = File.ReadAllLines(versionFile);
- c.Info($"Using Stage 0 Version: {version[1]}");
-
- return c.Success();
- }
+
public static BuildTargetResult ExpectedBuildArtifacts(BuildTargetContext c)
{
@@ -379,130 +320,6 @@ namespace Microsoft.DotNet.Cli.Build
return c.Success();
}
- public static BuildTargetResult CheckUbuntuDebianPackageBuildDependencies(BuildTargetContext c)
- {
- if (CurrentPlatform.IsPlatform(BuildPlatform.Ubuntu, "14.04"))
- {
- var messageBuilder = new StringBuilder();
- var aptDependencyUtility = new AptDependencyUtility();
-
-
- foreach (var package in PackageDependencies.DebianPackageBuildDependencies)
- {
- if (!AptDependencyUtility.PackageIsInstalled(package))
- {
- messageBuilder.Append($"Error: Debian package build dependency {package} missing.");
- messageBuilder.Append(Environment.NewLine);
- messageBuilder.Append($"-> install with apt-get install {package}");
- messageBuilder.Append(Environment.NewLine);
- }
- }
-
- if (messageBuilder.Length == 0)
- {
- return c.Success();
- }
- else
- {
- return c.Failed(messageBuilder.ToString());
- }
- }
-
- return c.Success();
- }
-
- public static BuildTargetResult CheckUbuntuCoreclrAndCoreFxDependencies(BuildTargetContext c)
- {
- if (CurrentPlatform.IsPlatform(BuildPlatform.Ubuntu, "14.04"))
- {
- var errorMessageBuilder = new StringBuilder();
- var stage0 = DotNetCli.Stage0.BinPath;
-
- foreach (var package in PackageDependencies.UbuntuCoreclrAndCoreFxDependencies)
- {
- if (!AptDependencyUtility.PackageIsInstalled(package))
- {
- errorMessageBuilder.Append($"Error: Coreclr package dependency {package} missing.");
- errorMessageBuilder.Append(Environment.NewLine);
- errorMessageBuilder.Append($"-> install with apt-get install {package}");
- errorMessageBuilder.Append(Environment.NewLine);
- }
- }
-
- if (errorMessageBuilder.Length == 0)
- {
- return c.Success();
- }
- else
- {
- return c.Failed(errorMessageBuilder.ToString());
- }
- }
-
- return c.Success();
- }
-
- public static BuildTargetResult CheckCentOSCoreclrAndCoreFxDependencies(BuildTargetContext c)
- {
- if (CurrentPlatform.IsPlatform(BuildPlatform.CentOS))
- {
- var errorMessageBuilder = new StringBuilder();
-
- foreach (var package in PackageDependencies.CentosCoreclrAndCoreFxDependencies)
- {
- if (!YumDependencyUtility.PackageIsInstalled(package))
- {
- errorMessageBuilder.Append($"Error: Coreclr package dependency {package} missing.");
- errorMessageBuilder.Append(Environment.NewLine);
- errorMessageBuilder.Append($"-> install with yum install {package}");
- errorMessageBuilder.Append(Environment.NewLine);
- }
- }
-
- if (errorMessageBuilder.Length == 0)
- {
- return c.Success();
- }
- else
- {
- return c.Failed(errorMessageBuilder.ToString());
- }
- }
-
- return c.Success();
- }
-
- public static BuildTargetResult CheckPrereqCmakePresent(BuildTargetContext c)
- {
- try
- {
- Command.Create("cmake", "--version")
- .CaptureStdOut()
- .CaptureStdErr()
- .Execute();
- }
- catch (Exception ex)
- {
- string message = $@"Error running cmake: {ex.Message}
-cmake is required to build the native host 'corehost'";
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
- {
- message += Environment.NewLine + "Download it from https://www.cmake.org";
- }
- else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
- {
- message += Environment.NewLine + "Ubuntu: 'sudo apt-get install cmake'";
- }
- else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
- {
- message += Environment.NewLine + "OS X w/Homebrew: 'brew install cmake'";
- }
- return c.Failed(message);
- }
-
- return c.Success();
- }
-
public static BuildTargetResult SetTelemetryProfile(BuildTargetContext c)
{
var gitResult = Cmd("git", "rev-parse", "HEAD")
diff --git a/build_projects/dotnet-cli-build/Rid.cs b/build_projects/dotnet-cli-build/Rid.cs
deleted file mode 100644
index f68513e7d..000000000
--- a/build_projects/dotnet-cli-build/Rid.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.IO.Compression;
-using System.Runtime.InteropServices;
-using System.Net.Http;
-using Microsoft.Build.Utilities;
-using Microsoft.DotNet.Cli.Build.Framework;
-using Microsoft.DotNet.InternalAbstractions;
-using Microsoft.Build.Framework;
-using Microsoft.Build.Utilities;
-
-using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;
-
-namespace Microsoft.DotNet.Cli.Build
-{
- public class Rid : Task
- {
- [Output]
- public string OutputRid { get; set; }
-
- public override bool Execute()
- {
- OutputRid = RuntimeEnvironment.GetRuntimeIdentifier();
-
- return true;
- }
- }
-}
diff --git a/build_projects/dotnet-cli-build/SetEnvVar.cs b/build_projects/dotnet-cli-build/SetEnvVar.cs
new file mode 100644
index 000000000..4d70c5f25
--- /dev/null
+++ b/build_projects/dotnet-cli-build/SetEnvVar.cs
@@ -0,0 +1,22 @@
+using System;
+using Microsoft.Build.Framework;
+using Microsoft.Build.Utilities;
+
+namespace Microsoft.DotNet.Cli.Build
+{
+ public class SetEnvVar : Task
+ {
+ [Required]
+ public string Name { get; set; }
+
+ [Required]
+ public string Value { get; set; }
+
+ public override bool Execute()
+ {
+ Environment.SetEnvironmentVariable(Name, Value);
+
+ return true;
+ }
+ }
+}