From 9dd1fbe5a75fc643d2f02fa8c4addedeaa30136e Mon Sep 17 00:00:00 2001 From: Les Vogel Date: Wed, 17 May 2017 15:04:04 -0700 Subject: [PATCH] Fix variable substitution (#671) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- appengine-java8/bigtable/build.gradle | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/appengine-java8/bigtable/build.gradle b/appengine-java8/bigtable/build.gradle index dc8172c0f76..897788b1f2a 100644 --- a/appengine-java8/bigtable/build.gradle +++ b/appengine-java8/bigtable/build.gradle @@ -19,11 +19,13 @@ buildscript { // Configuration for building } dependencies { classpath 'com.google.cloud.tools:appengine-gradle-plugin:1.3.1' + classpath 'org.akhikhl.gretty:gretty:+' } } apply plugin: 'java' apply plugin: 'war' +apply plugin: 'org.akhikhl.gretty' // To get webappcopy apply plugin: 'com.google.cloud.tools.appengine' group = 'com.example.google.cloud.bigtable' @@ -55,6 +57,26 @@ dependencies { testCompile group: 'org.mockito', name: 'mockito-all', version:'1.10.19' } +import org.apache.tools.ant.filters.ReplaceTokens +gretty { + contextPath = '/' + servletContainer = 'jetty9' + + jvmArgs = [ '-DBIGTABLE_PROJECT=' + System.getProperty("bigtable.projectID"), + '-DBIGTABLE_INSTANCE=' + System.getProperty("bigtable.instanceID")] + + webappCopy { + // Enable filtering on all xml files in WEB-INF + filesMatching "**/WEB-INF/*.xml", { FileCopyDetails fileDetails -> + logger.lifecycle 'File filtered: {}', fileDetails.path + filter (ReplaceTokens, tokens: [ + 'bigtable.projectID' : System.getProperty("bigtable.projectID"), + 'bigtable.instanceID': System.getProperty("bigtable.instanceID") + ]) + } + } +} + // Always run unit tests appengineDeploy.dependsOn test