changeset 14938:9d32e87ea98b

GRAAL distribution now includes sources (graal.src.zip)
author Doug Simon <doug.simon@oracle.com>
date Wed, 02 Apr 2014 10:05:08 +0200
parents 3de340bdb8d3
children dd5095578b79
files mx/mx_graal.py mx/projects
diffstat 2 files changed, 20 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/mx/mx_graal.py	Wed Apr 02 10:04:27 2014 +0200
+++ b/mx/mx_graal.py	Wed Apr 02 10:05:08 2014 +0200
@@ -406,21 +406,30 @@
 
     m2Install = mx.get_env('MAVEN_INSTALL_GRAAL_JAR', None)
     if m2Install and m2Install.lower() == 'true':
-        mx.run(['mvn', 'install:install-file', '-q',
-                '-Dfile=' + graalJar, '-DgroupId=com.oracle.graal', '-DartifactId=graal',
-                '-Dversion=1.0-SNAPSHOT', '-Dpackaging=jar'])
+        cmd = ['mvn', 'install:install-file', '-q',
+               '-Dfile=' + graalJar, '-DgroupId=com.oracle.graal', '-DartifactId=graal',
+               '-Dversion=1.0-SNAPSHOT', '-Dpackaging=jar']
+        if graalDist.sourcesPath:
+            cmd = cmd + ['-Dsources=' + graalDist.sourcesPath]
+        mx.run(cmd)
 
     if exists(jdks):
         for e in os.listdir(jdks):
             jreLibDir = join(jdks, e, 'jre', 'lib')
             if exists(jreLibDir):
-                # do a copy and then a move to get atomic updating (on Unix) of graal.jar in the JRE
-                fd, tmp = tempfile.mkstemp(suffix='', prefix='graal.jar', dir=jreLibDir)
-                shutil.copyfile(graalJar, tmp)
-                os.close(fd)
-                graalJar = join(jreLibDir, 'graal.jar')
-                shutil.move(tmp, graalJar)
-                os.chmod(graalJar, JDK_UNIX_PERMISSIONS)
+                def install(srcJar, dstDir):
+                    # do a copy and then a move to get atomic updating (on Unix)
+                    name = os.path.basename(srcJar)
+                    fd, tmp = tempfile.mkstemp(suffix='', prefix=name, dir=dstDir)
+                    shutil.copyfile(srcJar, tmp)
+                    os.close(fd)
+                    dstJar = join(dstDir, name)
+                    shutil.move(tmp, dstJar)
+                    os.chmod(dstJar, JDK_UNIX_PERMISSIONS)
+
+                install(graalJar, jreLibDir)
+                if graalDist.sourcesPath:
+                    install(graalDist.sourcesPath, join(jdks, e))
 
 # run a command in the windows SDK Debug Shell
 def _runInDebugShell(cmd, workingDir, logFile=None, findInOutput=None, respondTo=None):
--- a/mx/projects	Wed Apr 02 10:04:27 2014 +0200
+++ b/mx/projects	Wed Apr 02 10:05:08 2014 +0200
@@ -46,6 +46,7 @@
 library@JAVA_ALLOCATION_INSTRUMENTER@sha1=64c0a5329fbcb8284640e58d83252e0a3b08c23e
 
 distribution@GRAAL@path=graal.jar
+distribution@GRAAL@sourcesPath=graal.src.zip
 distribution@GRAAL@dependencies=\
 com.oracle.graal.hotspot.amd64,\
 com.oracle.graal.hotspot.ptx,\