Various improvements to credits generation

- Include author and comitter (so includes rebased commits)
 - Ignore case when sorting names

Fixes #356
This commit is contained in:
SquidDev 2017-07-06 17:23:35 +01:00
parent 1d63598d43
commit 48754659f8
1 changed files with 11 additions and 9 deletions

View File

@ -31,7 +31,7 @@
version = "1.9.4-12.17.0.1959" version = "1.9.4-12.17.0.1959"
runDir = "run" runDir = "run"
replace '${version}', project.version replace '${version}', project.version
// the mappings can be changed at any time, and must be in the following format. // the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly. // snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team. // stable_# stables are built at the discretion of the MCP team.
@ -46,7 +46,7 @@
// or you may define them like so.. // or you may define them like so..
//compile "some.group:artifact:version:classifier" //compile "some.group:artifact:version:classifier"
//compile "some.group:artifact:version" //compile "some.group:artifact:version"
// real examples // real examples
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
@ -78,23 +78,25 @@
inputs.property "mcversion", project.minecraft.version inputs.property "mcversion", project.minecraft.version
def grgit = Grgit.open(dir: '.') def grgit = Grgit.open(dir: '.')
inputs.property "commithash", grgit.log(maxCommits: 1)[0].id inputs.property "commithash", grgit.head().id
def blacklist = ['GitHub', 'dan200', 'Daniel Ratcliffe'] def blacklist = ['GitHub', 'dan200', 'Daniel Ratcliffe']
Set<String> contributors = [] Set<String> contributors = []
grgit.log().each { grgit.log().each {
if (!blacklist.contains(it.committer.name)) if (!blacklist.contains(it.author.name)) contributors.add(it.author.name)
contributors.add(it.committer.name) if (!blacklist.contains(it.committer.name)) contributors.add(it.committer.name)
} }
from(sourceSets.main.resources.srcDirs) { from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info' include 'mcmod.info'
include 'assets/computercraft/lua/rom/help/credits.txt' include 'assets/computercraft/lua/rom/help/credits.txt'
expand 'version':project.version, 'mcversion':project.minecraft.version, 'gitcontributors':contributors.sort().join('\n') expand 'version':project.version,
} 'mcversion':project.minecraft.version,
'gitcontributors':contributors.sort(false, String.CASE_INSENSITIVE_ORDER).join('\n')
}
from(sourceSets.main.resources.srcDirs) { from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info' exclude 'mcmod.info'
exclude 'assets/computercraft/lua/rom/help/credits.txt' exclude 'assets/computercraft/lua/rom/help/credits.txt'