File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ compileClojure {
20
20
// If projectOnly is true, only warnings from your project are errors.
21
21
}
22
22
23
+ // Compiler options for AOT
24
+ disableLocalsClearing = true // Defaults to false
25
+ elideMeta = ['doc', 'file', 'line', 'added'] // Defaults to []
26
+ directLinking = true // Defaults to false
27
+
23
28
// compileClojure implements the standard JavaForkOptions interface, and thus supports the
24
29
// standard Gradle mechanisms for configuring a Java process:
25
30
// systemProperty systemProperties minHeapSize maxHeapSize
@@ -41,6 +46,7 @@ compileTestClojure {
41
46
testClojure {
42
47
// Standard JVM execution options here for test process
43
48
systemProperty 'java.awt.headless', true
49
+
44
50
// Specifying junitReport will trigger JUnit XML report generation
45
51
// in addition to standard console output (turned off by default)
46
52
junitReport = file("$buildDir/reports/junit-report.xml")
Original file line number Diff line number Diff line change @@ -193,6 +193,10 @@ open class ClojureCompiler @Inject constructor(val fileResolver: FileResolver) :
193
193
var copySourceToOutput: Boolean? = null
194
194
var reflectionWarnings = ReflectionWarnings (false , false , false )
195
195
196
+ var disableLocalsClearing: Boolean = false
197
+ var elideMeta: Collection <String > = emptyList()
198
+ var directLinking: Boolean = false
199
+
196
200
var namespaces: Collection <String > = emptyList()
197
201
198
202
fun reflectionWarnings (configureClosure : Closure <Any ?>? ): ReflectionWarnings {
@@ -225,7 +229,10 @@ open class ClojureCompiler @Inject constructor(val fileResolver: FileResolver) :
225
229
226
230
val script = listOf (" (try" ,
227
231
" (binding [*compile-path* \" ${destinationDir.canonicalPath} \" " ,
228
- " *warn-on-reflection* ${reflectionWarnings.enabled} ]" ,
232
+ " *warn-on-reflection* ${reflectionWarnings.enabled} " ,
233
+ " *compiler-options* {:disable-locals-clearing $disableLocalsClearing " ,
234
+ " :elide-meta [${elideMeta.map { " :$it " }.joinToString(" " )} ]" ,
235
+ " :direct-linking $directLinking }]" ,
229
236
" " + namespaces.map { " (compile '$it )" }.joinToString(" \n " ) + " )" ,
230
237
" (catch Throwable e" ,
231
238
" (.printStackTrace e)" ,
You can’t perform that action at this time.
0 commit comments