1 import cc.squirreljme.plugin.general.cmake.CMakeBuildTask
2 import cc.squirreljme.plugin.tasks.MimeDecodeResourcesTask
4 import java.nio.file.Files
5 import java.nio.file.Paths
6 import java.nio.file.StandardOpenOption
7 import java.util.concurrent.TimeUnit
8 import java.util.regex.Pattern
15 description = "This library provides the base support for testing and " +
16 "running SquirrelJME on a Java SE host, which is normally not " +
17 "capable of doing as such."
19 // Due to the combination of C++ and Java these dependencies have to be very
20 // specific in that they only refer to the Java or C++ portion. So
21 // "implementation" and "compile" cannot be used because the C++ library will
22 // try to use them during compilation.
25 api project(":modules:cldc-compact")
26 api project(":modules:common-vm")
27 api project(":modules:io")
28 api project(":modules:tac")
29 api project(":modules:zip")
30 api project(":modules:debug-jdwp")
31 api project(":modules:debug-jdwp-vm-host")
34 // Native emulator support library
35 Provider<CMakeBuildTask> libNativeEmulatorBase = tasks.register(
36 "libNativeEmulatorBase",
38 project.getProjectDir().toPath().getParent()
39 .resolve("emulator-base-native"),
40 System.mapLibraryName("emulator-base"),
43 Provider<MimeDecodeResourcesTask> mimeDecode =tasks.register(
44 "mimeDecode", MimeDecodeResourcesTask.class,
46 tasks.named("processResources").get(),
47 tasks.named("clean").get())
49 processResources.dependsOn(mimeDecode)
50 processResources.dependsOn(libNativeEmulatorBase)
52 jar.dependsOn(mimeDecode)
54 compileJava.dependsOn(libNativeEmulatorBase)
56 mimeDecode.get().dependsOn(libNativeEmulatorBase)
58 // We need the native library in the JAR before we can properly use it
59 // But we can compile the Java code just fine without it
61 dependsOn libNativeEmulatorBase
63 from libNativeEmulatorBase.get().cmakeOutFile.toFile()
68 // Use a fixed version of the JVM
71 sourceCompatibility = JavaVersion.VERSION_1_8
72 targetCompatibility = JavaVersion.VERSION_1_8
74 // Use the default bootstrap classpath
75 options.bootstrapClasspath = null
79 compileJava.options.debug = true
80 compileJava.options.debugOptions.setDebugLevel("source,lines,vars")
83 compileTestJava.options.debug = compileJava.options.debug
84 compileTestJava.options.debugOptions = compileJava.options.debugOptions
86 javadoc.options.tags = [ "squirreljme.property",
89 "squirreljme.syscallparam",
90 "squirreljme.syscallreturn",
91 "squirreljme.tsiparam",
92 "squirreljme.configtype",
93 "squirreljme.uiwidgetparam" ]