summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.cmd8
-rwxr-xr-xbuild.sh23
-rw-r--r--config.json12
-rw-r--r--src/.nuget/dir.props10
4 files changed, 37 insertions, 16 deletions
diff --git a/build.cmd b/build.cmd
index e450cf2873..13c3fb4a66 100644
--- a/build.cmd
+++ b/build.cmd
@@ -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
diff --git a/build.sh b/build.sh
index c48a7a2cee..7c5f55bf5c 100755
--- a/build.sh
+++ b/build.sh
@@ -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'">