changeset 13682:c4ff08d2aa0d

fixed problem in netbeansinit that generated invalid annotation processor paths for projects
author Doug Simon <doug.simon@oracle.com>
date Fri, 17 Jan 2014 17:26:47 +0100
parents 927349daa531
children de839ec35cc7
files mxtool/mx.py
diffstat 1 files changed, 16 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/mxtool/mx.py	Fri Jan 17 16:36:51 2014 +0100
+++ b/mxtool/mx.py	Fri Jan 17 17:26:47 2014 +0100
@@ -2866,23 +2866,24 @@
 
     generate_eclipse_workingsets()
 
-def _check_ide_timestamp(suite, timestamp):
-    """return True if and only if the projects file, imports file, eclipse-settings files, and mx itself are all older than timestamp"""
+def _check_ide_timestamp(suite, configZip, ide):
+    """return True if and only if the projects file, imports file, eclipse-settings files, and mx itself are all older than configZip"""
     projectsFile = join(suite.mxDir, 'projects')
-    if timestamp.isOlderThan(projectsFile):
+    if configZip.isOlderThan(projectsFile):
         return False
-    if timestamp.isOlderThan(suite.import_timestamp()):
+    if configZip.isOlderThan(suite.import_timestamp()):
         return False
     # Assume that any mx change might imply changes to the generated IDE files
-    if timestamp.isOlderThan(__file__):
+    if configZip.isOlderThan(__file__):
         return False
 
-    eclipseSettingsDir = join(suite.mxDir, 'eclipse-settings')
-    if exists(eclipseSettingsDir):
-        for name in os.listdir(eclipseSettingsDir):
-            path = join(eclipseSettingsDir, name)
-            if timestamp.isOlderThan(path):
-                return False
+    if ide == 'eclipse':
+        eclipseSettingsDir = join(suite.mxDir, 'eclipse-settings')
+        if exists(eclipseSettingsDir):
+            for name in os.listdir(eclipseSettingsDir):
+                path = join(eclipseSettingsDir, name)
+                if configZip.isOlderThan(path):
+                    return False
     return True
 
 def _eclipseinit_suite(args, suite, buildProcessorJars=True, refreshOnly=False):
@@ -2891,7 +2892,7 @@
     if refreshOnly and not configZip.exists():
         return
 
-    if _check_ide_timestamp(suite, configZip):
+    if _check_ide_timestamp(suite, configZip, 'eclipse'):
         logv('[Eclipse configurations are up to date - skipping]')
         return
 
@@ -3351,7 +3352,7 @@
     if refreshOnly and not configZip.exists():
         return
 
-    if _check_ide_timestamp(suite, configZip):
+    if _check_ide_timestamp(suite, configZip, 'netbeans'):
         logv('[NetBeans configurations are up to date - skipping]')
         return
 
@@ -3561,11 +3562,10 @@
                 javacClasspath.append('${' + ref + '}')
             else:
                 annotationProcessorReferences.append('${' + ref + '}')
-                annotationProcessorReferences += ":\\\n    ${" + ref + "}"
 
         print >> out, 'javac.classpath=\\\n    ' + (os.pathsep + '\\\n    ').join(javacClasspath)
-        print >> out, 'javac.test.processorpath=${javac.test.classpath}\\\n    ' + (os.pathsep + '\\\n    ').join(annotationProcessorReferences)
-        print >> out, 'javac.processorpath=${javac.classpath}\\\n    ' + (os.pathsep + '\\\n    ').join(annotationProcessorReferences)
+        print >> out, 'javac.processorpath=' + (os.pathsep + '\\\n    ').join(['${javac.classpath}'] + annotationProcessorReferences)
+        print >> out, 'javac.test.processorpath=' + (os.pathsep + '\\\n    ').join(['${javac.test.classpath}'] + annotationProcessorReferences)
 
         updated = update_file(join(p.dir, 'nbproject', 'project.properties'), out.getvalue()) or updated
         out.close()