diff options
author | Gaurav Khanna <gkhanna@microsoft.com> | 2017-03-22 13:30:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-22 13:30:49 -0700 |
commit | da1d8cd17a8ec2a78e8139d03be358d26acb503c (patch) | |
tree | 46a3d6f201bb31f690dfd77ae9bb57667a7cc110 | |
parent | 2e970d8c53b4750c46ea00ea4c044af57e6b53df (diff) | |
download | coreclr-da1d8cd17a8ec2a78e8139d03be358d26acb503c.tar.gz coreclr-da1d8cd17a8ec2a78e8139d03be358d26acb503c.tar.bz2 coreclr-da1d8cd17a8ec2a78e8139d03be358d26acb503c.zip |
Enable Portable Windows RID (#10365)
* Enable Portable RID support for Windows and OSX.
-rw-r--r-- | build.cmd | 8 | ||||
-rwxr-xr-x | build.sh | 23 | ||||
-rw-r--r-- | config.json | 12 | ||||
-rw-r--r-- | src/.nuget/dir.props | 10 |
4 files changed, 37 insertions, 16 deletions
@@ -98,6 +98,9 @@ set __BuildPackages=1 set __BuildNativeCoreLib=1 set __RestoreOptData=1 +REM Is this a portable build? +set __IsPortableBuild= + :Arg_Loop if "%1" == "" goto ArgsDone @@ -115,6 +118,8 @@ if /i "%1" == "debug" (set __BuildTypeDebug=1&set processedArgs=!p if /i "%1" == "checked" (set __BuildTypeChecked=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) if /i "%1" == "release" (set __BuildTypeRelease=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) +if /i "%1" == "portable" (set __IsPortableBuild=-portable&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop) + REM All arguments after this point will be passed through directly to build.cmd on nested invocations REM using the "all" argument, and must be added to the __PassThroughArgs variable. if [!__PassThroughArgs!]==[] ( @@ -474,7 +479,7 @@ if %__BuildPackages% EQU 1 ( set __MsbuildErr=/flp2:ErrorsOnly;LogFile="%__LogsDir%\Nuget_%__BuildOS%__%__BuildArch%__%__BuildType%.err" REM The conditions as to what to build are captured in the builds file. - @call %__ProjectDir%\run.cmd build -Project=%__SourceDir%\.nuget\packages.builds -platform=%__BuildArch% -MsBuildLog=!__MsbuildLog! -MsBuildWrn=!__MsbuildWrn! -MsBuildErr=!__MsbuildErr! %__RunArgs% %__UnprocessedBuildArgs% + @call %__ProjectDir%\run.cmd build -Project=%__SourceDir%\.nuget\packages.builds %__IsPortableBuild% -platform=%__BuildArch% -MsBuildLog=!__MsbuildLog! -MsBuildWrn=!__MsbuildWrn! -MsBuildErr=!__MsbuildErr! %__RunArgs% %__UnprocessedBuildArgs% if not !errorlevel! == 0 ( echo %__MsgPrefix%Error: Nuget package generation failed build failed. Refer to the build log files for details: @@ -643,6 +648,7 @@ echo -sequential: force a non-parallel build ^(default is to build in parallel echo using all processors^). echo -officialbuildid=^<ID^>: specify the official build ID to be used by this build. echo -Rebuild: passes /t:rebuild to the build projects. +echo portable : build for portable RID. echo. echo If "all" is specified, then all build architectures and types are built. If, in addition, echo one or more build architectures or types is specified, then only those build architectures @@ -38,7 +38,7 @@ usage() echo "skiptests - skip the tests in the 'tests' subdirectory." echo "skipnuget - skip building nuget packages." echo "skiprestoreoptdata - skip restoring optimization data used by profile-based optimizations." - echo "portableLinux - build for Portable Linux Distribution" + echo "portable - build for portable RID." echo "verbose - optional argument to enable verbose build output." echo "-skiprestore: skip restoring packages ^(default: packages are restored during build^)." echo "-disableoss: Disable Open Source Signing for System.Private.CoreLib." @@ -85,8 +85,12 @@ initTargetDistroRid() fi # Portable builds target the base RID only for Linux based platforms - if [ $__PortableLinux == 1 ]; then - export __DistroRid="linux-$__BuildArch" + if [ $__PortableBuild == 1 ]; then + if [ "$__BuildOS" == "Linux" ]; then + export __DistroRid="linux-$__BuildArch" + elif [ "$__BuildOS" == "OSX" ]; then + export __DistroRid="osx-$__BuildArch" + fi fi } @@ -573,7 +577,7 @@ __DistroRid="" __cmakeargs="" __SkipGenerateVersion=0 __DoCrossArchBuild=0 -__PortableLinux=0 +__PortableBuild=0 __msbuildonunsupportedplatform=0 __PgoOptDataVersion="" __IbcOptDataVersion="" @@ -630,15 +634,10 @@ while :; do __CrossBuild=1 ;; - portablelinux) - if [ "$__BuildOS" == "Linux" ]; then - __PortableLinux=1 - else - echo "ERROR: portableLinux not supported for non-Linux platforms." - exit 1 - fi + portable) + __PortableBuild=1 ;; - + verbose) __VerboseBuild=1 ;; diff --git a/config.json b/config.json index 03a705449d..9900b47f2d 100644 --- a/config.json +++ b/config.json @@ -210,6 +210,12 @@ "values": [ "x86", "x64", "arm", "arm64" ], "defaultValue": "${CPUArch}" }, + "PortableBuild": { + "description": "Indicates if this is a portable build.", + "valueType": "property", + "values": [ "0", "1"], + "defaultValue": "0" + }, "Rebuild": { "description": "Specifies rebuild target.", "valueType": "target", @@ -444,6 +450,12 @@ "RestoreDuringBuild": false } }, + "portable": { + "description": "Triggers a portable build.", + "settings": { + "PortableBuild": "1" + } + }, "BuildTarget": { "description": "Runs the build target.", "settings": { diff --git a/src/.nuget/dir.props b/src/.nuget/dir.props index eb1457160d..6f9e29cf27 100644 --- a/src/.nuget/dir.props +++ b/src/.nuget/dir.props @@ -61,9 +61,13 @@ <When Condition="'$(PackageRID)' != ''" /> <When Condition="'$(_runtimeOSFamily)' == 'win'"> <PropertyGroup> - <PackageRID Condition="'$(ArchGroup)' == 'x86' OR '$(ArchGroup)' == 'x64'">win7-$(ArchGroup)</PackageRID> - <PackageRID Condition="'$(ArchGroup)' == 'arm'">win8-$(ArchGroup)</PackageRID> - <PackageRID Condition="'$(ArchGroup)' == 'arm64'">win10-$(ArchGroup)</PackageRID> + <RIDPlatform>win7</RIDPlatform> + <RIDPlatform Condition="'$(ArchGroup)' == 'arm'">win8</RIDPlatform> + <RIDPlatform Condition="'$(ArchGroup)' == 'arm64'">win10</RIDPlatform> + + <!-- Set the platform part of the RID if we are doing a portable build --> + <RIDPlatform Condition="'$(PortableBuild)' == '1'">win</RIDPlatform> + <PackageRID>$(RIDPlatform)-$(ArchGroup)</PackageRID> </PropertyGroup> </When> <When Condition="'$(_runtimeOSFamily)' == 'osx'"> |