mirror of
https://github.com/TotalFreedomMC/TotalFreedomMod.git
synced 2025-08-06 04:23:09 +00:00
start working on build.properties
This commit is contained in:
parent
431bff1b75
commit
2eccb30731
1 changed files with 27 additions and 2 deletions
27
build.gradle
27
build.gradle
|
@ -120,6 +120,30 @@ bukkit {
|
||||||
'WorldGuard', 'WorldGuardExtraFlags', 'TFGuilds', 'JDA', 'Votifier']
|
'WorldGuard', 'WorldGuardExtraFlags', 'TFGuilds', 'JDA', 'Votifier']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static def getDate() {
|
||||||
|
return new Date().format('MM/dd/yyyy HH:mm')
|
||||||
|
}
|
||||||
|
|
||||||
|
def getGitHash() {
|
||||||
|
def stdout = new ByteArrayOutputStream()
|
||||||
|
exec {
|
||||||
|
commandLine 'git', 'rev-parse', '--short', 'HEAD'
|
||||||
|
standardOutput = stdout
|
||||||
|
}
|
||||||
|
return stdout.toString().trim()
|
||||||
|
}
|
||||||
|
|
||||||
|
task buildProperties(type: WriteProperties) {
|
||||||
|
// I know I'm supposed to use {project.rootDir} but I have no idea how to make it work
|
||||||
|
outputFile = file('/src/main/resources/build.properties')
|
||||||
|
property 'buildDate', getDate()
|
||||||
|
// make it not reset to unknown every time
|
||||||
|
property 'buildAuthor', 'Ember'
|
||||||
|
property 'buildCodeName', 'Ember'
|
||||||
|
property 'buildHead', getGitHash()
|
||||||
|
// buildNumber
|
||||||
|
}
|
||||||
|
|
||||||
shadowJar {
|
shadowJar {
|
||||||
shadowJar {
|
shadowJar {
|
||||||
archiveBaseName.set('TotalFreedomMod')
|
archiveBaseName.set('TotalFreedomMod')
|
||||||
|
@ -146,12 +170,13 @@ shadowJar {
|
||||||
processResources {
|
processResources {
|
||||||
filesMatching('**/gradle.properties') {
|
filesMatching('**/gradle.properties') {
|
||||||
filter {
|
filter {
|
||||||
it.replace('version', {version})
|
it.replace('version', { version })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.build.dependsOn tasks.shadowJar
|
tasks.build.dependsOn tasks.shadowJar
|
||||||
|
tasks.build.dependsOn tasks.buildProperties
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue