mirror of
https://github.com/TotalFreedomMC/TotalFreedomMod.git
synced 2025-07-22 13:43:33 +00:00
Fix Gradle build so you don't have to have Git
This commit is contained in:
parent
22278822fe
commit
30fb1ebbd5
2 changed files with 23 additions and 12 deletions
2
.github/workflows/gradle.yml
vendored
2
.github/workflows/gradle.yml
vendored
|
@ -12,4 +12,4 @@ jobs:
|
||||||
with:
|
with:
|
||||||
java-version: 17
|
java-version: 17
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
run: chmod a+x gradlew && ./gradlew build -x buildProperties
|
run: chmod a+x gradlew && ./gradlew build
|
||||||
|
|
25
build.gradle
25
build.gradle
|
@ -3,6 +3,7 @@ plugins {
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
id 'idea'
|
id 'idea'
|
||||||
id 'checkstyle'
|
id 'checkstyle'
|
||||||
|
id "xyz.ronella.simple-git" version "1.3.0"
|
||||||
id 'com.github.johnrengelman.shadow' version '7.0.0'
|
id 'com.github.johnrengelman.shadow' version '7.0.0'
|
||||||
id 'net.minecrell.plugin-yml.bukkit' version '0.5.0'
|
id 'net.minecrell.plugin-yml.bukkit' version '0.5.0'
|
||||||
}
|
}
|
||||||
|
@ -99,7 +100,7 @@ dependencies {
|
||||||
implementation('io.papermc:paperlib:1.0.6')
|
implementation('io.papermc:paperlib:1.0.6')
|
||||||
implementation('org.bstats:bstats-base:2.2.1')
|
implementation('org.bstats:bstats-base:2.2.1')
|
||||||
implementation('org.bstats:bstats-bukkit:2.2.1')
|
implementation('org.bstats:bstats-bukkit:2.2.1')
|
||||||
implementation('org.reflections:reflections:0.9.12')
|
implementation('org.reflections:reflections:0.10.1')
|
||||||
implementation('org.javassist:javassist:3.28.0-GA')
|
implementation('org.javassist:javassist:3.28.0-GA')
|
||||||
implementation('org.jetbrains:annotations:22.0.0')
|
implementation('org.jetbrains:annotations:22.0.0')
|
||||||
implementation('com.mattmalec:Pterodactyl4J:2.BETA_80')
|
implementation('com.mattmalec:Pterodactyl4J:2.BETA_80')
|
||||||
|
@ -139,22 +140,32 @@ static def getDate() {
|
||||||
return new Date().format('MM/dd/yyyy HH:mm')
|
return new Date().format('MM/dd/yyyy HH:mm')
|
||||||
}
|
}
|
||||||
|
|
||||||
def getGitHash() {
|
String getGitHash() {
|
||||||
def stdout = new ByteArrayOutputStream()
|
def stdout = new ByteArrayOutputStream()
|
||||||
|
try {
|
||||||
exec {
|
exec {
|
||||||
commandLine 'git', 'rev-parse', '--short', 'HEAD'
|
commandLine "git", "rev-parse", "--short", "HEAD"
|
||||||
standardOutput = stdout
|
standardOutput = stdout
|
||||||
|
ignoreExitValue = true
|
||||||
}
|
}
|
||||||
return stdout.toString().trim()
|
} catch (GradleException e) {
|
||||||
|
logger.error("Couldn't determine Git head because Git is not installed. " + e.getMessage())
|
||||||
|
}
|
||||||
|
return stdout.size() > 0 ? stdout.toString().trim() : "unknown"
|
||||||
}
|
}
|
||||||
|
|
||||||
def getBuildNumber() {
|
String getBuildNumber() {
|
||||||
def stdout = new ByteArrayOutputStream()
|
def stdout = new ByteArrayOutputStream()
|
||||||
|
try {
|
||||||
exec {
|
exec {
|
||||||
commandLine 'git', 'rev-list', 'HEAD', '--count'
|
commandLine "git", "rev-list", "HEAD", "--count"
|
||||||
standardOutput = stdout
|
standardOutput = stdout
|
||||||
|
ignoreExitValue = true
|
||||||
}
|
}
|
||||||
return stdout.toString().trim()
|
} catch (GradleException e) {
|
||||||
|
logger.error("Couldn't determine Git head because Git is not installed. " + e.getMessage())
|
||||||
|
}
|
||||||
|
return stdout.size() > 0 ? stdout.toString().trim() : "unknown"
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(Checkstyle) {
|
tasks.withType(Checkstyle) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue