Mercurial > hg > graal-jvmci-8
comparison mxtool/mx.py @ 15897:c5f57314599d
Backed out changeset: a5c5b4aa79ca
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 26 May 2014 12:52:02 +0200 |
parents | a5c5b4aa79ca |
children | c102edf38127 |
comparison
equal
deleted
inserted
replaced
15896:db776f9bea7c | 15897:c5f57314599d |
---|---|
1523 if callable(err): | 1523 if callable(err): |
1524 t = Thread(target=redirect, args=(p.stderr, err)) | 1524 t = Thread(target=redirect, args=(p.stderr, err)) |
1525 # Don't make the reader thread a daemon otherwise output can be droppped | 1525 # Don't make the reader thread a daemon otherwise output can be droppped |
1526 t.start() | 1526 t.start() |
1527 joiners.append(t) | 1527 joiners.append(t) |
1528 while any([t.is_alive() for t in joiners]): | 1528 for t in joiners: |
1529 for t in joiners: | 1529 t.join() |
1530 t.join(10) | |
1531 if timeout is None or timeout == 0: | 1530 if timeout is None or timeout == 0: |
1532 retcode = waitOn(p) | 1531 retcode = waitOn(p) |
1533 else: | 1532 else: |
1534 if get_os() == 'windows': | 1533 if get_os() == 'windows': |
1535 abort('Use of timeout not (yet) supported on Windows') | 1534 abort('Use of timeout not (yet) supported on Windows') |
3339 | 3338 |
3340 if _isAnnotationProcessorDependency(p): | 3339 if _isAnnotationProcessorDependency(p): |
3341 refreshFile = os.path.relpath(join(p.dir, p.name + '.jar'), logicalWorkspaceRoot) | 3340 refreshFile = os.path.relpath(join(p.dir, p.name + '.jar'), logicalWorkspaceRoot) |
3342 _genEclipseBuilder(out, p, 'Jar', 'archive ' + p.name, refresh=True, refreshFile=refreshFile, relevantResources=[binFolder], async=True, xmlIndent='', xmlStandalone='no') | 3341 _genEclipseBuilder(out, p, 'Jar', 'archive ' + p.name, refresh=True, refreshFile=refreshFile, relevantResources=[binFolder], async=True, xmlIndent='', xmlStandalone='no') |
3343 | 3342 |
3343 if projToDist.has_key(p.name): | |
3344 dist, distDeps = projToDist[p.name] | |
3345 _genEclipseBuilder(out, p, 'Create' + dist.name + 'Dist', 'archive @' + dist.name, relevantResources=[binFolder], logToFile=True, refresh=False, async=True) | |
3346 | |
3344 out.close('buildSpec') | 3347 out.close('buildSpec') |
3345 out.open('natures') | 3348 out.open('natures') |
3346 out.element('nature', data='org.eclipse.jdt.core.javanature') | 3349 out.element('nature', data='org.eclipse.jdt.core.javanature') |
3347 if exists(csConfig): | 3350 if exists(csConfig): |
3348 out.element('nature', data='net.sf.eclipsecs.core.CheckstyleNature') | 3351 out.element('nature', data='net.sf.eclipsecs.core.CheckstyleNature') |
3416 _, launchFile = make_eclipse_attach(suite, 'localhost', '8000', deps=sorted_deps(projectNames=None, includeLibs=True)) | 3419 _, launchFile = make_eclipse_attach(suite, 'localhost', '8000', deps=sorted_deps(projectNames=None, includeLibs=True)) |
3417 files.append(launchFile) | 3420 files.append(launchFile) |
3418 | 3421 |
3419 _zip_files(files, suite.dir, configZip.path) | 3422 _zip_files(files, suite.dir, configZip.path) |
3420 _zip_files(libFiles, suite.dir, configLibsZip) | 3423 _zip_files(libFiles, suite.dir, configLibsZip) |
3421 | |
3422 # Create an Eclipse project for each distribution that will create/update the archive | |
3423 # for the distribution whenever any project of the distribution is updated. | |
3424 for dist in suite.dists: | |
3425 name = dist.name | |
3426 # TODO: Support 'subDir' attribute in mx/projects? | |
3427 projectDir = join(suite.dir, dist.name + '.dist') | |
3428 if not exists(projectDir): | |
3429 os.makedirs(projectDir) | |
3430 distProjects = [d for d in dist.sorted_deps() if d.isProject()] | |
3431 relevantResources = [] | |
3432 for p in distProjects: | |
3433 for srcDir in p.source_dirs(): | |
3434 relevantResources.append(join(p.name, os.path.relpath(srcDir, p.dir))) | |
3435 relevantResources.append(join(p.name, os.path.relpath(p.output_dir(), p.dir))) | |
3436 out = XMLDoc() | |
3437 out.open('projectDescription') | |
3438 out.element('name', data=dist.name) | |
3439 out.element('comment', data='Updates ' + dist.path + ' if a project dependency of ' + dist.name + ' is updated') | |
3440 out.open('projects') | |
3441 for p in distProjects: | |
3442 out.element('project', data=p.name) | |
3443 out.close('projects') | |
3444 out.open('buildSpec') | |
3445 dist.dir = projectDir | |
3446 dist.javaCompliance = max([p.javaCompliance for p in distProjects]) | |
3447 _genEclipseBuilder(out, dist, 'Create' + dist.name + 'Dist', 'archive @' + dist.name, relevantResources=relevantResources, logToFile=True, refresh=False, async=True) | |
3448 out.close('buildSpec') | |
3449 out.open('natures') | |
3450 out.element('nature', data='org.eclipse.jdt.core.javanature') | |
3451 out.close('natures') | |
3452 out.close('projectDescription') | |
3453 projectFile = join(projectDir, '.project') | |
3454 update_file(projectFile, out.xml(indent='\t', newl='\n')) | |
3455 files.append(projectFile) | |
3456 | 3424 |
3457 def _zip_files(files, baseDir, zipPath): | 3425 def _zip_files(files, baseDir, zipPath): |
3458 fd, tmp = tempfile.mkstemp(suffix='', prefix=basename(zipPath), dir=baseDir) | 3426 fd, tmp = tempfile.mkstemp(suffix='', prefix=basename(zipPath), dir=baseDir) |
3459 try: | 3427 try: |
3460 zf = zipfile.ZipFile(tmp, 'w') | 3428 zf = zipfile.ZipFile(tmp, 'w') |