diff mx/mx_graal.py @ 13319:30e57b49fdb1

Include annotation processor meta-info in Truffle JAR.
author Chris Seaton <chris.seaton@oracle.com>
date Fri, 13 Dec 2013 13:54:13 +0000
parents d8692e751c65
children 093353894575
line wrap: on
line diff
--- a/mx/mx_graal.py	Fri Dec 13 10:44:09 2013 +0100
+++ b/mx/mx_graal.py	Fri Dec 13 13:54:13 2013 +0000
@@ -1350,7 +1350,7 @@
     """make truffle.jar"""
     # We use the DSL processor as the starting point for the classpath - this
     # therefore includes the DSL processor, the DSL and the API.
-    packagejar(mx.classpath("com.oracle.truffle.dsl.processor").split(os.pathsep), "truffle.jar", None)
+    packagejar(mx.classpath("com.oracle.truffle.dsl.processor").split(os.pathsep), "truffle.jar", None, "com.oracle.truffle.dsl.processor.TruffleProcessor")
 
 def isGraalEnabled(vm):
     return vm != 'original' and not vm.endswith('nograal')
@@ -1444,7 +1444,7 @@
 
     mx.distribution('GRAAL').add_update_listener(_installGraalJarInJdks)
 
-def packagejar(classpath, outputFile, mainClass):
+def packagejar(classpath, outputFile, mainClass, annotationProcessor=None):
     prefix = '' if mx.get_os() != 'windows' else '\\??\\' # long file name hack
     print "creating", outputFile
     filecount, totalsize = 0, 0
@@ -1453,6 +1453,8 @@
         if mainClass != None:
             manifest += "Main-Class: %s\n\n" % (mainClass)
         zf.writestr("META-INF/MANIFEST.MF", manifest)
+        if annotationProcessor != None:
+            zf.writestr("META-INF/services/javax.annotation.processing.Processor", annotationProcessor)
         for cp in classpath:
             print "+", cp
             if cp.endswith(".jar"):