From 775363197bfc34175e746d8cd14ebdc1119145c6 Mon Sep 17 00:00:00 2001 From: Gaurav Khanna Date: Fri, 16 Dec 2016 12:47:08 -0800 Subject: [PATCH] Packaging support for portable Linux binaries. --- build.sh | 20 ++++++- .../Microsoft.NETCore.ILAsm.builds | 4 ++ .../Microsoft.NETCore.ILAsm.pkgproj | 3 + .../linux/Microsoft.NETCore.ILAsm.pkgproj | 29 ++++++++++ .../Microsoft.NETCore.ILDAsm.builds | 4 ++ .../Microsoft.NETCore.ILDAsm.pkgproj | 3 + .../linux/Microsoft.NETCore.ILDAsm.pkgproj | 29 ++++++++++ .../Microsoft.NETCore.Jit.builds | 4 ++ .../Microsoft.NETCore.Jit.pkgproj | 3 + .../linux/Microsoft.NETCore.Jit.pkgproj | 29 ++++++++++ .../Microsoft.NETCore.Runtime.CoreCLR.builds | 4 ++ .../Microsoft.NETCore.Runtime.CoreCLR.pkgproj | 3 + .../Microsoft.NETCore.Runtime.CoreCLR.pkgproj | 56 +++++++++++++++++++ .../Microsoft.NETCore.TestHost.builds | 4 ++ .../Microsoft.NETCore.TestHost.pkgproj | 3 + .../linux/Microsoft.NETCore.TestHost.pkgproj | 29 ++++++++++ 16 files changed, 225 insertions(+), 2 deletions(-) create mode 100644 src/.nuget/Microsoft.NETCore.ILAsm/linux/Microsoft.NETCore.ILAsm.pkgproj create mode 100644 src/.nuget/Microsoft.NETCore.ILDAsm/linux/Microsoft.NETCore.ILDAsm.pkgproj create mode 100644 src/.nuget/Microsoft.NETCore.Jit/linux/Microsoft.NETCore.Jit.pkgproj create mode 100644 src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/linux/Microsoft.NETCore.Runtime.CoreCLR.pkgproj create mode 100644 src/.nuget/Microsoft.NETCore.TestHost/linux/Microsoft.NETCore.TestHost.pkgproj diff --git a/build.sh b/build.sh index efdd5cbff626..ca27844933a3 100755 --- a/build.sh +++ b/build.sh @@ -42,6 +42,7 @@ usage() echo "skipmscorlib - do not build mscorlib.dll." echo "skiptests - skip the tests in the 'tests' subdirectory." echo "skipnuget - skip building nuget packages." + echo "portableLinux - build for Portable Linux Distribution" 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." @@ -84,6 +85,11 @@ initTargetDistroRid() else export __DistroRid="$__HostDistroRid" fi + + # Portable builds target the base RID only for Linux based platforms + if [ $__PortableLinux == 1 ]; then + export __DistroRid="linux-$__BuildArch" + fi } setup_dirs() @@ -520,6 +526,7 @@ __DistroRid="" __cmakeargs="" __SkipGenerateVersion=0 __DoCrossArchBuild=0 +__PortableLinux=0 while :; do if [ $# -le 0 ]; then @@ -572,8 +579,17 @@ while :; do cross) __CrossBuild=1 ;; - - verbose) + + portablelinux) + if [ "$__BuildOS" == "Linux" ]; then + __PortableLinux=1 + else + echo "ERROR: portableLinux not supported for non-Linux platforms." + exit 1 + fi + ;; + + verbose) __VerboseBuild=1 ;; diff --git a/src/.nuget/Microsoft.NETCore.ILAsm/Microsoft.NETCore.ILAsm.builds b/src/.nuget/Microsoft.NETCore.ILAsm/Microsoft.NETCore.ILAsm.builds index 90a17861e74c..e568ca57f5fc 100644 --- a/src/.nuget/Microsoft.NETCore.ILAsm/Microsoft.NETCore.ILAsm.builds +++ b/src/.nuget/Microsoft.NETCore.ILAsm/Microsoft.NETCore.ILAsm.builds @@ -27,6 +27,10 @@ Windows_NT arm + + Linux + amd64 + Linux amd64 diff --git a/src/.nuget/Microsoft.NETCore.ILAsm/Microsoft.NETCore.ILAsm.pkgproj b/src/.nuget/Microsoft.NETCore.ILAsm/Microsoft.NETCore.ILAsm.pkgproj index 48c8db36295b..c0b213461070 100644 --- a/src/.nuget/Microsoft.NETCore.ILAsm/Microsoft.NETCore.ILAsm.pkgproj +++ b/src/.nuget/Microsoft.NETCore.ILAsm/Microsoft.NETCore.ILAsm.pkgproj @@ -22,6 +22,9 @@ arm + + amd64 + amd64 diff --git a/src/.nuget/Microsoft.NETCore.ILAsm/linux/Microsoft.NETCore.ILAsm.pkgproj b/src/.nuget/Microsoft.NETCore.ILAsm/linux/Microsoft.NETCore.ILAsm.pkgproj new file mode 100644 index 000000000000..ce3bf6320ee6 --- /dev/null +++ b/src/.nuget/Microsoft.NETCore.ILAsm/linux/Microsoft.NETCore.ILAsm.pkgproj @@ -0,0 +1,29 @@ + + + + + true + linux-$(PackagePlatform) + + x64; + + + + + + runtimes/$(PackageTargetRuntime)/native + + + + + + + + + + runtimes/$(PackageTargetRuntime)/native + true + + + + \ No newline at end of file diff --git a/src/.nuget/Microsoft.NETCore.ILDAsm/Microsoft.NETCore.ILDAsm.builds b/src/.nuget/Microsoft.NETCore.ILDAsm/Microsoft.NETCore.ILDAsm.builds index db3bf8bb8c05..5939fdaf6ef9 100644 --- a/src/.nuget/Microsoft.NETCore.ILDAsm/Microsoft.NETCore.ILDAsm.builds +++ b/src/.nuget/Microsoft.NETCore.ILDAsm/Microsoft.NETCore.ILDAsm.builds @@ -27,6 +27,10 @@ Windows_NT arm + + Linux + amd64 + Linux amd64 diff --git a/src/.nuget/Microsoft.NETCore.ILDAsm/Microsoft.NETCore.ILDAsm.pkgproj b/src/.nuget/Microsoft.NETCore.ILDAsm/Microsoft.NETCore.ILDAsm.pkgproj index 85387499806d..47683ef0a3dd 100644 --- a/src/.nuget/Microsoft.NETCore.ILDAsm/Microsoft.NETCore.ILDAsm.pkgproj +++ b/src/.nuget/Microsoft.NETCore.ILDAsm/Microsoft.NETCore.ILDAsm.pkgproj @@ -22,6 +22,9 @@ arm + + amd64 + amd64 diff --git a/src/.nuget/Microsoft.NETCore.ILDAsm/linux/Microsoft.NETCore.ILDAsm.pkgproj b/src/.nuget/Microsoft.NETCore.ILDAsm/linux/Microsoft.NETCore.ILDAsm.pkgproj new file mode 100644 index 000000000000..7a7f82ddd5a5 --- /dev/null +++ b/src/.nuget/Microsoft.NETCore.ILDAsm/linux/Microsoft.NETCore.ILDAsm.pkgproj @@ -0,0 +1,29 @@ + + + + + true + linux-$(PackagePlatform) + + x64; + + + + + + runtimes/$(PackageTargetRuntime)/native + + + + + + + + + + runtimes/$(PackageTargetRuntime)/native + true + + + + \ No newline at end of file diff --git a/src/.nuget/Microsoft.NETCore.Jit/Microsoft.NETCore.Jit.builds b/src/.nuget/Microsoft.NETCore.Jit/Microsoft.NETCore.Jit.builds index 6a956978532d..61c690ebb13e 100644 --- a/src/.nuget/Microsoft.NETCore.Jit/Microsoft.NETCore.Jit.builds +++ b/src/.nuget/Microsoft.NETCore.Jit/Microsoft.NETCore.Jit.builds @@ -27,6 +27,10 @@ Windows_NT arm + + Linux + amd64 + Linux amd64 diff --git a/src/.nuget/Microsoft.NETCore.Jit/Microsoft.NETCore.Jit.pkgproj b/src/.nuget/Microsoft.NETCore.Jit/Microsoft.NETCore.Jit.pkgproj index 6775ccc61449..bcd4e4232fd0 100644 --- a/src/.nuget/Microsoft.NETCore.Jit/Microsoft.NETCore.Jit.pkgproj +++ b/src/.nuget/Microsoft.NETCore.Jit/Microsoft.NETCore.Jit.pkgproj @@ -21,6 +21,9 @@ arm + + amd64 + amd64 diff --git a/src/.nuget/Microsoft.NETCore.Jit/linux/Microsoft.NETCore.Jit.pkgproj b/src/.nuget/Microsoft.NETCore.Jit/linux/Microsoft.NETCore.Jit.pkgproj new file mode 100644 index 000000000000..541b81e4abd8 --- /dev/null +++ b/src/.nuget/Microsoft.NETCore.Jit/linux/Microsoft.NETCore.Jit.pkgproj @@ -0,0 +1,29 @@ + + + + + true + linux-$(PackagePlatform) + + x64; + + + + + + runtimes/$(PackageTargetRuntime)/native + + + + + + + + + + runtimes/$(PackageTargetRuntime)/native + true + + + + \ No newline at end of file diff --git a/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/Microsoft.NETCore.Runtime.CoreCLR.builds b/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/Microsoft.NETCore.Runtime.CoreCLR.builds index 6124136722bc..c7bfdc3b0405 100644 --- a/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/Microsoft.NETCore.Runtime.CoreCLR.builds +++ b/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/Microsoft.NETCore.Runtime.CoreCLR.builds @@ -26,6 +26,10 @@ Windows_NT arm + + Linux + amd64 + Linux amd64 diff --git a/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/Microsoft.NETCore.Runtime.CoreCLR.pkgproj b/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/Microsoft.NETCore.Runtime.CoreCLR.pkgproj index a8e437663a9c..a1405d5fff53 100644 --- a/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/Microsoft.NETCore.Runtime.CoreCLR.pkgproj +++ b/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/Microsoft.NETCore.Runtime.CoreCLR.pkgproj @@ -22,6 +22,9 @@ arm + + amd64 + amd64 diff --git a/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/linux/Microsoft.NETCore.Runtime.CoreCLR.pkgproj b/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/linux/Microsoft.NETCore.Runtime.CoreCLR.pkgproj new file mode 100644 index 000000000000..31e719601d7a --- /dev/null +++ b/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/linux/Microsoft.NETCore.Runtime.CoreCLR.pkgproj @@ -0,0 +1,56 @@ + + + + + true + linux-$(PackagePlatform) + + x64; + + + + + + + + + + + + + + + + + + + + runtimes/$(PackageTargetRuntime)/native + + + + runtimes/$(PackageTargetRuntime)/lib/netstandard1.0 + + + + ref/netstandard1.0 + + + tools + + + + + + + + + + + + runtimes/$(PackageTargetRuntime)/native + true + + + + diff --git a/src/.nuget/Microsoft.NETCore.TestHost/Microsoft.NETCore.TestHost.builds b/src/.nuget/Microsoft.NETCore.TestHost/Microsoft.NETCore.TestHost.builds index 78681ef43b3c..c1d076fb0e20 100644 --- a/src/.nuget/Microsoft.NETCore.TestHost/Microsoft.NETCore.TestHost.builds +++ b/src/.nuget/Microsoft.NETCore.TestHost/Microsoft.NETCore.TestHost.builds @@ -27,6 +27,10 @@ Windows_NT arm + + Linux + amd64 + Linux amd64 diff --git a/src/.nuget/Microsoft.NETCore.TestHost/Microsoft.NETCore.TestHost.pkgproj b/src/.nuget/Microsoft.NETCore.TestHost/Microsoft.NETCore.TestHost.pkgproj index c831f931cfa4..325461d3ac2f 100644 --- a/src/.nuget/Microsoft.NETCore.TestHost/Microsoft.NETCore.TestHost.pkgproj +++ b/src/.nuget/Microsoft.NETCore.TestHost/Microsoft.NETCore.TestHost.pkgproj @@ -21,6 +21,9 @@ arm + + amd64 + amd64 diff --git a/src/.nuget/Microsoft.NETCore.TestHost/linux/Microsoft.NETCore.TestHost.pkgproj b/src/.nuget/Microsoft.NETCore.TestHost/linux/Microsoft.NETCore.TestHost.pkgproj new file mode 100644 index 000000000000..06a6f4ce1047 --- /dev/null +++ b/src/.nuget/Microsoft.NETCore.TestHost/linux/Microsoft.NETCore.TestHost.pkgproj @@ -0,0 +1,29 @@ + + + + + true + linux-$(PackagePlatform) + + x64; + + + + + + runtimes/$(PackageTargetRuntime)/native + + + + + + + + + + runtimes/$(PackageTargetRuntime)/native + true + + + + \ No newline at end of file