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
This commit is contained in:
Justin Goshi 2017-03-08 13:37:06 -10:00 committed by GitHub
parent 2a382c9997
commit 113924eebd
4 changed files with 24 additions and 9 deletions

View file

@ -2,7 +2,12 @@
<PropertyGroup> <PropertyGroup>
<CLITargets Condition=" '$(CLITargets)' == '' ">Prepare;Compile;Test;Package;Publish</CLITargets> <CLITargets Condition=" '$(CLITargets)' == '' ">Prepare;Compile;Test;Package;Publish</CLITargets>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<IncludeAdditionalSharedFrameworks Condition=" '$(IncludeAdditionalSharedFrameworks)' == '' ">true</IncludeAdditionalSharedFrameworks> <HasAdditionalSharedFramework Condition="'$(Rid)' != 'linux-x64' AND
'$(Rid)' != 'ubuntu.16.10-x64' AND
'$(Rid)' != 'fedora.24-x64' AND
'$(Rid)' != 'opensuse.42.1-x64'">true</HasAdditionalSharedFramework>
<IncludeAdditionalSharedFrameworks Condition=" '$(IncludeAdditionalSharedFrameworks)' == '' AND '$(HasAdditionalSharedFramework)' == 'true' ">true</IncludeAdditionalSharedFrameworks>
<IncludeAdditionalSharedFrameworks Condition=" '$(IncludeAdditionalSharedFrameworks)' == '' ">false</IncludeAdditionalSharedFrameworks>
<IncludeNuGetPackageArchive Condition=" '$(IncludeNuGetPackageArchive)' == '' ">true</IncludeNuGetPackageArchive> <IncludeNuGetPackageArchive Condition=" '$(IncludeNuGetPackageArchive)' == '' ">true</IncludeNuGetPackageArchive>
<SkipBuildingInstallers Condition=" '$(SkipBuildingInstallers)' == '' ">false</SkipBuildingInstallers> <SkipBuildingInstallers Condition=" '$(SkipBuildingInstallers)' == '' ">false</SkipBuildingInstallers>
</PropertyGroup> </PropertyGroup>

View file

@ -95,8 +95,8 @@ if ($LastExitCode -ne 0)
# install the post-PJnistic stage0 # install the post-PJnistic stage0
$dotnetInstallPath = Join-Path $toolsLocalPath "dotnet-install.ps1" $dotnetInstallPath = Join-Path $toolsLocalPath "dotnet-install.ps1"
Write-Host "$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"" -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) if ($LastExitCode -ne 0)
{ {
Write-Output "The .NET CLI installation failed with exit code $LastExitCode" Write-Output "The .NET CLI installation failed with exit code $LastExitCode"

View file

@ -55,6 +55,9 @@ source "$REPOROOT/scripts/common/_prettyprint.sh"
BUILD=1 BUILD=1
LINUX_PORTABLE_INSTALL_ARGS=
CUSTOM_BUILD_ARGS=
# Set nuget package cache under the repo # Set nuget package cache under the repo
export NUGET_PACKAGES="$REPOROOT/.nuget/packages" export NUGET_PACKAGES="$REPOROOT/.nuget/packages"
@ -93,6 +96,12 @@ while [[ $# > 0 ]]; do
args=( "${args[@]/$2}" ) args=( "${args[@]/$2}" )
shift 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) --help)
echo "Usage: $0 [--configuration <CONFIGURATION>] [--targets <TARGETS...>] [--skip-prereqs] [--nopackage] [--docker <IMAGENAME>] [--help]" echo "Usage: $0 [--configuration <CONFIGURATION>] [--targets <TARGETS...>] [--skip-prereqs] [--nopackage] [--docker <IMAGENAME>] [--help]"
echo "" echo ""
@ -102,6 +111,7 @@ while [[ $# > 0 ]]; do
echo " --nopackage Skip packaging targets" echo " --nopackage Skip packaging targets"
echo " --nobuild Skip building, showing the command that would be used to build" echo " --nobuild Skip building, showing the command that would be used to build"
echo " --docker <IMAGENAME> Build in Docker using the Dockerfile located in scripts/docker/IMAGENAME" echo " --docker <IMAGENAME> 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" echo " --help Display this help message"
exit 0 exit 0
;; ;;
@ -155,8 +165,8 @@ if [ $? != 0 ]; then
fi fi
# now execute the script # now execute the script
echo "installing CLI: $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" --install-dir $DOTNET_INSTALL_DIR --architecture "$ARCHITECTURE" $dotnetInstallPath --channel "master" --version "2.0.0-alpha-005165" --install-dir $DOTNET_INSTALL_DIR --architecture "$ARCHITECTURE" $LINUX_PORTABLE_INSTALL_ARGS
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo "run-build: Error: Boot-strapping post-PJ stage0 with exit code $?." >&2 echo "run-build: Error: Boot-strapping post-PJ stage0 with exit code $?." >&2
exit $? exit $?
@ -179,9 +189,9 @@ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
echo "${args[@]}" echo "${args[@]}"
if [ $BUILD -eq 1 ]; then if [ $BUILD -eq 1 ]; then
dotnet msbuild build.proj /p:Architecture=$ARCHITECTURE /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles 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 "${args[@]}" dotnet msbuild build.proj /m /v:diag /fl /flp:v=diag /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS "${args[@]}"
else else
echo "Not building due to --nobuild" 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 fi

View file

@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework> <TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeIdentifiers>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</RuntimeIdentifiers> <RuntimeIdentifiers>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</RuntimeIdentifiers>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>