MCPcopy Create free account
hub / github.com/SquirrelJME/SquirrelJME / __compileStep

Method __compileStep

NewBootstrap.java:1009–1236  ·  view source on GitHub ↗

Secondary compilation step. @param __deps Dependencies used. @throws IOException On read/write errors. @throws NullPointerException On null arguments. @since 2016/10/27

(Set<BuildProject> __deps)

Source from the content-addressed store, hash-verified

1007 * @since 2016/10/27
1008 */
1009 private void __compileStep(Set<BuildProject> __deps)
1010 throws IOException, NullPointerException
1011 {
1012 // Check
1013 if (__deps == null)
1014 throw new NullPointerException("NARG");
1015
1016 // Best dependency date
1017 long depdate = Long.MIN_VALUE;
1018 for (BuildProject bp : __deps)
1019 depdate = Math.max(depdate, bp.binaryDate());
1020
1021 // Do not recompile if it is up to date
1022 long srcdate = sourcesDate(),
1023 bindate = binaryDate();
1024 Path jarout = this.jarout;
1025 if (Files.exists(jarout) && srcdate <= bindate &&
1026 bindate > depdate)
1027 return;
1028
1029 // {@squirreljme.error NB09 Now compiling the specified project.
1030 // (The name of the project being compiled)}
1031 String name = this.name;
1032 System.err.printf("NB09 %s%n", name);
1033
1034 // {@squirreljme.error NB07 No Java compiler is available through
1035 // the Java class library (javax.tools.JavaCompiler), you may need
1036 // to make sure that tools.jar is loaded into your classpath
1037 // either manually (although in most installations it should be
1038 // automatic).}
1039 JavaCompiler javac = NewBootstrap._javac;
1040 if (javac == null)
1041 {
1042 javac = ToolProvider.getSystemJavaCompiler();
1043 if (javac == null)
1044 throw new IllegalStateException("NB07");
1045 NewBootstrap._javac = javac;
1046 }
1047
1048 // Need to clear files
1049 Path tempdir = null;
1050 try
1051 {
1052 // Create temporary directory
1053 tempdir = Files.createTempDirectory(
1054 "squirreljme-build-" + name);
1055
1056 // Source code is just this project
1057 final Path basepath = this.basepath;
1058
1059 // Get all source code to be compiled
1060 final Set<File> fsources = new LinkedHashSet<>();
1061 NewBootstrap.<Object>__walk(basepath, null,
1062 new Consumer<Path, Object, IOException>()
1063 {
1064 /**
1065 * {@inheritDoc}
1066 * @since 2016/10/27

Callers 1

compileMethod · 0.95

Calls 15

maxMethod · 0.95
binaryDateMethod · 0.95
sourcesDateMethod · 0.95
existsMethod · 0.95
createTempDirectoryMethod · 0.95
__walkMethod · 0.95
asListMethod · 0.95
formatMethod · 0.95
getParentMethod · 0.95
createDirectoriesMethod · 0.95
createTempFileMethod · 0.95
newOutputStreamMethod · 0.95

Tested by

no test coverage detected