Skip to content

Commit 9dd1fbe

Browse files
authored
Fix variable substitution (GoogleCloudPlatform#671)
Add pretty back in to give us variable substitution. This is really overkill, but I don’t want to fix all the substitution methods yet.
1 parent e3a391c commit 9dd1fbe

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

appengine-java8/bigtable/build.gradle

+22
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ buildscript { // Configuration for building
1919
}
2020
dependencies {
2121
classpath 'com.google.cloud.tools:appengine-gradle-plugin:1.3.1'
22+
classpath 'org.akhikhl.gretty:gretty:+'
2223
}
2324
}
2425

2526
apply plugin: 'java'
2627
apply plugin: 'war'
28+
apply plugin: 'org.akhikhl.gretty' // To get webappcopy
2729
apply plugin: 'com.google.cloud.tools.appengine'
2830

2931
group = 'com.example.google.cloud.bigtable'
@@ -55,6 +57,26 @@ dependencies {
5557
testCompile group: 'org.mockito', name: 'mockito-all', version:'1.10.19'
5658
}
5759

60+
import org.apache.tools.ant.filters.ReplaceTokens
61+
gretty {
62+
contextPath = '/'
63+
servletContainer = 'jetty9'
64+
65+
jvmArgs = [ '-DBIGTABLE_PROJECT=' + System.getProperty("bigtable.projectID"),
66+
'-DBIGTABLE_INSTANCE=' + System.getProperty("bigtable.instanceID")]
67+
68+
webappCopy {
69+
// Enable filtering on all xml files in WEB-INF
70+
filesMatching "**/WEB-INF/*.xml", { FileCopyDetails fileDetails ->
71+
logger.lifecycle 'File filtered: {}', fileDetails.path
72+
filter (ReplaceTokens, tokens: [
73+
'bigtable.projectID' : System.getProperty("bigtable.projectID"),
74+
'bigtable.instanceID': System.getProperty("bigtable.instanceID")
75+
])
76+
}
77+
}
78+
}
79+
5880
// Always run unit tests
5981
appengineDeploy.dependsOn test
6082

0 commit comments

Comments
 (0)