Skip to content

Commit 14c260f

Browse files
author
Rob Rudin
committed
#115 Example project for ignoring filenames
1 parent 7ce8391 commit 14c260f

File tree

6 files changed

+34
-0
lines changed

6 files changed

+34
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ examples/shell-project/.settings
3030
examples/shell-project/.project
3131
examples/shell-project/.classpath
3232
examples/minimal-project/.gradle
33+
examples/ignore-resources-project/.gradle/
3334
.idea
3435
*.iml
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
As of ml-gradle 2.6.0, you can set the mlResourceFilenamesToIgnore property to specify the names of all resource
2+
files to ignore. The build.gradle file shows an alternative to using this property, where a command is individually
3+
configured.
4+
5+
This feature is useful for when you need to ignore some resources in different environments - for example, a dev
6+
environment may require an additional database that's not needed in a production environment.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
plugins {
2+
id "com.marklogic.ml-gradle" version "2.6.0"
3+
}
4+
5+
ext {
6+
println mlAppDeployer.getCommand("DeployRolesCommand")
7+
8+
/**
9+
* Each command that extends the com.marklogic.appdeployer.command.AbstractCommand class has a setFilenamesToIgnore
10+
* method. You can pass in an array of strings to configure the resources to ignore for a particular command. This
11+
* is an alternative to using mlResourceFilenamesToIgnore.
12+
*/
13+
//mlAppDeployer.getCommand("DeployRolesCommand").setFilenamesToIgnore("role-2.json")
14+
15+
// Disabling creating of a REST API server, which isn't needed for this sample project
16+
// mlAppDeployer.getCommands().remove(mlAppDeployer.getCommand("DeployRestApiServersCommand"))
17+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Specify multiple filenames by delimiting them with commas, e.g. role-2.json,user-1.xml.
2+
# Remember that these filenames are ignored by all commands, so be careful if you have different resources with the
3+
# same filename (should be rare and easily avoided).
4+
mlResourceFilenamesToIgnore=role-2.json
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"role-name": "ml-gradle-example-role-1"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"role-name": "ml-gradle-example-role-2"
3+
}

0 commit comments

Comments
 (0)