Windows support for built-product-archive.
authormrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Apr 2009 02:58:14 +0000 (02:58 +0000)
committermrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Apr 2009 02:58:14 +0000 (02:58 +0000)
* BuildSlaveSupport/built-product-archive:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@42162 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitTools/BuildSlaveSupport/built-product-archive
WebKitTools/ChangeLog

index 244b811..ca43dad 100644 (file)
@@ -23,7 +23,7 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-import optparse, os, shutil, subprocess
+import optparse, os, shutil, subprocess, sys
 
 buildDirectory = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "WebKitBuild"))
 
@@ -48,9 +48,8 @@ def main():
 
 
 def archiveBuiltProduct(configuration, platform):
-    assert platform == 'mac'
+    assert platform in ('mac', 'win')
 
-    configurationBuildDirectory = os.path.join(buildDirectory, configuration.title())
     archiveFile = os.path.join(buildDirectory, configuration + ".zip")
 
     try:
@@ -59,21 +58,61 @@ def archiveBuiltProduct(configuration, platform):
         if e.errno != 2:
             raise
 
-    subprocess.call(["ditto", "-c", "-k", "--keepParent", "--sequesterRsrc", configurationBuildDirectory, archiveFile])
+    if platform == 'mac':
+        configurationBuildDirectory = os.path.join(buildDirectory, configuration.title())
+        return subprocess.call(["ditto", "-c", "-k", "--keepParent", "--sequesterRsrc", configurationBuildDirectory, archiveFile])
+    elif platform == 'win':
+        binDirectory = os.path.join(buildDirectory, "bin")
+        thinDirectory = os.path.join(buildDirectory, "thin")
+        thinBinDirectory = os.path.join(thinDirectory, "bin")
 
+        if os.path.isdir(thinDirectory):
+            shutil.rmtree(thinDirectory)
+        os.mkdir(thinDirectory)
+
+        if subprocess.call(["cp", "-R", binDirectory, thinBinDirectory]):
+            return 1
+
+        if subprocess.call("rm -f %s" % os.path.join(thinBinDirectory, "*.ilk"), shell=True):
+            return 1
+
+        if subprocess.call(["zip", "-r", archiveFile, "bin"], cwd=thinDirectory):
+            return 1
+
+        shutil.rmtree(thinDirectory)
 
 def extractBuiltProduct(configuration, platform):
-    assert platform == 'mac'
+    assert platform in ('mac', 'win')
 
-    configurationBuildDirectory = os.path.join(buildDirectory, configuration.title())
     archiveFile = os.path.join(buildDirectory, configuration + ".zip")
 
-    if os.path.isdir(configurationBuildDirectory):
-        shutil.rmtree(configurationBuildDirectory)
+    if platform == 'mac':
+        configurationBuildDirectory = os.path.join(buildDirectory, configuration.title())
+
+        if os.path.isdir(configurationBuildDirectory):
+            shutil.rmtree(configurationBuildDirectory)
+
+        if subprocess.call(["ditto", "-x", "-k", archiveFile, buildDirectory]):
+            return 1
+        os.unlink(archiveFile)
+
+    elif platform == 'win':
+        binDirectory = os.path.join(buildDirectory, "bin")
+        if os.path.isdir(binDirectory):
+            shutil.rmtree(binDirectory)
+
+        os.mkdir(binDirectory)
+
+        safariPath = subprocess.Popen('cygpath -w "$PROGRAMFILES"/Safari',
+                                      shell=True, stdout=subprocess.PIPE).communicate()[0].strip()
+
+        if subprocess.call('cp -R "%s"/*.dll "%s"/*.resources %s' % (safariPath, safariPath, binDirectory), shell=True):
+            return 1
 
-    subprocess.call(["ditto", "-x", "-k", archiveFile, buildDirectory])
-    os.unlink(archiveFile)
+        if subprocess.call(["unzip", "-o", archiveFile], cwd=buildDirectory):
+            return 1
 
+        
 
 if __name__ == '__main__':
-    main()
\ No newline at end of file
+    sys.exit(main())
index 5a86d89..0243774 100644 (file)
@@ -1,3 +1,9 @@
+2009-04-01  Mark Rowe  <mrowe@apple.com>
+
+        Windows support for built-product-archive.
+
+        * BuildSlaveSupport/built-product-archive:
+
 2009-03-31  Adam Roben  <aroben@apple.com>
 
         Make resolve-ChangeLogs -f work when the working tree has spaces in