public class JavacServer extends Object
This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
Modifier and Type | Method and Description |
---|---|
void |
addBuildTime(long inc)
Sum up the total build time for this javac server.
|
static void |
cleanup(String... args) |
static SysInfo |
connectGetSysInfo(String serverSettings,
PrintStream out,
PrintStream err)
Make a request to the server only to get the maximum possible heap size to use for compilations.
|
void |
flushLog()
Make sure the log is flushed.
|
void |
log(String msg)
Log this message.
|
static int |
startServer(String settings,
PrintStream err)
Start a server using a settings string.
|
static int |
useServer(String settings,
String[] args,
Set<URI> sourcesToCompile,
Set<URI> visibleSources,
Map<URI,Set<String>> visibleClasses,
Map<String,Set<URI>> packageArtifacts,
Map<String,Set<String>> packageDependencies,
Map<String,String> packagePubapis,
SysInfo sysinfo,
PrintStream out,
PrintStream err)
Dispatch a compilation request to a javac server.
|
public void addBuildTime(long inc)
public void log(String msg)
public void flushLog()
public static int startServer(String settings, PrintStream err)
public static int useServer(String settings, String[] args, Set<URI> sourcesToCompile, Set<URI> visibleSources, Map<URI,Set<String>> visibleClasses, Map<String,Set<URI>> packageArtifacts, Map<String,Set<String>> packageDependencies, Map<String,String> packagePubapis, SysInfo sysinfo, PrintStream out, PrintStream err)
args
- are the command line args to javac and is allowed to contain source files, @file and other command line options to javac.
The generated classes, h files and other artifacts from the javac invocation are stored by the javac server to disk.sources_to_compile
- The sources to compile.visibleSources
- If visible sources has a non zero size, then visible_sources are the only files in the file system that the javac server can see!
(Sources to compile are always visible.) The visible sources are those supplied by the (filtered) -sourcepathvisibleClasses
- If visible classes for a specific root/jar has a non zero size, then visible_classes are the only class files that the javac server
can see, in that root/jar. It maps from a classpath root or a jar file to the set of visible classes for that root/jar.
The server return meta data about the build in the following parameters.package_artifacts,
- map from package name to set of created artifacts for that package.package_dependencies,
- map from package name to set of packages that it depends upon.package_pubapis,
- map from package name to unique string identifying its pub api.public static SysInfo connectGetSysInfo(String serverSettings, PrintStream out, PrintStream err)
port_file
- The port file used to synchronize creation of this server.id
- The identify of the compilation.out
- Standard out information.err
- Standard err information.public static void cleanup(String... args)
Copyright © 2017 earcam. All rights reserved.