Mercurial > hg > truffle
comparison mxtool/mx.py @ 13492:896c8712c7b4
Merge.
author | Chris Seaton <chris.seaton@oracle.com> |
---|---|
date | Mon, 30 Dec 2013 20:36:04 +0000 |
parents | d3bd7a3bbb2b |
children | fa56f5a49270 |
comparison
equal
deleted
inserted
replaced
13491:807ad2134a6b | 13492:896c8712c7b4 |
---|---|
1830 if not suppliedParser: | 1830 if not suppliedParser: |
1831 parser = ArgumentParser(prog='mx build') | 1831 parser = ArgumentParser(prog='mx build') |
1832 | 1832 |
1833 javaCompliance = java().javaCompliance | 1833 javaCompliance = java().javaCompliance |
1834 | 1834 |
1835 defaultEcjPath = join(_primary_suite.mxDir, 'ecj.jar') | 1835 defaultEcjPath = get_env('JDT', join(_primary_suite.mxDir, 'ecj.jar')) |
1836 | 1836 |
1837 parser = parser if parser is not None else ArgumentParser(prog='mx build') | 1837 parser = parser if parser is not None else ArgumentParser(prog='mx build') |
1838 parser.add_argument('-f', action='store_true', dest='force', help='force build (disables timestamp checking)') | 1838 parser.add_argument('-f', action='store_true', dest='force', help='force build (disables timestamp checking)') |
1839 parser.add_argument('-c', action='store_true', dest='clean', help='removes existing build output') | 1839 parser.add_argument('-c', action='store_true', dest='clean', help='removes existing build output') |
1840 parser.add_argument('--source', dest='compliance', help='Java compliance level for projects without an explicit one', default=str(javaCompliance)) | 1840 parser.add_argument('--source', dest='compliance', help='Java compliance level for projects without an explicit one', default=str(javaCompliance)) |
1853 | 1853 |
1854 jdtJar = None | 1854 jdtJar = None |
1855 if args.jdt is not None: | 1855 if args.jdt is not None: |
1856 if args.jdt.endswith('.jar'): | 1856 if args.jdt.endswith('.jar'): |
1857 jdtJar = args.jdt | 1857 jdtJar = args.jdt |
1858 if not exists(jdtJar) and os.path.abspath(jdtJar) == os.path.abspath(defaultEcjPath): | 1858 if not exists(jdtJar) and os.path.abspath(jdtJar) == os.path.abspath(defaultEcjPath) and get_env('JDT', None) is None: |
1859 # Silently ignore JDT if default location is used but not ecj.jar exists there | 1859 # Silently ignore JDT if default location is used but not ecj.jar exists there |
1860 jdtJar = None | 1860 jdtJar = None |
1861 | 1861 |
1862 built = set() | 1862 built = set() |
1863 | 1863 |
2193 for p in candidates: | 2193 for p in candidates: |
2194 if _isAnnotationProcessorDependency(p): | 2194 if _isAnnotationProcessorDependency(p): |
2195 projs.add(p) | 2195 projs.add(p) |
2196 | 2196 |
2197 if len(projs) <= 0: | 2197 if len(projs) <= 0: |
2198 return | 2198 return [] |
2199 | 2199 |
2200 pnames = [p.name for p in projs] | 2200 pnames = [p.name for p in projs] |
2201 build(['--projects', ",".join(pnames)]) | 2201 build(['--projects', ",".join(pnames)]) |
2202 archive(pnames) | 2202 return archive(pnames) |
2203 | 2203 |
2204 def pylint(args): | 2204 def pylint(args): |
2205 """run pylint (if available) over Python source files (found by 'hg locate' or by tree walk with -walk)""" | 2205 """run pylint (if available) over Python source files (found by 'hg locate' or by tree walk with -walk)""" |
2206 | 2206 |
2207 parser = ArgumentParser(prog='mx pylint') | 2207 parser = ArgumentParser(prog='mx pylint') |
2273 """create jar files for projects and distributions""" | 2273 """create jar files for projects and distributions""" |
2274 parser = ArgumentParser(prog='mx archive') | 2274 parser = ArgumentParser(prog='mx archive') |
2275 parser.add_argument('names', nargs=REMAINDER, metavar='[<project>|@<distribution>]...') | 2275 parser.add_argument('names', nargs=REMAINDER, metavar='[<project>|@<distribution>]...') |
2276 args = parser.parse_args(args) | 2276 args = parser.parse_args(args) |
2277 | 2277 |
2278 archives = [] | |
2278 for name in args.names: | 2279 for name in args.names: |
2279 if name.startswith('@'): | 2280 if name.startswith('@'): |
2280 dname = name[1:] | 2281 dname = name[1:] |
2281 d = distribution(dname) | 2282 d = distribution(dname) |
2282 fd, tmp = tempfile.mkstemp(suffix='', prefix=basename(d.path) + '.', dir=dirname(d.path)) | 2283 fd, tmp = tempfile.mkstemp(suffix='', prefix=basename(d.path) + '.', dir=dirname(d.path)) |
2339 zf.close() | 2340 zf.close() |
2340 os.close(fd) | 2341 os.close(fd) |
2341 shutil.rmtree(services) | 2342 shutil.rmtree(services) |
2342 # Atomic on Unix | 2343 # Atomic on Unix |
2343 shutil.move(tmp, d.path) | 2344 shutil.move(tmp, d.path) |
2345 archives.append(d.path) | |
2344 # print time.time(), 'move:', tmp, '->', d.path | 2346 # print time.time(), 'move:', tmp, '->', d.path |
2345 d.notify_updated() | 2347 d.notify_updated() |
2346 finally: | 2348 finally: |
2347 if exists(tmp): | 2349 if exists(tmp): |
2348 os.remove(tmp) | 2350 os.remove(tmp) |
2361 arcname = join(relpath, f).replace(os.sep, '/') | 2363 arcname = join(relpath, f).replace(os.sep, '/') |
2362 zf.write(join(root, f), arcname) | 2364 zf.write(join(root, f), arcname) |
2363 zf.close() | 2365 zf.close() |
2364 os.close(fd) | 2366 os.close(fd) |
2365 # Atomic on Unix | 2367 # Atomic on Unix |
2366 shutil.move(tmp, join(p.dir, p.name + '.jar')) | 2368 jarFile = join(p.dir, p.name + '.jar') |
2369 shutil.move(tmp, jarFile) | |
2370 archives.append(jarFile) | |
2367 finally: | 2371 finally: |
2368 if exists(tmp): | 2372 if exists(tmp): |
2369 os.remove(tmp) | 2373 os.remove(tmp) |
2374 return archives | |
2370 | 2375 |
2371 def canonicalizeprojects(args): | 2376 def canonicalizeprojects(args): |
2372 """process all project files to canonicalize the dependencies | 2377 """process all project files to canonicalize the dependencies |
2373 | 2378 |
2374 The exit code of this command reflects how many files were updated.""" | 2379 The exit code of this command reflects how many files were updated.""" |
2617 | 2622 |
2618 outputDir = p.output_dir() | 2623 outputDir = p.output_dir() |
2619 if outputDir != '' and exists(outputDir): | 2624 if outputDir != '' and exists(outputDir): |
2620 log('Removing {0}...'.format(outputDir)) | 2625 log('Removing {0}...'.format(outputDir)) |
2621 shutil.rmtree(outputDir) | 2626 shutil.rmtree(outputDir) |
2627 | |
2628 for configName in ['netbeans-config.zip', 'eclipse-config.zip']: | |
2629 config = TimeStampFile(join(p.suite.mxDir, configName)) | |
2630 if config.exists(): | |
2631 os.unlink(config.path) | |
2622 | 2632 |
2623 if suppliedParser: | 2633 if suppliedParser: |
2624 return args | 2634 return args |
2625 | 2635 |
2626 def about(args): | 2636 def about(args): |
2769 suitePrefix = suite.name + '-' | 2779 suitePrefix = suite.name + '-' |
2770 name = suitePrefix + 'attach-' + hostname + '-' + port | 2780 name = suitePrefix + 'attach-' + hostname + '-' + port |
2771 eclipseLaunches = join(suite.mxDir, 'eclipse-launches') | 2781 eclipseLaunches = join(suite.mxDir, 'eclipse-launches') |
2772 if not exists(eclipseLaunches): | 2782 if not exists(eclipseLaunches): |
2773 os.makedirs(eclipseLaunches) | 2783 os.makedirs(eclipseLaunches) |
2774 return update_file(join(eclipseLaunches, name + '.launch'), launch) | 2784 launchFile = join(eclipseLaunches, name + '.launch') |
2785 return update_file(launchFile, launch), launchFile | |
2775 | 2786 |
2776 def make_eclipse_launch(javaArgs, jre, name=None, deps=None): | 2787 def make_eclipse_launch(javaArgs, jre, name=None, deps=None): |
2777 """ | 2788 """ |
2778 Creates an Eclipse launch configuration file for running/debugging a Java command. | 2789 Creates an Eclipse launch configuration file for running/debugging a Java command. |
2779 """ | 2790 """ |
2865 if timestamp.isOlderThan(path): | 2876 if timestamp.isOlderThan(path): |
2866 return False | 2877 return False |
2867 return True | 2878 return True |
2868 | 2879 |
2869 def _eclipseinit_suite(args, suite, buildProcessorJars=True, refreshOnly=False): | 2880 def _eclipseinit_suite(args, suite, buildProcessorJars=True, refreshOnly=False): |
2870 timestamp = TimeStampFile(join(suite.mxDir, 'eclipseinit.timestamp')) | 2881 configZip = TimeStampFile(join(suite.mxDir, 'eclipse-config.zip')) |
2871 if refreshOnly and not timestamp.exists(): | 2882 configLibsZip = join(suite.mxDir, 'eclipse-config-libs.zip') |
2883 if refreshOnly and not configZip.exists(): | |
2872 return | 2884 return |
2873 | 2885 |
2874 if _check_ide_timestamp(suite, timestamp): | 2886 if _check_ide_timestamp(suite, configZip): |
2875 logv('[Eclipse configurations are up to date - skipping]') | 2887 logv('[Eclipse configurations are up to date - skipping]') |
2876 return | 2888 return |
2877 | 2889 |
2890 files = [] | |
2891 libFiles = [] | |
2878 if buildProcessorJars: | 2892 if buildProcessorJars: |
2879 _processorjars_suite(suite) | 2893 files += _processorjars_suite(suite) |
2880 | 2894 |
2881 projToDist = dict() | 2895 projToDist = dict() |
2882 for dist in _dists.values(): | 2896 for dist in _dists.values(): |
2883 distDeps = sorted_deps(dist.deps) | 2897 distDeps = sorted_deps(dist.deps) |
2884 for p in distDeps: | 2898 for p in distDeps: |
2903 if len(p.annotation_processors()) > 0: | 2917 if len(p.annotation_processors()) > 0: |
2904 genDir = p.source_gen_dir() | 2918 genDir = p.source_gen_dir() |
2905 if not exists(genDir): | 2919 if not exists(genDir): |
2906 os.mkdir(genDir) | 2920 os.mkdir(genDir) |
2907 out.element('classpathentry', {'kind' : 'src', 'path' : 'src_gen'}) | 2921 out.element('classpathentry', {'kind' : 'src', 'path' : 'src_gen'}) |
2922 files.append(genDir) | |
2908 | 2923 |
2909 # Every Java program depends on the JRE | 2924 # Every Java program depends on the JRE |
2910 out.element('classpathentry', {'kind' : 'con', 'path' : 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-' + str(p.javaCompliance)}) | 2925 out.element('classpathentry', {'kind' : 'con', 'path' : 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-' + str(p.javaCompliance)}) |
2911 | 2926 |
2912 if exists(join(p.dir, 'plugin.xml')): # eclipse plugin project | 2927 if exists(join(p.dir, 'plugin.xml')): # eclipse plugin project |
2937 | 2952 |
2938 sourcePath = dep.get_source_path(resolve=True) | 2953 sourcePath = dep.get_source_path(resolve=True) |
2939 if sourcePath is not None: | 2954 if sourcePath is not None: |
2940 attributes['sourcepath'] = sourcePath | 2955 attributes['sourcepath'] = sourcePath |
2941 out.element('classpathentry', attributes) | 2956 out.element('classpathentry', attributes) |
2957 libFiles.append(path) | |
2942 else: | 2958 else: |
2943 out.element('classpathentry', {'combineaccessrules' : 'false', 'exported' : 'true', 'kind' : 'src', 'path' : '/' + dep.name}) | 2959 out.element('classpathentry', {'combineaccessrules' : 'false', 'exported' : 'true', 'kind' : 'src', 'path' : '/' + dep.name}) |
2944 | 2960 |
2945 out.element('classpathentry', {'kind' : 'output', 'path' : getattr(p, 'eclipse.output', 'bin')}) | 2961 out.element('classpathentry', {'kind' : 'output', 'path' : getattr(p, 'eclipse.output', 'bin')}) |
2946 out.close('classpath') | 2962 out.close('classpath') |
2947 update_file(join(p.dir, '.classpath'), out.xml(indent='\t', newl='\n')) | 2963 classpathFile = join(p.dir, '.classpath') |
2964 update_file(classpathFile, out.xml(indent='\t', newl='\n')) | |
2965 files.append(classpathFile) | |
2948 | 2966 |
2949 csConfig = join(project(p.checkstyleProj).dir, '.checkstyle_checks.xml') | 2967 csConfig = join(project(p.checkstyleProj).dir, '.checkstyle_checks.xml') |
2950 if exists(csConfig): | 2968 if exists(csConfig): |
2951 out = XMLDoc() | 2969 out = XMLDoc() |
2952 | 2970 |
2975 out.element('filter-data', {'value' : line}) | 2993 out.element('filter-data', {'value' : line}) |
2976 out.close('filter') | 2994 out.close('filter') |
2977 | 2995 |
2978 out.close('fileset-config') | 2996 out.close('fileset-config') |
2979 update_file(dotCheckstyle, out.xml(indent=' ', newl='\n')) | 2997 update_file(dotCheckstyle, out.xml(indent=' ', newl='\n')) |
2998 files.append(dotCheckstyle) | |
2980 | 2999 |
2981 out = XMLDoc() | 3000 out = XMLDoc() |
2982 out.open('projectDescription') | 3001 out.open('projectDescription') |
2983 out.element('name', data=p.name) | 3002 out.element('name', data=p.name) |
2984 out.element('comment', data='') | 3003 out.element('comment', data='') |
3020 out.element('nature', data='net.sf.eclipsecs.core.CheckstyleNature') | 3039 out.element('nature', data='net.sf.eclipsecs.core.CheckstyleNature') |
3021 if exists(join(p.dir, 'plugin.xml')): # eclipse plugin project | 3040 if exists(join(p.dir, 'plugin.xml')): # eclipse plugin project |
3022 out.element('nature', data='org.eclipse.pde.PluginNature') | 3041 out.element('nature', data='org.eclipse.pde.PluginNature') |
3023 out.close('natures') | 3042 out.close('natures') |
3024 out.close('projectDescription') | 3043 out.close('projectDescription') |
3025 update_file(join(p.dir, '.project'), out.xml(indent='\t', newl='\n')) | 3044 projectFile = join(p.dir, '.project') |
3045 update_file(projectFile, out.xml(indent='\t', newl='\n')) | |
3046 files.append(projectFile) | |
3026 | 3047 |
3027 settingsDir = join(p.dir, ".settings") | 3048 settingsDir = join(p.dir, ".settings") |
3028 if not exists(settingsDir): | 3049 if not exists(settingsDir): |
3029 os.mkdir(settingsDir) | 3050 os.mkdir(settingsDir) |
3030 | 3051 |
3039 content = f.read() | 3060 content = f.read() |
3040 content = content.replace('${javaCompliance}', str(p.javaCompliance)) | 3061 content = content.replace('${javaCompliance}', str(p.javaCompliance)) |
3041 if len(p.annotation_processors()) > 0: | 3062 if len(p.annotation_processors()) > 0: |
3042 content = content.replace('org.eclipse.jdt.core.compiler.processAnnotations=disabled', 'org.eclipse.jdt.core.compiler.processAnnotations=enabled') | 3063 content = content.replace('org.eclipse.jdt.core.compiler.processAnnotations=disabled', 'org.eclipse.jdt.core.compiler.processAnnotations=enabled') |
3043 update_file(join(settingsDir, name), content) | 3064 update_file(join(settingsDir, name), content) |
3065 files.append(join(settingsDir, name)) | |
3044 | 3066 |
3045 if len(p.annotation_processors()) > 0: | 3067 if len(p.annotation_processors()) > 0: |
3046 out = XMLDoc() | 3068 out = XMLDoc() |
3047 out.open('factorypath') | 3069 out.open('factorypath') |
3048 out.element('factorypathentry', {'kind' : 'PLUGIN', 'id' : 'org.eclipse.jst.ws.annotations.core', 'enabled' : 'true', 'runInBatchMode' : 'false'}) | 3070 out.element('factorypathentry', {'kind' : 'PLUGIN', 'id' : 'org.eclipse.jst.ws.annotations.core', 'enabled' : 'true', 'runInBatchMode' : 'false'}) |
3057 # Relative paths for "lib" class path entries have various semantics depending on the Eclipse | 3079 # Relative paths for "lib" class path entries have various semantics depending on the Eclipse |
3058 # version being used (e.g. see https://bugs.eclipse.org/bugs/show_bug.cgi?id=274737) so it's | 3080 # version being used (e.g. see https://bugs.eclipse.org/bugs/show_bug.cgi?id=274737) so it's |
3059 # safest to simply use absolute paths. | 3081 # safest to simply use absolute paths. |
3060 path = join(p.suite.dir, path) | 3082 path = join(p.suite.dir, path) |
3061 out.element('factorypathentry', {'kind' : 'EXTJAR', 'id' : path, 'enabled' : 'true', 'runInBatchMode' : 'false'}) | 3083 out.element('factorypathentry', {'kind' : 'EXTJAR', 'id' : path, 'enabled' : 'true', 'runInBatchMode' : 'false'}) |
3084 files.append(path) | |
3062 else: | 3085 else: |
3063 out.element('factorypathentry', {'kind' : 'WKSPJAR', 'id' : '/' + dep.name + '/' + dep.name + '.jar', 'enabled' : 'true', 'runInBatchMode' : 'false'}) | 3086 out.element('factorypathentry', {'kind' : 'WKSPJAR', 'id' : '/' + dep.name + '/' + dep.name + '.jar', 'enabled' : 'true', 'runInBatchMode' : 'false'}) |
3064 out.close('factorypath') | 3087 out.close('factorypath') |
3065 update_file(join(p.dir, '.factorypath'), out.xml(indent='\t', newl='\n')) | 3088 update_file(join(p.dir, '.factorypath'), out.xml(indent='\t', newl='\n')) |
3066 | 3089 files.append(join(p.dir, '.factorypath')) |
3067 make_eclipse_attach(suite, 'localhost', '8000', deps=projects()) | 3090 |
3068 timestamp.touch() | 3091 _, launchFile = make_eclipse_attach(suite, 'localhost', '8000', deps=projects()) |
3092 files.append(launchFile) | |
3093 | |
3094 _zip_files(files, suite.dir, configZip.path) | |
3095 _zip_files(libFiles, suite.dir, configLibsZip) | |
3096 | |
3097 def _zip_files(files, baseDir, zipPath): | |
3098 fd, tmp = tempfile.mkstemp(suffix='', prefix=basename(zipPath), dir=baseDir) | |
3099 try: | |
3100 zf = zipfile.ZipFile(tmp, 'w') | |
3101 for f in sorted(set(files)): | |
3102 relpath = os.path.relpath(f, baseDir) | |
3103 arcname = relpath.replace(os.sep, '/') | |
3104 zf.write(f, arcname) | |
3105 zf.close() | |
3106 os.close(fd) | |
3107 # Atomic on Unix | |
3108 shutil.move(tmp, zipPath) | |
3109 finally: | |
3110 if exists(tmp): | |
3111 os.remove(tmp) | |
3069 | 3112 |
3070 def _isAnnotationProcessorDependency(p): | 3113 def _isAnnotationProcessorDependency(p): |
3071 """ | 3114 """ |
3072 Determines if a given project is part of an annotation processor. | 3115 Determines if a given project is part of an annotation processor. |
3073 """ | 3116 """ |
3170 wsroot = expected_wsroot | 3213 wsroot = expected_wsroot |
3171 | 3214 |
3172 wsdir = join(wsroot, wsloc) | 3215 wsdir = join(wsroot, wsloc) |
3173 if not exists(wsdir): | 3216 if not exists(wsdir): |
3174 wsdir = wsroot | 3217 wsdir = wsroot |
3175 log('Could not find Eclipse metadata directory. Please place ' + wsfilename + ' in ' + wsloc + ' manually.') | 3218 logv('Could not find Eclipse metadata directory. Please place ' + wsfilename + ' in ' + wsloc + ' manually.') |
3176 wspath = join(wsdir, wsfilename) | 3219 wspath = join(wsdir, wsfilename) |
3177 | 3220 |
3178 # gather working set info from project data | 3221 # gather working set info from project data |
3179 workingSets = dict() | 3222 workingSets = dict() |
3180 for p in projects(): | 3223 for p in projects(): |
3293 | 3336 |
3294 for suite in suites(True): | 3337 for suite in suites(True): |
3295 _netbeansinit_suite(args, suite, refreshOnly, buildProcessorJars) | 3338 _netbeansinit_suite(args, suite, refreshOnly, buildProcessorJars) |
3296 | 3339 |
3297 def _netbeansinit_suite(args, suite, refreshOnly=False, buildProcessorJars=True): | 3340 def _netbeansinit_suite(args, suite, refreshOnly=False, buildProcessorJars=True): |
3298 timestamp = TimeStampFile(join(suite.mxDir, 'netbeansinit.timestamp')) | 3341 configZip = TimeStampFile(join(suite.mxDir, 'netbeans-config.zip')) |
3299 if refreshOnly and not timestamp.exists(): | 3342 configLibsZip = join(suite.mxDir, 'eclipse-config-libs.zip') |
3343 if refreshOnly and not configZip.exists(): | |
3300 return | 3344 return |
3301 | 3345 |
3302 if _check_ide_timestamp(suite, timestamp): | 3346 if _check_ide_timestamp(suite, configZip): |
3303 logv('[NetBeans configurations are up to date - skipping]') | 3347 logv('[NetBeans configurations are up to date - skipping]') |
3304 return | 3348 return |
3305 | 3349 |
3306 updated = False | 3350 updated = False |
3351 files = [] | |
3352 libFiles = [] | |
3307 for p in suite.projects: | 3353 for p in suite.projects: |
3308 if p.native: | 3354 if p.native: |
3309 continue | 3355 continue |
3310 | 3356 |
3311 if exists(join(p.dir, 'plugin.xml')): # eclipse plugin project | 3357 if exists(join(p.dir, 'plugin.xml')): # eclipse plugin project |
3326 out.element('arg', {'value' : '@GRAAL'}) | 3372 out.element('arg', {'value' : '@GRAAL'}) |
3327 out.close('exec') | 3373 out.close('exec') |
3328 out.close('target') | 3374 out.close('target') |
3329 out.close('project') | 3375 out.close('project') |
3330 updated = update_file(join(p.dir, 'build.xml'), out.xml(indent='\t', newl='\n')) or updated | 3376 updated = update_file(join(p.dir, 'build.xml'), out.xml(indent='\t', newl='\n')) or updated |
3377 files.append(join(p.dir, 'build.xml')) | |
3331 | 3378 |
3332 out = XMLDoc() | 3379 out = XMLDoc() |
3333 out.open('project', {'xmlns' : 'http://www.netbeans.org/ns/project/1'}) | 3380 out.open('project', {'xmlns' : 'http://www.netbeans.org/ns/project/1'}) |
3334 out.element('type', data='org.netbeans.modules.java.j2seproject') | 3381 out.element('type', data='org.netbeans.modules.java.j2seproject') |
3335 out.open('configuration') | 3382 out.open('configuration') |
3369 out.close('references') | 3416 out.close('references') |
3370 | 3417 |
3371 out.close('configuration') | 3418 out.close('configuration') |
3372 out.close('project') | 3419 out.close('project') |
3373 updated = update_file(join(p.dir, 'nbproject', 'project.xml'), out.xml(indent=' ', newl='\n')) or updated | 3420 updated = update_file(join(p.dir, 'nbproject', 'project.xml'), out.xml(indent=' ', newl='\n')) or updated |
3421 files.append(join(p.dir, 'nbproject', 'project.xml')) | |
3374 | 3422 |
3375 out = StringIO.StringIO() | 3423 out = StringIO.StringIO() |
3376 jdkPlatform = 'JDK_' + str(java().version) | 3424 jdkPlatform = 'JDK_' + str(java().version) |
3377 | 3425 |
3378 annotationProcessorEnabled = "false" | 3426 annotationProcessorEnabled = "false" |
3490 if path: | 3538 if path: |
3491 if os.sep == '\\': | 3539 if os.sep == '\\': |
3492 path = path.replace('\\', '\\\\') | 3540 path = path.replace('\\', '\\\\') |
3493 ref = 'file.reference.' + dep.name + '-bin' | 3541 ref = 'file.reference.' + dep.name + '-bin' |
3494 print >> out, ref + '=' + path | 3542 print >> out, ref + '=' + path |
3543 libFiles.append(path) | |
3495 | 3544 |
3496 else: | 3545 else: |
3497 n = dep.name.replace('.', '_') | 3546 n = dep.name.replace('.', '_') |
3498 relDepPath = os.path.relpath(dep.dir, p.dir).replace(os.sep, '/') | 3547 relDepPath = os.path.relpath(dep.dir, p.dir).replace(os.sep, '/') |
3499 ref = 'reference.' + n + '.jar' | 3548 ref = 'reference.' + n + '.jar' |
3510 print >> out, 'javac.test.processorpath=${javac.test.classpath}\\\n ' + (os.pathsep + '\\\n ').join(annotationProcessorReferences) | 3559 print >> out, 'javac.test.processorpath=${javac.test.classpath}\\\n ' + (os.pathsep + '\\\n ').join(annotationProcessorReferences) |
3511 print >> out, 'javac.processorpath=${javac.classpath}\\\n ' + (os.pathsep + '\\\n ').join(annotationProcessorReferences) | 3560 print >> out, 'javac.processorpath=${javac.classpath}\\\n ' + (os.pathsep + '\\\n ').join(annotationProcessorReferences) |
3512 | 3561 |
3513 updated = update_file(join(p.dir, 'nbproject', 'project.properties'), out.getvalue()) or updated | 3562 updated = update_file(join(p.dir, 'nbproject', 'project.properties'), out.getvalue()) or updated |
3514 out.close() | 3563 out.close() |
3564 files.append(join(p.dir, 'nbproject', 'project.properties')) | |
3515 | 3565 |
3516 if updated: | 3566 if updated: |
3517 log('If using NetBeans:') | 3567 log('If using NetBeans:') |
3518 log(' 1. Ensure that a platform named "JDK_' + str(java().version) + '" is defined (Tools -> Java Platforms)') | 3568 log(' 1. Ensure that a platform named "JDK_' + str(java().version) + '" is defined (Tools -> Java Platforms)') |
3519 log(' 2. Open/create a Project Group for the directory containing the projects (File -> Project Group -> New Group... -> Folder of Projects)') | 3569 log(' 2. Open/create a Project Group for the directory containing the projects (File -> Project Group -> New Group... -> Folder of Projects)') |
3520 | 3570 |
3521 timestamp.touch() | 3571 _zip_files(files, suite.dir, configZip.path) |
3572 _zip_files(libFiles, suite.dir, configLibsZip) | |
3522 | 3573 |
3523 def ideclean(args): | 3574 def ideclean(args): |
3524 """remove all Eclipse and NetBeans project configurations""" | 3575 """remove all Eclipse and NetBeans project configurations""" |
3525 def rm(path): | 3576 def rm(path): |
3526 if exists(path): | 3577 if exists(path): |
3527 os.remove(path) | 3578 os.remove(path) |
3528 | 3579 |
3529 for s in suites(): | 3580 for s in suites(): |
3530 rm(join(s.mxDir, 'eclipseinit.timestamp')) | 3581 rm(join(s.mxDir, 'eclipse-config.zip')) |
3531 rm(join(s.mxDir, 'netbeansinit.timestamp')) | 3582 rm(join(s.mxDir, 'netbeans-config.zip')) |
3532 | 3583 |
3533 for p in projects(): | 3584 for p in projects(): |
3534 if p.native: | 3585 if p.native: |
3535 continue | 3586 continue |
3536 | 3587 |