summaryrefslogtreecommitdiff
path: root/build-packages.sh
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2016-12-27 07:46:08 (GMT)
committerJiyoung Yun <jy910.yun@samsung.com>2016-12-27 07:46:08 (GMT)
commitdb20f3f1bb8595633a7e16c8900fd401a453a6b5 (patch)
treee5435159cd1bf0519276363a6fe1663d1721bed3 /build-packages.sh
parent4b4aad7217d3292650e77eec2cf4c198ea9c3b4b (diff)
downloadcoreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.zip
coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.gz
coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.bz2
Imported Upstream version 1.0.0.9127upstream/1.0.0.9127
Diffstat (limited to 'build-packages.sh')
-rwxr-xr-xbuild-packages.sh90
1 files changed, 60 insertions, 30 deletions
diff --git a/build-packages.sh b/build-packages.sh
index 5e03ac2..0dd1035 100755
--- a/build-packages.sh
+++ b/build-packages.sh
@@ -3,14 +3,56 @@
usage()
{
echo "Builds the NuGet packages from the binaries that were built in the Build product binaries step."
- echo "Usage: build-packages -BuildArch -BuildType"
- echo "arch can be x64, x86, arm, arm64 (default is x64)"
- echo "configuration can be release, checked, debug (default is debug)"
+ echo "Usage: build-packages -BuildArch -BuildType [portableLinux]"
+ echo "BuildArch can be x64, x86, arm, arm64 (default is x64)"
+ echo "BuildType can be release, checked, debug (default is debug)"
+ echo "portableLinux - build for Portable Linux Distribution"
echo
exit 1
}
__ProjectRoot="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+__PortableLinux=0
+
+# Use uname to determine what the OS is.
+OSName=$(uname -s)
+case $OSName in
+ Linux)
+ __BuildOS=Linux
+ __HostOS=Linux
+ ;;
+
+ Darwin)
+ __BuildOS=OSX
+ __HostOS=OSX
+ ;;
+
+ FreeBSD)
+ __BuildOS=FreeBSD
+ __HostOS=FreeBSD
+ ;;
+
+ OpenBSD)
+ __BuildOS=OpenBSD
+ __HostOS=OpenBSD
+ ;;
+
+ NetBSD)
+ __BuildOS=NetBSD
+ __HostOS=NetBSD
+ ;;
+
+ SunOS)
+ __BuildOS=SunOS
+ __HostOS=SunOS
+ ;;
+
+ *)
+ echo "Unsupported OS $OSName detected, configuring as if for Linux"
+ __BuildOS=Linux
+ __HostOS=Linux
+ ;;
+esac
unprocessedBuildArgs=
@@ -28,46 +70,34 @@ while :; do
unprocessedBuildArgs="$unprocessedBuildArgs $1"
__Arch=$(echo $1| cut -d'=' -f 2)
;;
+
+ portableLinux)
+ if [ "$__BuildOS" == "Linux" ]; then
+ __PortableLinux=1
+ else
+ echo "ERROR: portableLinux not supported for non-Linux platforms."
+ exit 1
+ fi
+ ;;
*)
unprocessedBuildArgs="$unprocessedBuildArgs $1"
esac
shift
done
-$__ProjectRoot/run.sh build-packages -Project=$__ProjectRoot/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/Microsoft.NETCore.Runtime.CoreCLR.builds -DistroRid=\${OSRid}-$__Arch -UseSharedCompilation=false -BuildNugetPackage=false $unprocessedBuildArgs
-if [ $? -ne 0 ]
-then
- echo "ERROR: An error occurred while building packages; See build-packages.log for more details."
- exit 1
-fi
-
-$__ProjectRoot/run.sh build-packages -Project=$__ProjectRoot/src/.nuget/Microsoft.NETCore.Jit/Microsoft.NETCore.Jit.builds -DistroRid=\${OSRid}-$__Arch -UseSharedCompilation=false -BuildNugetPackage=false $unprocessedBuildArgs
-if [ $? -ne 0 ]
-then
- echo "ERROR: An error occurred while building packages; See build-packages.log for more details."
- exit 1
+# Portable builds target the base RID only for Linux based platforms
+if [ $__PortableLinux == 1 ]; then
+ export __DistroRid="linux-$__Arch"
+else
+ export __DistroRid="\${OSRid}-$__Arch"
fi
-$__ProjectRoot/run.sh build-packages -Project=$__ProjectRoot/src/.nuget/Microsoft.NETCore.ILAsm/Microsoft.NETCore.ILAsm.builds -DistroRid=\${OSRid}-$__Arch -UseSharedCompilation=false -BuildNugetPackage=false $unprocessedBuildArgs
+$__ProjectRoot/run.sh build-packages -Project=$__ProjectRoot/src/.nuget/packages.builds -DistroRid=$__DistroRid -UseSharedCompilation=false -BuildNugetPackage=false $unprocessedBuildArgs
if [ $? -ne 0 ]
then
echo "ERROR: An error occurred while building packages; See build-packages.log for more details."
exit 1
fi
-$__ProjectRoot/run.sh build-packages -Project=$__ProjectRoot/src/.nuget/Microsoft.NETCore.ILDAsm/Microsoft.NETCore.ILDAsm.builds -DistroRid=\${OSRid}-$__Arch -UseSharedCompilation=false -BuildNugetPackage=false $unprocessedBuildArgs
-if [ $? -ne 0 ]
-then
- echo "ERROR: An error occurred while building packages; See build-packages.log for more details."
- exit 1
-fi
-
-# Build the TestHost package
-$__ProjectRoot/run.sh build-packages -Project=$__ProjectRoot/src/.nuget/Microsoft.NETCore.TestHost/Microsoft.NETCore.TestHost.builds -DistroRid=\${OSRid}-$__Arch -UseSharedCompilation=false -BuildNugetPackage=false $unprocessedBuildArgs
-if [ $? -ne 0 ]; then
- echo "ERROR: An error occurred while building packages, see $build_packages_log for more details."
- exit 1
-fi
-
echo "Done building packages."
exit 0