This commit is contained in:
Telesphoreo 2021-06-30 17:08:07 -05:00
parent b5137763b5
commit ab584a5693
3 changed files with 18 additions and 15 deletions

View file

@ -88,7 +88,7 @@ dependencies {
}
group = 'me.totalfreedom'
version = '7.0.0'
version = project.property('project.pluginVersion')
description = 'TotalFreedomMod'
java.sourceCompatibility = JavaVersion.VERSION_16
archivesBaseName = 'TotalFreedomMod-donotuse'
@ -96,7 +96,7 @@ archivesBaseName = 'TotalFreedomMod-donotuse'
bukkit {
main = 'me.totalfreedom.totalfreedommod.TotalFreedomMod'
apiVersion = '1.17'
version = '7.0.0'
version = project.property('project.pluginVersion')
description = 'Plugin for the Total Freedom server.'
authors = ['Madgeek1450', 'Prozza']
softDepend = ['BukkitTelnet', 'Essentials', 'CoreProtect', 'LibsDisguises', 'WorldEdit',
@ -120,13 +120,16 @@ 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', 'unknown'
property 'buildCodeName', 'Ember'
property 'buildAuthor', project.property('project.buildAuthor')
property 'buildCodeName', project.property('project.buildCodeName')
property 'buildHead', getGitHash()
// buildNumber
}
jar {
include('/src/main/resources/build.properties')
}
shadowJar {
shadowJar {
archiveBaseName.set('TotalFreedomMod')
@ -150,16 +153,8 @@ shadowJar {
configurations = [project.configurations.compileClasspath]
}
processResources {
filesMatching('**/gradle.properties') {
filter {
it.replace('version', { version })
}
}
}
tasks.build.dependsOn tasks.shadowJar
tasks.build.dependsOn tasks.buildProperties
tasks.build.dependsOn tasks.shadowJar
publishing {
publications {

View file

@ -0,0 +1,8 @@
project.pluginVersion = 7.0.0
project.buildAuthor = unknown
project.buildCodeName = Ember
org.gradle.cache=true
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.jvmargs='-Dfile.encoding=UTF-8'

View file

@ -265,7 +265,7 @@ public class TotalFreedomMod extends JavaPlugin
number = props.getProperty("buildNumber", "1");
date = props.getProperty("buildDate", "unknown");
// Need to do this or it will display ${git.commit.id.abbrev}
head = props.getProperty("buildHead", "unknown").replace("${git.commit.id.abbrev}", "unknown");
head = props.getProperty("buildHead", "unknown");
}
catch (Exception ex)
{