1 import cc.squirreljme.plugin.swm.JavaMEConfiguration
2 import cc.squirreljme.plugin.swm.JavaMEMidletType
10 version = "1.8.$squirreljmeVMVersion"
11 description = "This is the standard JavaME 8 Connection " +
12 "Limited Device Configuration which contains the core classes used " +
17 javaDocErrorCode = "ZZ"
18 swmType = JavaMEMidletType.API
19 swmName = "Connected 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")
27 noEmitConfiguration = true
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", "(", ")", ";",
38 proGuardOptions += ["-keepclassmembernames", "class",
39 "java.lang.__Start__", "{",
40 "void", "__base", "(", ")", ";",
41 "void", "__main", "(", ")", ";",
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",
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",
64 // Throwable has the internal stack trace
65 proGuardOptions += ["-keepclassmembers", "class",
66 "java.lang.Throwable", "{",
67 "cc.squirreljme.jvm.mle.brackets.TracePointBracket[]",
70 proGuardOptions += ["-keepclassmembernames", "class",
71 "java.lang.Throwable", "{",
72 "cc.squirreljme.jvm.mle.brackets.TracePointBracket[]",
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", ";",
81 // Constructor used internally
82 "Class", "(", "cc.squirreljme.jvm.mle.brackets.TypeBracket",
85 proGuardOptions += ["-keepclassmembernames", "class",
86 "java.lang.Class", "{",
87 "cc.squirreljme.jvm.mle.brackets.TypeBracket", "_type", ";",
90 // String information that needs to be kept
91 proGuardOptions += ["-keepclassmembers", "class",
92 "java.lang.String", "{",
93 "char[]", "_chars", ";",
94 "int", "_hashCode", ";",
96 proGuardOptions += ["-keepclassmembernames", "class",
97 "java.lang.String", "{",
98 "char[]", "_chars", ";",
99 "int", "_hashCode", ";",
102 // Prevent certain java.lang.Boolean optimizations
103 proGuardOptions += ["-keepclassmembers,includecode", "class",
104 "java.lang.Boolean", "{",
105 "java.lang.Boolean", "TRUE", ";",
106 "java.lang.Boolean", "FALSE", ";",
107 "boolean", "_value", ";",
108 "void", "<clinit>", "(", ")", ";",
109 "java.lang.Boolean", "valueOf", "(", "boolean", ")", ";",
111 proGuardOptions += ["-keepclassmembernames", "class",
112 "java.lang.Boolean", "{",
113 "boolean", "_value", ";",
116 // Prevent certain java.lang.Character optimizations
117 proGuardOptions += ["-keepclassmembers,includecode", "class",
118 "java.lang.Character", "{",
119 "char", "_value", ";",
120 "java.lang.Character", "valueOf", "(", "char", ")", ";",
122 proGuardOptions += ["-keepclassmembernames", "class",
123 "java.lang.Character", "{",
124 "char", "_value", ";",
127 // Prevent certain java.lang.Byte optimizations
128 proGuardOptions += ["-keepclassmembers,includecode", "class",
129 "java.lang.Byte", "{",
130 "byte", "_value", ";",
131 "java.lang.Byte", "valueOf", "(", "byte", ")", ";",
133 proGuardOptions += ["-keepclassmembernames", "class",
134 "java.lang.Byte", "{",
135 "byte", "_value", ";",
138 // Prevent certain java.lang.Short optimizations
139 proGuardOptions += ["-keepclassmembers,includecode", "class",
140 "java.lang.Short", "{",
141 "short", "_value", ";",
142 "java.lang.Short", "valueOf", "(", "short", ")", ";",
144 proGuardOptions += ["-keepclassmembernames", "class",
145 "java.lang.Short", "{",
146 "short", "_value", ";",
149 // Prevent certain java.lang.Integer optimizations
150 proGuardOptions += ["-keepclassmembers,includecode", "class",
151 "java.lang.Integer", "{",
152 "int", "_value", ";",
153 "java.lang.Integer", "valueOf", "(", "int", ")", ";",
155 proGuardOptions += ["-keepclassmembernames", "class",
156 "java.lang.Integer", "{",
157 "int", "_value", ";",
160 // Prevent certain java.lang.Long optimizations
161 proGuardOptions += ["-keepclassmembers,includecode", "class",
162 "java.lang.Long", "{",
163 "long", "_value", ";",
164 "java.lang.Long", "valueOf", "(", "long", ")", ";",
166 proGuardOptions += ["-keepclassmembernames", "class",
167 "java.lang.Long", "{",
168 "long", "_value", ";",
171 // Prevent certain java.lang.Float optimizations
172 proGuardOptions += ["-keepclassmembers,includecode", "class",
173 "java.lang.Float", "{",
174 "float", "_value", ";",
175 "java.lang.Float", "valueOf", "(", "float", ")", ";",
177 proGuardOptions += ["-keepclassmembernames", "class",
178 "java.lang.Float", "{",
179 "float", "_value", ";",
182 // Prevent certain java.lang.Double optimizations
183 proGuardOptions += ["-keepclassmembers,includecode", "class",
184 "java.lang.Double", "{",
185 "double", "_value", ";",
186 "java.lang.Double", "valueOf", "(", "double", ")", ";",
188 proGuardOptions += ["-keepclassmembernames", "class",
189 "java.lang.Double", "{",
190 "double", "_value", ";",
193 // Prevent software math methods from being changed, these are called
195 // Optimizing this method seems to break the launcher somehow...
196 proGuardOptions += ["-keepclassmembers,includecode",
197 "class", "cc.squirreljme.jvm.launch.SuiteScanner", "{",
198 "cc.squirreljme.jvm.launch.AvailableSuites", "scanSuites", "(",
200 "cc.squirreljme.jvm.launch.AvailableSuites", "scanSuites", "(",
201 "cc.squirreljme.jvm.launch.SuiteScanListener", ")", ";",
204 // Keep this and do not optimize it out, otherwise it breaks the launcher
205 // and stops it from working
206 proGuardOptions += ["-keep,allowobfuscation",
207 "class", "cc.squirreljme.jvm.launch.SuiteScanListener"]
208 proGuardOptions += ["-keepclassmembers,allowobfuscation",
209 "class", "cc.squirreljme.jvm.launch.SuiteScanListener", "{",
210 "void", "scanned", "(",
211 "cc.squirreljme.jvm.launch.Application", ",",
217 // The test method that takes 255 arguments completely breaks ProGuard
218 // so disable optimizations for it
219 proGuardOptionsTest += ["-keep", "class",
220 "lang.bytecode.TestInvoke255"]
221 proGuardOptionsTest += ["-keepnames", "class",
222 "lang.bytecode.TestInvoke255"]
223 proGuardOptionsTest += ["-keep,includecode",
224 "class", "lang.bytecode.TestInvoke255", "{",
230 // This is considered a boot loader for SummerCoat
232 bootLoaderMainClass = "cc.squirreljme.jvm.summercoat.Bootstrap"
237 // No classes are available for this project
238 compileJava.options.bootstrapClasspath = project.objects.fileCollection()
243 // For IDE related information
244 api "org.jetbrains:annotations:24.0.1"