Make it so mapping files are used and then reapplied.
[SquirrelJME.git] / modules / cldc-compact / build.gradle
blob8af62a201faec1fd93a027386d5eefc526cf95d9
1 import cc.squirreljme.plugin.swm.JavaMEConfiguration
2 import cc.squirreljme.plugin.swm.JavaMEMidletType
4 // Setup plugins
5 plugins
7         id "java"
10 version = "1.8.$squirreljmeVMVersion"
11 description = "This is the standard JavaME 8 Connection " +
12         "Limited Device Configuration which contains the core classes used " +
13         "by Java ME."
15 squirreljme
17         javaDocErrorCode = "ZZ"
18         swmType = JavaMEMidletType.API
19         swmName = "Connection Limited Device Configuration (Compact)"
20         swmVendor = "Stephanie Gawroriski"
21         definedConfigurations += new JavaMEConfiguration("CLDC-1.8-Compact")
22         definedConfigurations += new JavaMEConfiguration("CLDC-1.1.1")
23         definedConfigurations += new JavaMEConfiguration("CLDC-1.1")
24         definedConfigurations += new JavaMEConfiguration("CLDC-1.0")
25         tags += "required"
26         tags += "lite"
27         noEmitConfiguration = true
28         
29         // Needed for SquirrelJME VMs to start and operate properly, as this is
30         // the entry point into any code that starts and otherwise
31         proGuardOptions += ["-keep", "class", "java.lang.__Start__"]
32         proGuardOptions += ["-keepnames", "class", "java.lang.__Start__"]
33         proGuardOptions += ["-keepclassmembers", "class", 
34                 "java.lang.__Start__", "{",
35                         "void", "__base", "(", ")", ";",
36                         "void", "__main", "(", ")", ";",
37                 "}"]
38         proGuardOptions += ["-keepclassmembernames", "class",
39                 "java.lang.__Start__", "{",
40                         "void", "__base", "(", ")", ";",
41                         "void", "__main", "(", ")", ";",
42                 "}"]
43         
44         // There are some hidden fields in Thread that need to be kept
45         proGuardOptions += ["-keepclassmembers", "class",
46                 "java.lang.Thread", "{",
47                         "boolean", "_started", ";",
48                         "boolean", "_isAlive", ";",
49                         "boolean", "_interrupted", ";",
50                         "java.lang.Runnable", "_runnable", ";",
51                         "cc.squirreljme.jvm.mle.brackets.VMThreadBracket", "_vmThread",
52                                 ";",
53                 "}"]
54         proGuardOptions += ["-keepclassmembernames", "class",
55                 "java.lang.Thread", "{",
56                         "boolean", "_started", ";",
57                         "boolean", "_isAlive", ";",
58                         "boolean", "_interrupted", ";",
59                         "java.lang.Runnable", "_runnable", ";",
60                         "cc.squirreljme.jvm.mle.brackets.VMThreadBracket", "_vmThread",
61                                 ";",
62                 "}"]
63         
64         // Throwable has the internal stack trace
65         proGuardOptions += ["-keepclassmembers", "class",
66                 "java.lang.Throwable", "{",
67                         "cc.squirreljme.jvm.mle.brackets.TracePointBracket[]",
68                                 "_stack", ";",
69                 "}"]
70         proGuardOptions += ["-keepclassmembernames", "class",
71                 "java.lang.Throwable", "{",
72                         "cc.squirreljme.jvm.mle.brackets.TracePointBracket[]",
73                                 "_stack", ";",
74                 "}"]
75         
76         // Class has hidden fields that are directly accessed
77         proGuardOptions += ["-keepclassmembers", "class",
78                 "java.lang.Class", "{",
79                         "cc.squirreljme.jvm.mle.brackets.TypeBracket", "_type", ";",
80                 
81                         // Constructor used internally
82                         "Class", "(", "cc.squirreljme.jvm.mle.brackets.TypeBracket",
83                                 ")", ";",
84                 "}"]
85         proGuardOptions += ["-keepclassmembernames", "class",
86                 "java.lang.Class", "{",
87                         "cc.squirreljme.jvm.mle.brackets.TypeBracket", "_type", ";",
88                 "}"]
89         
90         // Integer's value is directly accessed as an optimization
91         proGuardOptions += ["-keepclassmembers", "class",
92                 "java.lang.Integer", "{",
93                         "int", "_value", ";",
94                 "}"]
95         proGuardOptions += ["-keepclassmembernames", "class",
96                 "java.lang.Integer", "{",
97                         "int", "_value", ";",
98                 "}"]
99         
100         // This is considered a boot loader for SummerCoat
101         isBootLoader = true
102         bootLoaderMainClass = "cc.squirreljme.jvm.summercoat.Bootstrap"
105 java
107         // No classes are available for this project
108         compileJava.options.bootstrapClasspath = project.objects.fileCollection()
111 dependencies