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().resolve("src").resolve("main"),
39 System.mapLibraryName("emulator-base"),
42 Provider<MimeDecodeResourcesTask> mimeDecode =tasks.register(
43 "mimeDecode", MimeDecodeResourcesTask.class,
45 tasks.named("processResources").get(),
46 tasks.named("clean").get())
48 processResources.dependsOn(mimeDecode)
49 processResources.dependsOn(libNativeEmulatorBase)
51 jar.dependsOn(mimeDecode)
53 compileJava.dependsOn(libNativeEmulatorBase)
55 mimeDecode.get().dependsOn(libNativeEmulatorBase)
57 // We need the native library in the JAR before we can properly use it
58 // But we can compile the Java code just fine without it
60 dependsOn libNativeEmulatorBase
62 from libNativeEmulatorBase.get().cmakeOutFile.toFile()
67 // Use a fixed version of the JVM
70 sourceCompatibility = JavaVersion.VERSION_1_8
71 targetCompatibility = JavaVersion.VERSION_1_8
73 // Use the default bootstrap classpath
74 options.bootstrapClasspath = null
78 compileJava.options.debug = true
79 compileJava.options.debugOptions.setDebugLevel("source,lines,vars")
82 compileTestJava.options.debug = compileJava.options.debug
83 compileTestJava.options.debugOptions = compileJava.options.debugOptions
85 javadoc.options.tags = [ "squirreljme.property",
88 "squirreljme.syscallparam",
89 "squirreljme.syscallreturn",
90 "squirreljme.tsiparam",
91 "squirreljme.configtype",
92 "squirreljme.uiwidgetparam" ]