Skip to content

Commit 77a1aa5

Browse files
committed
CHANGED: collect all system properties to send to CoRB
Rather than only selecting the system properties that match known CoRB option names, collect all system properties and pass to CoRB. This allows for xcc.httpcompliant to be set, as well as any custom inputs (e.g. PROCESS-MODULE.foo, URIS-MODULE.bar, etc). Resolves issue #146 and issue #128
1 parent d908740 commit 77a1aa5

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/main/groovy/com/marklogic/gradle/task/CorbTask.groovy

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ XML-FILE,XML-NODE\
3232
XQUERY-MODULE".tokenize(',')
3333

3434
CorbTask() {
35-
String[] optionNames = DEFAULT_CORB_OPTIONS
35+
String[] optionNames = DEFAULT_CORB_OPTIONS
3636
try {
3737
optionNames = Class.forName("com.marklogic.developer.corb.Options", true, Thread.currentThread().contextClassLoader)
3838
.declaredFields
3939
.findAll { !it.synthetic }.collect { it.get(null) }
4040
} catch (ClassNotFoundException ex) {}
41-
42-
//Augment with member variables and a mapping of CoRB2 Options
41+
42+
//Augment with member variables and a mapping of CoRB2 Options
4343
CorbTask.metaClass.corbOptions = optionNames.collectEntries { option ->
44-
44+
4545
String camelOption = option.toLowerCase().split('_|-').collect { it.capitalize() }.join('')
4646
// create Map entry gradle property and original values, for easy lookup/translation
4747
String lowerCamelOption = new StringBuffer(camelOption.length())
@@ -77,7 +77,7 @@ XQUERY-MODULE".tokenize(',')
7777
@TaskAction
7878
@Override
7979
public void exec() {
80-
//By convention, if there is a corb configuration, use it to set the classpath
80+
//By convention, if there is a corb configuration, use it to set the classpath
8181
if (getProject().configurations.findByName('corb')) {
8282
setClasspath(getProject().configurations.corb)
8383
}
@@ -162,11 +162,13 @@ XQUERY-MODULE".tokenize(',')
162162
}
163163

164164
/**
165-
* Find all CoRB2 System.properties
166-
* @return Map of CoRB2 options
165+
* Collect all System.properties. This allows for any CoRB option to be set, including those not statically known such
166+
* as CoRB custom inputs (e.g. URIS-MODULE.foo, PROCESS-MODULE.bar, etc) as well as settings for other libraries, such
167+
* as xcc.httpCompliant to enable XCCS compatability for XCC.
168+
* @return all System.properties
167169
*/
168170
public Map collectSystemProperties() {
169-
System.properties.findAll { corbOptions.containsValue(it.key) }
171+
System.properties
170172
}
171173

172174
/**
@@ -179,5 +181,5 @@ XQUERY-MODULE".tokenize(',')
179181
[(corbOptions[it]): project[it]]
180182
}
181183
}
182-
184+
183185
}

0 commit comments

Comments
 (0)