diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2016-04-29 00:37:31 -0400 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2016-04-29 00:49:30 -0400 |
commit | bdd6d905807a8cee7655d436401e76196ec4fe67 (patch) | |
tree | 09b0da68d249ee44b13f8b691f6f93dfd57ef3e1 /nailgun_launcher | |
parent | 661987259ce2c7a3408403d07ca6afaf06c23aab (diff) | |
download | cbt-bdd6d905807a8cee7655d436401e76196ec4fe67.tar.gz cbt-bdd6d905807a8cee7655d436401e76196ec4fe67.tar.bz2 cbt-bdd6d905807a8cee7655d436401e76196ec4fe67.zip |
Fix use compatibility interfaces from main cbt
Diffstat (limited to 'nailgun_launcher')
-rw-r--r-- | nailgun_launcher/NailgunLauncher.java | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/nailgun_launcher/NailgunLauncher.java b/nailgun_launcher/NailgunLauncher.java index 13b9798..1007343 100644 --- a/nailgun_launcher/NailgunLauncher.java +++ b/nailgun_launcher/NailgunLauncher.java @@ -60,8 +60,9 @@ public class NailgunLauncher{ _assert(System.getenv("CBT_HOME") != null, "environment variable CBT_HOME not defined"); String CBT_HOME = System.getenv("CBT_HOME"); String cache = CBT_HOME + "/cache/"; + String compatibilityTarget = CBT_HOME + "/compatibility/" + TARGET; BuildStage1Result res = buildStage1( - false, start, cache, CBT_HOME, CBT_HOME + "/compatibility/" + TARGET, classLoaderCache + false, start, cache, CBT_HOME, compatibilityTarget, classLoaderCache ); System.exit( @@ -71,12 +72,12 @@ public class NailgunLauncher{ .getMethod( "run", String[].class, File.class, File.class, Boolean.class, - Long.class, ConcurrentHashMap.class, ConcurrentHashMap.class + File.class, Long.class, ConcurrentHashMap.class, ConcurrentHashMap.class ) .invoke( null, (Object) args, new File(cache), new File(CBT_HOME), res.changed, - start, classLoaderCache.keys, classLoaderCache.values + new File(compatibilityTarget), start, classLoaderCache.keys, classLoaderCache.values ) ); } @@ -95,19 +96,23 @@ public class NailgunLauncher{ ClassLoader rootClassLoader = new CbtURLClassLoader( new URL[]{}, ClassLoader.getSystemClassLoader().getParent() ); // wrap for caching EarlyDependencies earlyDeps = new EarlyDependencies(mavenCache, mavenUrl, classLoaderCache, rootClassLoader); - List<File> compatibilitySourceFiles = new ArrayList<File>(); - for( File f: compatibilitySources.listFiles() ){ - if( f.isFile() && (f.toString().endsWith(".scala") || f.toString().endsWith(".java")) ){ - compatibilitySourceFiles.add(f); - } - } - changed = compile(changed, start, "", compatibilityTarget, earlyDeps, compatibilitySourceFiles, defaultSecurityManager); - ClassLoader compatibilityClassLoader; - if( classLoaderCache.contains( compatibilityTarget ) ){ + if(!compatibilityTarget.startsWith(cbtHome)){ compatibilityClassLoader = classLoaderCache.get( compatibilityTarget ); } else { - compatibilityClassLoader = classLoaderCache.put( classLoader(compatibilityTarget, rootClassLoader), compatibilityTarget ); + List<File> compatibilitySourceFiles = new ArrayList<File>(); + for( File f: compatibilitySources.listFiles() ){ + if( f.isFile() && (f.toString().endsWith(".scala") || f.toString().endsWith(".java")) ){ + compatibilitySourceFiles.add(f); + } + } + changed = compile(changed, start, "", compatibilityTarget, earlyDeps, compatibilitySourceFiles, defaultSecurityManager); + + if( classLoaderCache.contains( compatibilityTarget ) ){ + compatibilityClassLoader = classLoaderCache.get( compatibilityTarget ); + } else { + compatibilityClassLoader = classLoaderCache.put( classLoader(compatibilityTarget, rootClassLoader), compatibilityTarget ); + } } String[] nailgunClasspathArray = append( earlyDeps.classpathArray, nailgunTarget ); |