Move CheckPrereqs to MSBuild (#3895)
* Move CheckPrereqs to MSBuild * Tabs to Spaces * PR feedback
This commit is contained in:
parent
24d2e638d5
commit
9446a81a25
9 changed files with 126 additions and 278 deletions
|
@ -2,7 +2,6 @@
|
||||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<UsingTask TaskName="GetCurrentRuntimeInformation" AssemblyFile="$(CLIBuildDll)" />
|
<UsingTask TaskName="GetCurrentRuntimeInformation" AssemblyFile="$(CLIBuildDll)" />
|
||||||
<UsingTask TaskName="GenerateBuildVersionInfo" AssemblyFile="$(CLIBuildDll)" />
|
<UsingTask TaskName="GenerateBuildVersionInfo" AssemblyFile="$(CLIBuildDll)" />
|
||||||
<UsingTask TaskName="CheckPrereqs" AssemblyFile="$(CLIBuildDll)" />
|
|
||||||
<UsingTask TaskName="SetEnvVar" AssemblyFile="$(CLIBuildDll)" />
|
<UsingTask TaskName="SetEnvVar" AssemblyFile="$(CLIBuildDll)" />
|
||||||
<UsingTask TaskName="DotNetBuild" AssemblyFile="$(CLIBuildDll)" />
|
<UsingTask TaskName="DotNetBuild" AssemblyFile="$(CLIBuildDll)" />
|
||||||
<UsingTask TaskName="DotNetPack" AssemblyFile="$(CLIBuildDll)" />
|
<UsingTask TaskName="DotNetPack" AssemblyFile="$(CLIBuildDll)" />
|
||||||
|
@ -12,11 +11,20 @@
|
||||||
<UsingTask TaskName="ExtractArchive" AssemblyFile="$(CLIBuildDll)" />
|
<UsingTask TaskName="ExtractArchive" AssemblyFile="$(CLIBuildDll)" />
|
||||||
<UsingTask TaskName="ArchiveDirectory" AssemblyFile="$(CLIBuildDll)" />
|
<UsingTask TaskName="ArchiveDirectory" AssemblyFile="$(CLIBuildDll)" />
|
||||||
|
|
||||||
|
<Import Project="prepare/CheckPrereqs.targets" />
|
||||||
|
|
||||||
<Target Name="Prepare"
|
<Target Name="Prepare"
|
||||||
DependsOnTargets="Init;DownloadHostAndSharedFxArtifacts;RestorePackages;ZipTemplates" />
|
DependsOnTargets="Init;DownloadHostAndSharedFxArtifacts;RestorePackages;ZipTemplates" />
|
||||||
|
|
||||||
<Target Name="Init"
|
<Target Name="Init"
|
||||||
DependsOnTargets="BuildDotnetCliBuildFramework">
|
DependsOnTargets="InitializeCommonProps;
|
||||||
|
BuildDotnetCliBuildFramework;
|
||||||
|
CheckPrereqs;">
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="InitializeCommonProps"
|
||||||
|
DependsOnTargets="BuildDotnetCliBuildFramework" >
|
||||||
|
|
||||||
<!-- Current Runtime Information -->
|
<!-- Current Runtime Information -->
|
||||||
<GetCurrentRuntimeInformation>
|
<GetCurrentRuntimeInformation>
|
||||||
<Output TaskParameter="Rid" PropertyName="Rid" />
|
<Output TaskParameter="Rid" PropertyName="Rid" />
|
||||||
|
@ -41,7 +49,7 @@
|
||||||
<OutputDirectory>$(Stage2Directory)/</OutputDirectory>
|
<OutputDirectory>$(Stage2Directory)/</OutputDirectory>
|
||||||
<Stage2CompilationDirectory>$(BaseOutputDirectory)/stage2compilation</Stage2CompilationDirectory>
|
<Stage2CompilationDirectory>$(BaseOutputDirectory)/stage2compilation</Stage2CompilationDirectory>
|
||||||
<IntermediateDirectory>$(BaseOutputDirectory)/intermediate</IntermediateDirectory>
|
<IntermediateDirectory>$(BaseOutputDirectory)/intermediate</IntermediateDirectory>
|
||||||
<PackagesDirectory>$(BaseOutputDirectory)/packages</PackagesDirectory>
|
<PackagesDirectory>$(BaseOutputDirectory)/packages</PackagesDirectory>
|
||||||
<SharedFrameworkPublishDirectory>$(IntermediateDirectory)/sharedFrameworkPublish</SharedFrameworkPublishDirectory>
|
<SharedFrameworkPublishDirectory>$(IntermediateDirectory)/sharedFrameworkPublish</SharedFrameworkPublishDirectory>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@ -64,7 +72,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<VersionBadge>$(BaseOutputDirectory)/$(VersionBadgeMoniker)_$(Configuration)_version_badge.svg</VersionBadge>
|
<VersionBadge>$(BaseOutputDirectory)/$(VersionBadgeMoniker)_$(Configuration)_version_badge.svg</VersionBadge>
|
||||||
<SdkVersion>$(NugetVersion)</SdkVersion>
|
<SdkVersion>$(NugetVersion)</SdkVersion>
|
||||||
|
|
||||||
<SdkNugetVersion>$(VersionMajor).$(VersionMinor).$(VersionPatch)-preview3-$(CommitCount)</SdkNugetVersion>
|
<SdkNugetVersion>$(VersionMajor).$(VersionMinor).$(VersionPatch)-preview3-$(CommitCount)</SdkNugetVersion>
|
||||||
<ProjectModelNugetVersion>$(VersionMajor).$(VersionMinor).$(VersionPatch)-rc4-$(CommitCount)</ProjectModelNugetVersion>
|
<ProjectModelNugetVersion>$(VersionMajor).$(VersionMinor).$(VersionPatch)-rc4-$(CommitCount)</ProjectModelNugetVersion>
|
||||||
<DependencyModelAndInternalAbstractionsNugetVersion>$(VersionMajor).$(VersionMinor).1-beta-$(CommitCount)</DependencyModelAndInternalAbstractionsNugetVersion>
|
<DependencyModelAndInternalAbstractionsNugetVersion>$(VersionMajor).$(VersionMinor).1-beta-$(CommitCount)</DependencyModelAndInternalAbstractionsNugetVersion>
|
||||||
|
@ -106,8 +114,6 @@
|
||||||
<CombinedFrameworkHostCompressedFileName>dotnet-$(ProductMonikerRid).$(SharedFrameworkVersion)$(ArchiveExtension)</CombinedFrameworkHostCompressedFileName>
|
<CombinedFrameworkHostCompressedFileName>dotnet-$(ProductMonikerRid).$(SharedFrameworkVersion)$(ArchiveExtension)</CombinedFrameworkHostCompressedFileName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<CheckPrereqs />
|
|
||||||
|
|
||||||
<!-- SetTelemetryProfile -->
|
<!-- SetTelemetryProfile -->
|
||||||
<SetEnvVar Name="DOTNET_CLI_TELEMETRY_PROFILE" Value="$(DOTNET_CLI_TELEMETRY_PROFILE);https://github.com/dotnet/cli;$(CommitHash)" />
|
<SetEnvVar Name="DOTNET_CLI_TELEMETRY_PROFILE" Value="$(DOTNET_CLI_TELEMETRY_PROFILE);https://github.com/dotnet/cli;$(CommitHash)" />
|
||||||
</Target>
|
</Target>
|
||||||
|
@ -164,7 +170,7 @@
|
||||||
InputFile="%(_DownloadAndExtractItem.DownloadFileName)"
|
InputFile="%(_DownloadAndExtractItem.DownloadFileName)"
|
||||||
DestinationDirectory="%(_DownloadAndExtractItem.ExtractDestintation)" />
|
DestinationDirectory="%(_DownloadAndExtractItem.ExtractDestintation)" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="RestorePackages"
|
<Target Name="RestorePackages"
|
||||||
DependsOnTargets="SetupRestorePackagesInputsOutputs;Init"
|
DependsOnTargets="SetupRestorePackagesInputsOutputs;Init"
|
||||||
Inputs="@(RestorePackagesInput)"
|
Inputs="@(RestorePackagesInput)"
|
||||||
|
@ -180,7 +186,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<SrcToolsLockFiles Include="$(RepoRoot)/src/**/project.lock.json;$(RepoRoot)/tools/**/project.lock.json" />
|
<SrcToolsLockFiles Include="$(RepoRoot)/src/**/project.lock.json;$(RepoRoot)/tools/**/project.lock.json" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Delete Files="@(SrcToolsLockFiles)" />
|
<Delete Files="@(SrcToolsLockFiles)" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="SetupRestorePackagesInputsOutputs">
|
<Target Name="SetupRestorePackagesInputsOutputs">
|
||||||
|
@ -196,7 +202,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<DotNetNewArchive Include="$([System.IO.Directory]::GetDirectories($(_DotNetNewFolder)))" />
|
<DotNetNewArchive Include="$([System.IO.Directory]::GetDirectories($(_DotNetNewFolder)))" />
|
||||||
|
|
||||||
<ZipTemplatesInput Include="$(_DotNetNewFolder)/**" Exclude="$(_DotNetNewFolder)/*.zip" />
|
<ZipTemplatesInput Include="$(_DotNetNewFolder)/**" Exclude="$(_DotNetNewFolder)/*.zip" />
|
||||||
<ZipTemplatesOutput Include="@(DotNetNewArchive->'%(RelativeDir)/$([System.IO.Path]::GetFileName('%(DotNetNewArchive.FullPath)')).zip')" />
|
<ZipTemplatesOutput Include="@(DotNetNewArchive->'%(RelativeDir)/$([System.IO.Path]::GetFileName('%(DotNetNewArchive.FullPath)')).zip')" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -206,7 +212,7 @@
|
||||||
DependsOnTargets="SetupZipTemplatesInputsOutputs"
|
DependsOnTargets="SetupZipTemplatesInputsOutputs"
|
||||||
Inputs="@(ZipTemplatesInput)"
|
Inputs="@(ZipTemplatesInput)"
|
||||||
Outputs="@(ZipTemplatesOutput)">
|
Outputs="@(ZipTemplatesOutput)">
|
||||||
|
|
||||||
<ArchiveDirectory InputDirectory="%(DotNetNewArchive.FullPath)"
|
<ArchiveDirectory InputDirectory="%(DotNetNewArchive.FullPath)"
|
||||||
FileName="$([System.IO.Path]::GetFileName(%(DotNetNewArchive.FullPath)))"
|
FileName="$([System.IO.Path]::GetFileName(%(DotNetNewArchive.FullPath)))"
|
||||||
OutputDirectory="%(DotNetNewArchive.RelativeDir)"
|
OutputDirectory="%(DotNetNewArchive.RelativeDir)"
|
||||||
|
|
12
build/prepare/CentosCoreclrAndCoreFxDependencies.props
Normal file
12
build/prepare/CentosCoreclrAndCoreFxDependencies.props
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<CentosCoreclrAndCoreFxDependencies Include="unzip" />
|
||||||
|
<CentosCoreclrAndCoreFxDependencies Include="libunwind" />
|
||||||
|
<CentosCoreclrAndCoreFxDependencies Include="gettext" />
|
||||||
|
<CentosCoreclrAndCoreFxDependencies Include="libcurl-devel" />
|
||||||
|
<CentosCoreclrAndCoreFxDependencies Include="openssl-devel" />
|
||||||
|
<CentosCoreclrAndCoreFxDependencies Include="zlib" />
|
||||||
|
<CentosCoreclrAndCoreFxDependencies Include="libicu-devel" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
41
build/prepare/CheckPrereqs.targets
Normal file
41
build/prepare/CheckPrereqs.targets
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="UbuntuCoreclrAndCoreFxDependencies.props" />
|
||||||
|
<Import Project="DebianPackageBuildDependencies.props" />
|
||||||
|
<Import Project="CentosCoreclrAndCoreFxDependencies.props" />
|
||||||
|
|
||||||
|
<Target Name="CheckPrereqs"
|
||||||
|
DependsOnTargets="InitializeCommonProps;
|
||||||
|
CheckUbuntuAptGetDependencies;
|
||||||
|
CheckCentOsYumDependencies;">
|
||||||
|
|
||||||
|
<Message Text="Using Stage0 version:" />
|
||||||
|
<Exec Command="$(DotnetStage0) --version" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="CheckUbuntuAptGetDependencies"
|
||||||
|
Condition=" '$(Rid)' == 'ubuntu.14.04-x64' ">
|
||||||
|
|
||||||
|
<Exec Command="dpkg -s %(UbuntuCoreclrAndCoreFxDependencies.Identity)" />
|
||||||
|
|
||||||
|
<Exec Command="dpkg -s %(DebianPackageBuildDependencies.Identity)" />
|
||||||
|
|
||||||
|
<OnError ExecuteTargets="ShowAptGetUsage" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="ShowAptGetUsage">
|
||||||
|
<Message Text="Install the missing dependency with `sudo apt-get install {package}`." />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="CheckCentOsYumDependencies"
|
||||||
|
Condition=" '$(OSName)' == 'centos' ">
|
||||||
|
|
||||||
|
<Exec Command="yum list installed %(CentosCoreclrAndCoreFxDependencies.Identity)" />
|
||||||
|
|
||||||
|
<OnError ExecuteTargets="ShowYumUsage" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="ShowYumUsage">
|
||||||
|
<Message Text="Install the missing dependency with `yum install {package}`." />
|
||||||
|
</Target>
|
||||||
|
</Project>
|
8
build/prepare/DebianPackageBuildDependencies.props
Normal file
8
build/prepare/DebianPackageBuildDependencies.props
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<DebianPackageBuildDependencies Include="devscripts" />
|
||||||
|
<DebianPackageBuildDependencies Include="debhelper" />
|
||||||
|
<DebianPackageBuildDependencies Include="build-essential" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
49
build/prepare/UbuntuCoreclrAndCoreFxDependencies.props
Normal file
49
build/prepare/UbuntuCoreclrAndCoreFxDependencies.props
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libc6" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libedit2" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libffi6" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libgcc1" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libicu52" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="liblldb-3.6" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libllvm3.6" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="liblttng-ust0" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="liblzma5" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libncurses5" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libpython2.7" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libstdc++6" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libtinfo5" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libunwind8" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="liburcu1" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libuuid1" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="zlib1g" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libasn1-8-heimdal" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libcomerr2" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libcurl3" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libgcrypt11" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libgnutls26" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libgpg-error0" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libgssapi3-heimdal" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libgssapi-krb5-2" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libhcrypto4-heimdal" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libheimbase1-heimdal" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libheimntlm0-heimdal" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libhx509-5-heimdal" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libidn11" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libk5crypto3" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libkeyutils1" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libkrb5-26-heimdal" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libkrb5-3" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libkrb5support0" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libldap-2.4-2" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libp11-kit0" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libroken18-heimdal" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="librtmp0" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libsasl2-2" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libsqlite3-0" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libssl1.0.0" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libtasn1-6" />
|
||||||
|
<UbuntuCoreclrAndCoreFxDependencies Include="libwind0-heimdal" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
|
@ -1,127 +0,0 @@
|
||||||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
||||||
|
|
||||||
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()
|
|
||||||
{
|
|
||||||
return CheckCoreclrPlatformDependencies() &&
|
|
||||||
CheckInstallerBuildPlatformDependencies() &&
|
|
||||||
LocateStage0();
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool CheckCoreclrPlatformDependencies()
|
|
||||||
{
|
|
||||||
return CheckUbuntuCoreclrAndCoreFxDependencies() &&
|
|
||||||
CheckCentOSCoreclrAndCoreFxDependencies();
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool CheckInstallerBuildPlatformDependencies()
|
|
||||||
{
|
|
||||||
return CheckUbuntuDebianPackageBuildDependencies();
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool CheckUbuntuCoreclrAndCoreFxDependencies()
|
|
||||||
{
|
|
||||||
bool isSuccessful = true;
|
|
||||||
|
|
||||||
if (CurrentPlatform.IsPlatform(BuildPlatform.Ubuntu, "14.04"))
|
|
||||||
{
|
|
||||||
var stage0 = DotNetCli.Stage0.BinPath;
|
|
||||||
|
|
||||||
foreach (var package in PackageDependencies.UbuntuCoreclrAndCoreFxDependencies)
|
|
||||||
{
|
|
||||||
if (!AptDependencyUtility.PackageIsInstalled(package))
|
|
||||||
{
|
|
||||||
isSuccessful = false;
|
|
||||||
|
|
||||||
Log.LogError($"Coreclr package dependency {package} missing. Install with `apt-get install {package}`");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return isSuccessful;
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool CheckCentOSCoreclrAndCoreFxDependencies()
|
|
||||||
{
|
|
||||||
var isSuccessful = true;
|
|
||||||
|
|
||||||
if (CurrentPlatform.IsPlatform(BuildPlatform.CentOS))
|
|
||||||
{
|
|
||||||
foreach (var package in PackageDependencies.CentosCoreclrAndCoreFxDependencies)
|
|
||||||
{
|
|
||||||
if (!YumDependencyUtility.PackageIsInstalled(package))
|
|
||||||
{
|
|
||||||
isSuccessful = false;
|
|
||||||
|
|
||||||
Log.LogError($"Coreclr package dependency {package} missing. Install with yum install {package}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return isSuccessful;
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool CheckUbuntuDebianPackageBuildDependencies()
|
|
||||||
{
|
|
||||||
var isSuccessful = true;
|
|
||||||
|
|
||||||
if (CurrentPlatform.IsPlatform(BuildPlatform.Ubuntu, "14.04"))
|
|
||||||
{
|
|
||||||
var aptDependencyUtility = new AptDependencyUtility();
|
|
||||||
|
|
||||||
foreach (var package in PackageDependencies.DebianPackageBuildDependencies)
|
|
||||||
{
|
|
||||||
if (!AptDependencyUtility.PackageIsInstalled(package))
|
|
||||||
{
|
|
||||||
isSuccessful = false;
|
|
||||||
|
|
||||||
Log.LogError($"Debian package build dependency {package} missing. Install with apt-get install {package}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return isSuccessful;
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool LocateStage0()
|
|
||||||
{
|
|
||||||
// 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))
|
|
||||||
{
|
|
||||||
Log.LogError($"Stage 0 directory does not exist: {stage0}");
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Identify the version
|
|
||||||
string versionFile = Directory.GetFiles(stage0, ".version", SearchOption.AllDirectories).FirstOrDefault();
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(versionFile))
|
|
||||||
{
|
|
||||||
Log.LogError($"'.version' file not found in '{stage0}' folder");
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
var version = File.ReadAllLines(versionFile);
|
|
||||||
|
|
||||||
Log.LogMessage($"Using Stage 0 Version: {version[1]}");
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,96 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Cli.Build
|
|
||||||
{
|
|
||||||
public class PackageDependencies
|
|
||||||
{
|
|
||||||
public static string[] DebianPackageBuildDependencies
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return new string[]
|
|
||||||
{
|
|
||||||
"devscripts",
|
|
||||||
"debhelper",
|
|
||||||
"build-essential"
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string[] UbuntuCoreclrAndCoreFxDependencies
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return new string[]
|
|
||||||
{
|
|
||||||
"libc6",
|
|
||||||
"libedit2",
|
|
||||||
"libffi6",
|
|
||||||
"libgcc1",
|
|
||||||
"libicu52",
|
|
||||||
"liblldb-3.6",
|
|
||||||
"libllvm3.6",
|
|
||||||
"liblttng-ust0",
|
|
||||||
"liblzma5",
|
|
||||||
"libncurses5",
|
|
||||||
"libpython2.7",
|
|
||||||
"libstdc++6",
|
|
||||||
"libtinfo5",
|
|
||||||
"libunwind8",
|
|
||||||
"liburcu1",
|
|
||||||
"libuuid1",
|
|
||||||
"zlib1g",
|
|
||||||
"libasn1-8-heimdal",
|
|
||||||
"libcomerr2",
|
|
||||||
"libcurl3",
|
|
||||||
"libgcrypt11",
|
|
||||||
"libgnutls26",
|
|
||||||
"libgpg-error0",
|
|
||||||
"libgssapi3-heimdal",
|
|
||||||
"libgssapi-krb5-2",
|
|
||||||
"libhcrypto4-heimdal",
|
|
||||||
"libheimbase1-heimdal",
|
|
||||||
"libheimntlm0-heimdal",
|
|
||||||
"libhx509-5-heimdal",
|
|
||||||
"libidn11",
|
|
||||||
"libk5crypto3",
|
|
||||||
"libkeyutils1",
|
|
||||||
"libkrb5-26-heimdal",
|
|
||||||
"libkrb5-3",
|
|
||||||
"libkrb5support0",
|
|
||||||
"libldap-2.4-2",
|
|
||||||
"libp11-kit0",
|
|
||||||
"libroken18-heimdal",
|
|
||||||
"librtmp0",
|
|
||||||
"libsasl2-2",
|
|
||||||
"libsqlite3-0",
|
|
||||||
"libssl1.0.0",
|
|
||||||
"libtasn1-6",
|
|
||||||
"libwind0-heimdal"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string[] CentosCoreclrAndCoreFxDependencies
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return new string[]
|
|
||||||
{
|
|
||||||
"unzip",
|
|
||||||
"libunwind",
|
|
||||||
"gettext",
|
|
||||||
"libcurl-devel",
|
|
||||||
"openssl-devel",
|
|
||||||
"zlib",
|
|
||||||
"libicu-devel"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.IO;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.DotNet.Cli.Build.Framework;
|
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Cli.Build
|
|
||||||
{
|
|
||||||
public class AptDependencyUtility
|
|
||||||
{
|
|
||||||
public static bool PackageIsInstalled(string packageName)
|
|
||||||
{
|
|
||||||
var result = Command.Create("dpkg", "-s", packageName)
|
|
||||||
.CaptureStdOut()
|
|
||||||
.CaptureStdErr()
|
|
||||||
.QuietBuildReporter()
|
|
||||||
.Execute();
|
|
||||||
|
|
||||||
return result.ExitCode == 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.DotNet.Cli.Build.Framework;
|
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Cli.Build
|
|
||||||
{
|
|
||||||
public class YumDependencyUtility
|
|
||||||
{
|
|
||||||
public static bool PackageIsInstalled(string packageName)
|
|
||||||
{
|
|
||||||
var result = Command.Create("yum", "list", "installed", packageName)
|
|
||||||
.CaptureStdOut()
|
|
||||||
.CaptureStdErr()
|
|
||||||
.Execute();
|
|
||||||
|
|
||||||
return result.ExitCode == 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue