1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-09-06 20:37:55 +00:00

Allow building without a git repository

Closes #102
This commit is contained in:
SquidDev
2019-01-28 14:05:30 +00:00
parent e1e5e898ab
commit f3cace1d03

View File

@@ -10,7 +10,7 @@ buildscript {
} }
dependencies { dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'org.ajoberstar:gradle-git:1.6.0' classpath 'org.ajoberstar.grgit:grgit-gradle:3.0.0'
} }
} }
@@ -99,16 +99,20 @@ processResources {
inputs.property "version", project.version inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version inputs.property "mcversion", project.minecraft.version
def grgit = Grgit.open(dir: '.') def hash = 'none'
inputs.property "commithash", grgit.head().id
def blacklist = ['GitHub', 'dan200', 'Daniel Ratcliffe']
Set<String> contributors = [] Set<String> contributors = []
try {
def grgit = Grgit.open(dir: '.')
hash = grgit.head().id
grgit.log().each { def blacklist = ['GitHub', 'dan200', 'Daniel Ratcliffe']
if (!blacklist.contains(it.author.name)) contributors.add(it.author.name) grgit.log().each {
if (!blacklist.contains(it.committer.name)) contributors.add(it.committer.name) if (!blacklist.contains(it.author.name)) contributors.add(it.author.name)
} if (!blacklist.contains(it.committer.name)) contributors.add(it.committer.name)
}
} catch(Exception ignored) { }
inputs.property "commithash", hash
from(sourceSets.main.resources.srcDirs) { from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info' include 'mcmod.info'