set __BuildNativeCoreLib=1
set __RestoreOptData=1
+REM Is this a portable build?
+set __IsPortableBuild=
+
:Arg_Loop
if "%1" == "" goto ArgsDone
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!]==[] (
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:
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
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."
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
}
__cmakeargs=""
__SkipGenerateVersion=0
__DoCrossArchBuild=0
-__PortableLinux=0
+__PortableBuild=0
__msbuildonunsupportedplatform=0
__PgoOptDataVersion=""
__IbcOptDataVersion=""
__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
;;
"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",
"RestoreDuringBuild": false
}
},
+ "portable": {
+ "description": "Triggers a portable build.",
+ "settings": {
+ "PortableBuild": "1"
+ }
+ },
"BuildTarget": {
"description": "Runs the build target.",
"settings": {
<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'">