comparison mxtool/mx.py @ 13475:4a3628c79ff9

separated external libs out from zipped up IDE configs
author Doug Simon <doug.simon@oracle.com>
date Mon, 23 Dec 2013 12:55:14 +0100
parents 69f3251332c9
children 6215ff792647
comparison
equal deleted inserted replaced
13474:108ba3e82d3a 13475:4a3628c79ff9
2877 return False 2877 return False
2878 return True 2878 return True
2879 2879
2880 def _eclipseinit_suite(args, suite, buildProcessorJars=True, refreshOnly=False): 2880 def _eclipseinit_suite(args, suite, buildProcessorJars=True, refreshOnly=False):
2881 configZip = TimeStampFile(join(suite.mxDir, 'eclipse-config.zip')) 2881 configZip = TimeStampFile(join(suite.mxDir, 'eclipse-config.zip'))
2882 configLibsZip = join(suite.mxDir, 'eclipse-config-libs.zip')
2882 if refreshOnly and not configZip.exists(): 2883 if refreshOnly and not configZip.exists():
2883 return 2884 return
2884 2885
2885 if _check_ide_timestamp(suite, configZip): 2886 if _check_ide_timestamp(suite, configZip):
2886 logv('[Eclipse configurations are up to date - skipping]') 2887 logv('[Eclipse configurations are up to date - skipping]')
2887 return 2888 return
2888 2889
2889 files = [] 2890 files = []
2891 libFiles = []
2890 if buildProcessorJars: 2892 if buildProcessorJars:
2891 files += _processorjars_suite(suite) 2893 files += _processorjars_suite(suite)
2892 2894
2893 projToDist = dict() 2895 projToDist = dict()
2894 for dist in _dists.values(): 2896 for dist in _dists.values():
2950 2952
2951 sourcePath = dep.get_source_path(resolve=True) 2953 sourcePath = dep.get_source_path(resolve=True)
2952 if sourcePath is not None: 2954 if sourcePath is not None:
2953 attributes['sourcepath'] = sourcePath 2955 attributes['sourcepath'] = sourcePath
2954 out.element('classpathentry', attributes) 2956 out.element('classpathentry', attributes)
2955 files.append(path) 2957 libFiles.append(path)
2956 else: 2958 else:
2957 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})
2958 2960
2959 out.element('classpathentry', {'kind' : 'output', 'path' : getattr(p, 'eclipse.output', 'bin')}) 2961 out.element('classpathentry', {'kind' : 'output', 'path' : getattr(p, 'eclipse.output', 'bin')})
2960 out.close('classpath') 2962 out.close('classpath')
3088 3090
3089 _, launchFile = make_eclipse_attach(suite, 'localhost', '8000', deps=projects()) 3091 _, launchFile = make_eclipse_attach(suite, 'localhost', '8000', deps=projects())
3090 files.append(launchFile) 3092 files.append(launchFile)
3091 3093
3092 _zip_files(files, suite.dir, configZip.path) 3094 _zip_files(files, suite.dir, configZip.path)
3095 _zip_files(libFiles, suite.dir, configLibsZip)
3093 3096
3094 def _zip_files(files, baseDir, zipPath): 3097 def _zip_files(files, baseDir, zipPath):
3095 fd, tmp = tempfile.mkstemp(suffix='', prefix=basename(zipPath), dir=baseDir) 3098 fd, tmp = tempfile.mkstemp(suffix='', prefix=basename(zipPath), dir=baseDir)
3096 try: 3099 try:
3097 zf = zipfile.ZipFile(tmp, 'w') 3100 zf = zipfile.ZipFile(tmp, 'w')
3334 for suite in suites(True): 3337 for suite in suites(True):
3335 _netbeansinit_suite(args, suite, refreshOnly, buildProcessorJars) 3338 _netbeansinit_suite(args, suite, refreshOnly, buildProcessorJars)
3336 3339
3337 def _netbeansinit_suite(args, suite, refreshOnly=False, buildProcessorJars=True): 3340 def _netbeansinit_suite(args, suite, refreshOnly=False, buildProcessorJars=True):
3338 configZip = TimeStampFile(join(suite.mxDir, 'netbeans-config.zip')) 3341 configZip = TimeStampFile(join(suite.mxDir, 'netbeans-config.zip'))
3342 configLibsZip = join(suite.mxDir, 'eclipse-config-libs.zip')
3339 if refreshOnly and not configZip.exists(): 3343 if refreshOnly and not configZip.exists():
3340 return 3344 return
3341 3345
3342 if _check_ide_timestamp(suite, configZip): 3346 if _check_ide_timestamp(suite, configZip):
3343 logv('[NetBeans configurations are up to date - skipping]') 3347 logv('[NetBeans configurations are up to date - skipping]')
3344 return 3348 return
3345 3349
3346 updated = False 3350 updated = False
3347 files = [] 3351 files = []
3352 libFiles = []
3348 for p in suite.projects: 3353 for p in suite.projects:
3349 if p.native: 3354 if p.native:
3350 continue 3355 continue
3351 3356
3352 if exists(join(p.dir, 'plugin.xml')): # eclipse plugin project 3357 if exists(join(p.dir, 'plugin.xml')): # eclipse plugin project
3533 if path: 3538 if path:
3534 if os.sep == '\\': 3539 if os.sep == '\\':
3535 path = path.replace('\\', '\\\\') 3540 path = path.replace('\\', '\\\\')
3536 ref = 'file.reference.' + dep.name + '-bin' 3541 ref = 'file.reference.' + dep.name + '-bin'
3537 print >> out, ref + '=' + path 3542 print >> out, ref + '=' + path
3538 files.append(path) 3543 libFiles.append(path)
3539 3544
3540 else: 3545 else:
3541 n = dep.name.replace('.', '_') 3546 n = dep.name.replace('.', '_')
3542 relDepPath = os.path.relpath(dep.dir, p.dir).replace(os.sep, '/') 3547 relDepPath = os.path.relpath(dep.dir, p.dir).replace(os.sep, '/')
3543 ref = 'reference.' + n + '.jar' 3548 ref = 'reference.' + n + '.jar'
3562 log('If using NetBeans:') 3567 log('If using NetBeans:')
3563 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)')
3564 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)')
3565 3570
3566 _zip_files(files, suite.dir, configZip.path) 3571 _zip_files(files, suite.dir, configZip.path)
3572 _zip_files(libFiles, suite.dir, configLibsZip)
3567 3573
3568 def ideclean(args): 3574 def ideclean(args):
3569 """remove all Eclipse and NetBeans project configurations""" 3575 """remove all Eclipse and NetBeans project configurations"""
3570 def rm(path): 3576 def rm(path):
3571 if exists(path): 3577 if exists(path):