Created
December 15, 2013 04:21
-
-
Save lifuzu/7968831 to your computer and use it in GitHub Desktop.
Copying a file with keyword expansion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Copying a file with keyword expansion | |
versionId = '1.6' | |
task copyProductionConfig(type: Copy) { | |
from 'source' | |
include 'config.properties' | |
into 'build/war/WEB-INF/config' | |
expand([ | |
databaseHostname: 'db.company.com', | |
version: versionId, | |
buildNumber: (int)(Math.random() * 1000), | |
date: new Date() | |
]) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Application configuration file | |
# | |
hostname: db.company.com | |
appVersion: 1.6 | |
locale: en_us | |
initialConnections: 10 | |
transferThrottle: 5400 | |
queueTimeout: 30000 | |
buildNumber: 77 | |
buildDate 20120105T162959-0700 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Application configuration file | |
# | |
hostname: ${databaseHostname} | |
appVersion: ${version} | |
locale: en_us | |
initialConnections: 10 | |
transferThrottle: 5400 | |
queueTimeout: 30000 | |
buildNumber: ${buildNumber} | |
buildDate: ${date.format("yyyyMMdd'T'HHmmssZ")} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment