1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 20:12:07 +01:00

Only call SimpleDataFormat once in build.gradle

re-use ext.buildDate
This commit is contained in:
Florian Schmaus 2014-07-25 19:47:55 +02:00
parent 3634587933
commit 6b7fa4a788

View file

@ -17,6 +17,9 @@ allprojects {
signingRequired = isReleaseVersion signingRequired = isReleaseVersion
sonatypeSnapshotUrl = 'https://oss.sonatype.org/content/repositories/snapshots' sonatypeSnapshotUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
sonatypeStagingUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2' sonatypeStagingUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
// Returns only the date in yyyy-MM-dd format, as otherwise, with
// hh:mm:ss information, the manifest files would change with every
// build, causing unnecessary rebuilds.
buildDate = (new java.text.SimpleDateFormat("yyyy-MM-dd")).format(new Date()) buildDate = (new java.text.SimpleDateFormat("yyyy-MM-dd")).format(new Date())
oneLineDesc = 'An Open Source XMPP (Jabber) client library' oneLineDesc = 'An Open Source XMPP (Jabber) client library'
jxmppVersion = "0.2.0" jxmppVersion = "0.2.0"
@ -37,7 +40,7 @@ allprojects {
// For example 4.0.0-rc1 becomes 4.0.0.rc1, but // For example 4.0.0-rc1 becomes 4.0.0.rc1, but
// 4.0.0-SNAPSHOT-2014-05-01 becomes 4.0.0.SNAPSHOT-2014-05-01 // 4.0.0-SNAPSHOT-2014-05-01 becomes 4.0.0.SNAPSHOT-2014-05-01
'Bundle-Version': version.replaceFirst("-", "."), 'Bundle-Version': version.replaceFirst("-", "."),
'Built-Date': getDatestamp(), 'Built-Date': ext.buildDate,
'Built-JDK': System.getProperty('java.version'), 'Built-JDK': System.getProperty('java.version'),
'Built-Gradle': gradle.gradleVersion, 'Built-Gradle': gradle.gradleVersion,
'Built-By': System.getProperty('user.name') 'Built-By': System.getProperty('user.name')
@ -250,11 +253,3 @@ def getGitCommit() {
assert !gitCommit.isEmpty() assert !gitCommit.isEmpty()
gitCommit gitCommit
} }
// Returns only the date in yyyy-MM-dd format, as otherwise, with
// hh:mm:ss information, the manifest files would change with every
// build, causing unnecessary rebuilds.
def getDatestamp() {
def date = new Date()
return date.format('yyyy-MM-dd')
}