[MacSDK] Update MSBuild
authorAlexis Christoforides <alexis@thenull.net>
Mon, 13 Feb 2017 10:32:56 +0000 (05:32 -0500)
committerAlexis Christoforides <alexis@thenull.net>
Mon, 13 Feb 2017 11:35:02 +0000 (06:35 -0500)
packaging/MacSDK/msbuild.py

index 0e16af1fa7991d173346a97c8e413cbe35c9ef47..3d123952f35168d771fbe222f1d111cc5efd1757 100644 (file)
@@ -5,7 +5,7 @@ class MSBuild (GitHubPackage):
 
     def __init__(self):
         GitHubPackage.__init__(self, 'mono', 'msbuild', '15.0',
-                               git_branch='xplat-c8p')
+                               git_branch='xplat-master')
 
     def build(self):
         self.sh('./cibuild.sh --scope Compile --target Mono --host Mono')
@@ -27,6 +27,17 @@ class MSBuild (GitHubPackage):
 
         self.sh('cp msbuild-mono-deploy.in %s/msbuild' % bindir)
 
+        xbuild_dir = os.path.join(self.staged_prefix, 'lib/mono/xbuild')
+        new_xbuild_tv_dir = os.path.join(xbuild_dir, self.version)
+        os.makedirs(new_xbuild_tv_dir)
+
+        self.sh('mv %s/Microsoft.Common.props %s' %
+                (new_location, new_xbuild_tv_dir))
+        self.sh('cp -R nuget-support/tv/ %s' % new_xbuild_tv_dir)
+        self.sh('cp -R nuget-support/tasks-targets/ %s/' % xbuild_dir)
+        for dep in glob.glob("%s/Microsoft/NuGet/*" % xbuild_dir):
+            self.sh('ln -s %s %s' % (dep, xbuild_dir))
+
         for line in fileinput.input('%s/msbuild' % bindir, inplace=True):
             line = line.replace('@bindir@', '%s/bin' % self.staged_prefix)
             line = line.replace(
@@ -35,10 +46,12 @@ class MSBuild (GitHubPackage):
                 self.staged_prefix)
             print line
 
-        for excluded in glob.glob("%s/*UnitTests*" % new_location):
-            self.rm(excluded)
+        patterns = ["*UnitTests*", "*xunit*", "NuGet*", "System.Runtime.InteropServices.RuntimeInformation.dll",
+                    "Roslyn/csc.exe*"]
+
+        for pattern in patterns:
+            for excluded in glob.glob("%s/%s" % (new_location, pattern)):
+                self.rm(excluded)
 
-        for excluded in glob.glob("%s/*xunit*" % new_location):
-            self.rm(excluded)
 
 MSBuild()