diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2017-03-20 22:09:38 -0400 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2017-03-27 19:56:13 -0400 |
commit | bba2abe7ee38b8903822a07578c46466923d13ed (patch) | |
tree | a357fb8def6f58a9ea9a37411f3f5640dcb525fe /nailgun_launcher/NailgunLauncher.java | |
parent | d2f8cade709b7d55a93e18592b6e38247d648ca9 (diff) | |
download | cbt-bba2abe7ee38b8903822a07578c46466923d13ed.tar.gz cbt-bba2abe7ee38b8903822a07578c46466923d13ed.tar.bz2 cbt-bba2abe7ee38b8903822a07578c46466923d13ed.zip |
start modularizing cbt into libraries
this extracts certain parts of cbt into stand-alone libraries, which can
be published to maven and used outside of cbt.
This also adds scalariform for these parts of the code.
This slows down cbt’s own build a lot because of the number of projects
involved! So we’ll follow this by a bunch of performance tweak commits.
Diffstat (limited to 'nailgun_launcher/NailgunLauncher.java')
-rw-r--r-- | nailgun_launcher/NailgunLauncher.java | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/nailgun_launcher/NailgunLauncher.java b/nailgun_launcher/NailgunLauncher.java index fe9f27f..1c6f3b5 100644 --- a/nailgun_launcher/NailgunLauncher.java +++ b/nailgun_launcher/NailgunLauncher.java @@ -5,6 +5,7 @@ import java.net.*; import java.security.*; import java.util.*; import static cbt.Stage0Lib.*; +import cbt.reflect.TrapSystemExit; import static java.io.File.pathSeparator; import java.nio.file.*; import static java.nio.file.Files.write; @@ -66,7 +67,7 @@ public class NailgunLauncher{ return; } - System.setSecurityManager( new TrapSecurityManager() ); + System.setSecurityManager( TrapSystemExit.createSecurityManager(initialSecurityManager) ); installProxySettings(); String[] diff = args[0].split("\\."); long start = _start - (Long.parseLong(diff[0]) * 1000L) - Long.parseLong(diff[1]); @@ -146,7 +147,7 @@ public class NailgunLauncher{ String nailgunTarget = nailgunSources + TARGET; String stage1Sources = cbtHome + "/" + STAGE1; String stage1Target = stage1Sources + TARGET; - File compatibilitySources = new File(cbtHome + "/compatibility"); + String compatibilitySources = cbtHome + "/compatibility"; String mavenCache = cache + "maven"; String mavenUrl = "https://repo1.maven.org/maven2"; File loopFile = new File(cwd + "/target/.cbt-loop.tmp"); @@ -171,9 +172,14 @@ public class NailgunLauncher{ compatibilityLastModified = new File( compatibilityTarget + "../classes.last-success" ).lastModified(); } else { compatibilitySourceFiles = new ArrayList<File>(); - for( File f: compatibilitySources.listFiles() ){ - if( f.isFile() && f.toString().endsWith(".java") ){ - compatibilitySourceFiles.add(f); + for( String d: new String[]{ + compatibilitySources, + cbtHome + "/libraries/interfaces" + } ){ + for( File f: new File(d).listFiles() ){ + if( f.isFile() && f.toString().endsWith(".java") ){ + compatibilitySourceFiles.add(f); + } } } @@ -206,9 +212,16 @@ public class NailgunLauncher{ String stage1Classpath = classpath( stage1ClasspathArray ); stage1SourceFiles = new ArrayList<File>(); - for( File f: new File(stage1Sources).listFiles() ){ - if( f.isFile() && f.toString().endsWith(".scala") ){ - stage1SourceFiles.add(f); + for( String d: new String[]{ + stage1Sources, + cbtHome + "/libraries/reflect", + cbtHome + "/libraries/common-1", + cbtHome + "/libraries/file" + } ){ + for( File f: new File(d).listFiles() ){ + if( f.isFile() && (f.toString().endsWith(".scala") || f.toString().endsWith(".java")) ){ + stage1SourceFiles.add(f); + } } } |