Skip to content

Commit 2edd146

Browse files
committed
#320 Now copying Roxy's properties.xml to the right place
1 parent 68c069a commit 2edd146

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

examples/roxy-project/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ buildscript {
44
jcenter()
55
}
66
dependencies {
7-
classpath "com.marklogic:ml-gradle:3.0.0"
7+
classpath "com.marklogic:ml-gradle:3.6.0"
88
}
99
}
1010

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<options xmlns="http://marklogic.com/appservices/search">
2+
<constraint name="title">
3+
<word>
4+
<element ns="" name="TITLE" />
5+
</word>
6+
</constraint>
7+
</options>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<properties xmlns="http://marklogic.com/rest-api">
2+
<debug>false</debug>
3+
</properties>

src/main/groovy/com/marklogic/gradle/task/roxy/RoxyMigrateFilesTask.groovy

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class RoxyMigrateFilesTask extends RoxyTask {
77

88
def roxyFolderMapping = [
99
"src" : "/root",
10-
"rest-api/config" : "/options",
10+
"rest-api/config/options" : "/options",
1111
"rest-api/ext" : "/services",
1212
"rest-api/transforms" : "/transforms"
1313
]
@@ -16,6 +16,7 @@ class RoxyMigrateFilesTask extends RoxyTask {
1616
void copyRoxyFiles() {
1717
if (getRoxyProjectPath()) {
1818
def baseDir = getAppConfig().getModulePaths().get(0)
19+
1920
roxyFolderMapping.each { k, v ->
2021
def sourcePath = getRoxyProjectPath() + "/" + k
2122
def sourceFolder = new File(sourcePath)
@@ -30,6 +31,17 @@ class RoxyMigrateFilesTask extends RoxyTask {
3031
println "Did not find Roxy source directory: " + sourcePath
3132
}
3233
}
34+
35+
// Check for REST properties file
36+
File configDir = new File(getRoxyProjectPath() + "/rest-api/config");
37+
if (configDir.exists() && configDir.isDirectory()) {
38+
File propertiesFile = new File(configDir, "properties.xml");
39+
if (propertiesFile.exists() && propertiesFile.isFile()) {
40+
File targetFile = new File(baseDir, "rest-properties.xml")
41+
println "Copying rest-api/config/properties.xml to " + targetFile
42+
FileUtils.copyFile(propertiesFile, targetFile)
43+
}
44+
}
3345
} else {
3446
printMissingPathMessage()
3547
}

0 commit comments

Comments
 (0)