Support building on all supported distros
authorMatt Ellis <matell@microsoft.com>
Fri, 27 May 2016 21:59:43 +0000 (14:59 -0700)
committerMatt Ellis <matell@microsoft.com>
Tue, 31 May 2016 18:42:40 +0000 (11:42 -0700)
With the updated buildtools, we should now be able to build on all the supported distros:

 - Centos 7
 - Fedora 23
 - openSUSE 13.2
 - RHEL 7.2
 - Ubuntu 14.04
 - Ubuntu 16.06

I also cleaned up how we compute the RID for the tools to restore.

build.sh
init-tools.sh

index 85d9211..61ee3c1 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -211,13 +211,30 @@ isMSBuildOnNETCoreSupported()
 
     if [ "$__HostArch" == "x64" ]; then
         if [ "$__HostOS" == "Linux" ]; then
-            if [ "$__DistroRid" == "ubuntu.14.04-x64" ]; then
-                __isMSBuildOnNETCoreSupported=1
-            elif [ "$__DistroRid" == "rhel.7.2-x64" ]; then
-                __isMSBuildOnNETCoreSupported=1
-            elif [ "$__DistroRid" == "debian.8-x64" ]; then
-                __isMSBuildOnNETCoreSupported=1
-            fi
+            case "$__DistroRid" in
+                "centos.7-x64")
+                    __isMSBuildOnNETCoreSupported=1
+                    ;;
+                "debian.8-x64")
+                    __isMSBuildOnNETCoreSupported=1
+                    ;;
+                "fedora.23-x64")
+                    __isMSBuildOnNETCoreSupported=1
+                    ;;
+                "opensuse.13.2-x64")
+                    __isMSBuildOnNETCoreSupported=1
+                    ;;
+                "rhel.7.2-x64")
+                    __isMSBuildOnNETCoreSupported=1
+                    ;;
+                "ubuntu.14.04-x64")
+                    __isMSBuildOnNETCoreSupported=1
+                    ;;
+                "ubuntu.16.04-x64")
+                    __isMSBuildOnNETCoreSupported=1
+                    ;;
+                *)
+            esac
         elif [ "$__HostOS" == "OSX" ]; then
             __isMSBuildOnNETCoreSupported=1
         fi
index 6c0002f..647eba6 100755 (executable)
@@ -47,26 +47,26 @@ case $OSName in
 
     Linux)
         OS=Linux
-        __DOTNET_PKG=dotnet-dev-ubuntu-x64
+
+        if [ ! -e /etc/os-release ]; then
+            echo "Cannot determine Linux distribution, asuming Ubuntu 14.04."
+            __DOTNET_PKG=dotnet-dev-ubuntu.14.04-x64
+        else
+            source /etc/os-release
+            __DOTNET_PKG="dotnet-dev-$ID.$VERSION_ID-x64"
+        fi
         ;;
 
     *)
         echo "Unsupported OS $OSName detected. Downloading ubuntu-x64 tools"
         OS=Linux
-        __DOTNET_PKG=dotnet-dev-ubuntu-x64
+        __DOTNET_PKG=dotnet-dev-ubuntu.14.04-x64
         ;;
 esac
 
 # Initialize Linux Distribution name and .NET CLI package name.
 
 initDistroName $OS
-if [ "$__DistroRid" == "centos.7-x64" ]; then
-    __DOTNET_PKG=dotnet-dev-centos-x64
-fi
-
-if [ "$__DistroRid" == "rhel.7.2-x64" ]; then
-    __DOTNET_PKG=dotnet-dev-rhel-x64
-fi
 
 # Work around mac build issue 
 if [ "$OS"=="OSX" ]; then