From 113924eebd6e0612156caf85ca025973882b26e5 Mon Sep 17 00:00:00 2001 From: Justin Goshi Date: Wed, 8 Mar 2017 13:37:06 -1000 Subject: [PATCH] Add support to build linux portable (#5938) * Add support to build with the linux portable * Pass targets to run for the linux portable * Address PR comments * Update the bootstrapper version * Address the PR comments for improving the help text * Fixing permissions --- build/BuildDefaults.props | 7 ++++++- run-build.ps1 | 4 ++-- run-build.sh | 20 ++++++++++++++----- .../CrossGen.Dependencies.csproj | 2 +- 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/build/BuildDefaults.props b/build/BuildDefaults.props index e04468c6f..bbf51f97b 100644 --- a/build/BuildDefaults.props +++ b/build/BuildDefaults.props @@ -2,7 +2,12 @@ Prepare;Compile;Test;Package;Publish Debug - true + true + true + false true false diff --git a/run-build.ps1 b/run-build.ps1 index 67ab3cd06..2cbf0db1f 100644 --- a/run-build.ps1 +++ b/run-build.ps1 @@ -95,8 +95,8 @@ if ($LastExitCode -ne 0) # install the post-PJnistic stage0 $dotnetInstallPath = Join-Path $toolsLocalPath "dotnet-install.ps1" -Write-Host "$dotnetInstallPath -Channel ""master"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" -Invoke-Expression "$dotnetInstallPath -Channel ""master"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" +Write-Host "$dotnetInstallPath -Channel ""master"" -Version ""2.0.0-alpha-005165"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" +Invoke-Expression "$dotnetInstallPath -Channel ""master"" -Version ""2.0.0-alpha-005165"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" if ($LastExitCode -ne 0) { Write-Output "The .NET CLI installation failed with exit code $LastExitCode" diff --git a/run-build.sh b/run-build.sh index 300658164..7da3b5570 100755 --- a/run-build.sh +++ b/run-build.sh @@ -55,6 +55,9 @@ source "$REPOROOT/scripts/common/_prettyprint.sh" BUILD=1 +LINUX_PORTABLE_INSTALL_ARGS= +CUSTOM_BUILD_ARGS= + # Set nuget package cache under the repo export NUGET_PACKAGES="$REPOROOT/.nuget/packages" @@ -93,6 +96,12 @@ while [[ $# > 0 ]]; do args=( "${args[@]/$2}" ) shift ;; + --linux-portable) + LINUX_PORTABLE_INSTALL_ARGS="--linux-portable" + # Until we get test support for 2.0 we need to pass in the targets without test. + CUSTOM_BUILD_ARGS="/p:Rid=\"linux-x64\" /p:OSName=\"linux\" /p:CLITargets=\"Prepare;Compile;Package;Publish\"" + args=( "${args[@]/$1}" ) + ;; --help) echo "Usage: $0 [--configuration ] [--targets ] [--skip-prereqs] [--nopackage] [--docker ] [--help]" echo "" @@ -102,6 +111,7 @@ while [[ $# > 0 ]]; do echo " --nopackage Skip packaging targets" echo " --nobuild Skip building, showing the command that would be used to build" echo " --docker Build in Docker using the Dockerfile located in scripts/docker/IMAGENAME" + echo " --linux-portable Builds the Linux portable .NET Tools instead of a distro-specific version." echo " --help Display this help message" exit 0 ;; @@ -155,8 +165,8 @@ if [ $? != 0 ]; then fi # now execute the script -echo "installing CLI: $dotnetInstallPath --channel \"master\" --install-dir $DOTNET_INSTALL_DIR --architecture \"$ARCHITECTURE\"" -$dotnetInstallPath --channel "master" --install-dir $DOTNET_INSTALL_DIR --architecture "$ARCHITECTURE" +echo "installing CLI: $dotnetInstallPath --channel \"master\" --version \"2.0.0-alpha-005165\" --install-dir $DOTNET_INSTALL_DIR --architecture \"$ARCHITECTURE\" $LINUX_PORTABLE_INSTALL_ARGS" +$dotnetInstallPath --channel "master" --version "2.0.0-alpha-005165" --install-dir $DOTNET_INSTALL_DIR --architecture "$ARCHITECTURE" $LINUX_PORTABLE_INSTALL_ARGS if [ $? != 0 ]; then echo "run-build: Error: Boot-strapping post-PJ stage0 with exit code $?." >&2 exit $? @@ -179,9 +189,9 @@ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 echo "${args[@]}" if [ $BUILD -eq 1 ]; then - dotnet msbuild build.proj /p:Architecture=$ARCHITECTURE /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles - dotnet msbuild build.proj /m /v:diag /fl /flp:v=diag /p:Architecture=$ARCHITECTURE "${args[@]}" + dotnet msbuild build.proj /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles + dotnet msbuild build.proj /m /v:diag /fl /flp:v=diag /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS "${args[@]}" else echo "Not building due to --nobuild" - echo "Command that would be run is: 'dotnet msbuild build.proj /m /p:Architecture=$ARCHITECTURE ${args[@]}'" + echo "Command that would be run is: 'dotnet msbuild build.proj /m /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS ${args[@]}'" fi diff --git a/tools/CrossGen.Dependencies/CrossGen.Dependencies.csproj b/tools/CrossGen.Dependencies/CrossGen.Dependencies.csproj index 8ae84a8ff..fc4d473dd 100644 --- a/tools/CrossGen.Dependencies/CrossGen.Dependencies.csproj +++ b/tools/CrossGen.Dependencies/CrossGen.Dependencies.csproj @@ -3,7 +3,7 @@ netcoreapp2.0 - win7-x64;win7-x86;osx.10.11-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;osx.10.10-x64;rhel.7-x64 + linux-x64;win7-x64;win7-x86;osx.10.11-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;osx.10.10-x64;rhel.7-x64