16
16
package org.grails.web.pages
17
17
18
18
import org.codehaus.groovy.control.CompilerConfiguration
19
+ import org.grails.config.CodeGenConfig
19
20
import org.grails.gsp.compiler.GroovyPageCompiler
20
21
import groovy.io.FileType
21
22
import org.codehaus.groovy.control.CompilationUnit
@@ -47,6 +48,7 @@ public class GroovyPageCompilerForkTask {
47
48
String serverpath
48
49
String encoding
49
50
String targetCompatibility
51
+ String [] configs
50
52
51
53
GroovyPageCompilerForkTask (File sourceDir , File destDir , File tmpdir ) {
52
54
this . tmpdir = tmpdir
@@ -58,6 +60,13 @@ public class GroovyPageCompilerForkTask {
58
60
GroovyPageCompiler createPageCompiler () {
59
61
GroovyPageCompiler compiler = new GroovyPageCompiler ()
60
62
CompilerConfiguration config = new CompilerConfiguration ()
63
+
64
+
65
+ if (configs) {
66
+ String configPaths = configs. collect{new File (it)}. findAll{it. exists()}?. collect{it. canonicalPath}. toArray()
67
+ compiler. setConfigs(configPaths)
68
+ }
69
+
61
70
if (classpath) {
62
71
config. classpath = classpath. toString()
63
72
}
@@ -114,12 +123,16 @@ Usage: java -cp CLASSPATH GroovyPageCompilerForkTask [srcDir] [destDir] [tmpDir]
114
123
String targetCompatibility = args[3 ]
115
124
String packageName = args[4 ]. trim()
116
125
String serverpath = args[5 ]
126
+ String [] configFiles = args[6 ]. tokenize(' ,' )
117
127
File configFile = new File (args[6 ])
118
128
String encoding = args[7 ] ?: ' UTF-8'
119
129
120
130
121
- // configuration.readConfiguration(configFile)
131
+
122
132
GroovyPageCompilerForkTask compiler = new GroovyPageCompilerForkTask (srcDir,destinationDir,tmpDir)
133
+ if (configFiles) {
134
+ compiler. configs = configFiles
135
+ }
123
136
if (packageName) {
124
137
compiler. packageName = packageName
125
138
}
0 commit comments