mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-07-05 11:32:53 +00:00
Remove Grgit/jgit usage in build.gradle
The replacement is objectively worse. However, it supports Git worktrees, which sadly jgit does not. We really need to rewrite the build script to make it lazy so we're not executing these commands every time.
This commit is contained in:
parent
ee27d8f081
commit
444830cf2d
29
build.gradle
29
build.gradle
@ -11,7 +11,6 @@ buildscript {
|
|||||||
classpath 'com.google.code.gson:gson:2.8.1'
|
classpath 'com.google.code.gson:gson:2.8.1'
|
||||||
classpath 'net.minecraftforge.gradle:ForgeGradle:3.0.190'
|
classpath 'net.minecraftforge.gradle:ForgeGradle:3.0.190'
|
||||||
classpath 'net.sf.proguard:proguard-gradle:6.1.0beta2'
|
classpath 'net.sf.proguard:proguard-gradle:6.1.0beta2'
|
||||||
classpath 'org.ajoberstar.grgit:grgit-gradle:3.0.0'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -25,7 +24,6 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'net.minecraftforge.gradle'
|
apply plugin: 'net.minecraftforge.gradle'
|
||||||
apply plugin: 'org.ajoberstar.grgit'
|
|
||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
||||||
apply plugin: 'maven'
|
apply plugin: 'maven'
|
||||||
|
|
||||||
@ -200,7 +198,6 @@ import com.google.gson.GsonBuilder
|
|||||||
import com.google.gson.JsonElement
|
import com.google.gson.JsonElement
|
||||||
import com.hierynomus.gradle.license.tasks.LicenseCheck
|
import com.hierynomus.gradle.license.tasks.LicenseCheck
|
||||||
import com.hierynomus.gradle.license.tasks.LicenseFormat
|
import com.hierynomus.gradle.license.tasks.LicenseFormat
|
||||||
import org.ajoberstar.grgit.Grgit
|
|
||||||
import proguard.gradle.ProGuardTask
|
import proguard.gradle.ProGuardTask
|
||||||
|
|
||||||
task proguard(type: ProGuardTask, dependsOn: jar) {
|
task proguard(type: ProGuardTask, dependsOn: jar) {
|
||||||
@ -253,16 +250,15 @@ processResources {
|
|||||||
def hash = 'none'
|
def hash = 'none'
|
||||||
Set<String> contributors = []
|
Set<String> contributors = []
|
||||||
try {
|
try {
|
||||||
def grgit = Grgit.open(dir: '.')
|
hash = ["git", "-C", projectDir, "rev-parse", "HEAD"].execute().text.trim()
|
||||||
hash = grgit.head().id
|
|
||||||
|
|
||||||
def blacklist = ['GitHub', 'dan200', 'Daniel Ratcliffe']
|
def blacklist = ['GitHub', 'dan200', 'Daniel Ratcliffe']
|
||||||
grgit.log().each {
|
["git", "-C", projectDir, "log", "--format=tformat:%an%n%cn"].execute().text.split('\n').each {
|
||||||
if (!blacklist.contains(it.author.name)) contributors.add(it.author.name)
|
if (!blacklist.contains(it)) contributors.add(it)
|
||||||
if (!blacklist.contains(it.committer.name)) contributors.add(it.committer.name)
|
}
|
||||||
|
} catch(Exception e) {
|
||||||
|
e.printStackTrace()
|
||||||
}
|
}
|
||||||
} catch(Exception ignored) { }
|
|
||||||
|
|
||||||
inputs.property "commithash", hash
|
inputs.property "commithash", hash
|
||||||
|
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
@ -606,18 +602,23 @@ githubRelease {
|
|||||||
token project.hasProperty('githubApiKey') ? project.githubApiKey : ''
|
token project.hasProperty('githubApiKey') ? project.githubApiKey : ''
|
||||||
owner 'SquidDev-CC'
|
owner 'SquidDev-CC'
|
||||||
repo 'CC-Tweaked'
|
repo 'CC-Tweaked'
|
||||||
|
targetCommitish.set(project.provider({
|
||||||
try {
|
try {
|
||||||
targetCommitish = Grgit.open(dir: '.').branch.current().name
|
return ["git", "-C", projectDir, "rev-parse", "--abbrev-ref", "HEAD"].execute().text.trim()
|
||||||
} catch(Exception ignored) { }
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace()
|
||||||
|
}
|
||||||
|
return "master"
|
||||||
|
}))
|
||||||
|
|
||||||
tagName "v${mc_version}-${mod_version}"
|
tagName "v${mc_version}-${mod_version}"
|
||||||
releaseName "[${mc_version}] ${mod_version}"
|
releaseName "[${mc_version}] ${mod_version}"
|
||||||
body {
|
body.set(project.provider({
|
||||||
"## " + new File(projectDir, "src/main/resources/data/computercraft/lua/rom/help/whatsnew.txt")
|
"## " + new File(projectDir, "src/main/resources/data/computercraft/lua/rom/help/whatsnew.txt")
|
||||||
.readLines()
|
.readLines()
|
||||||
.takeWhile { it != 'Type "help changelog" to see the full version history.' }
|
.takeWhile { it != 'Type "help changelog" to see the full version history.' }
|
||||||
.join("\n").trim()
|
.join("\n").trim()
|
||||||
}
|
}))
|
||||||
prerelease false
|
prerelease false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user