From 48754659f8c1c58ed3b0e34e1e8710687b8d9248 Mon Sep 17 00:00:00 2001 From: SquidDev Date: Thu, 6 Jul 2017 17:23:35 +0100 Subject: [PATCH] Various improvements to credits generation - Include author and comitter (so includes rebased commits) - Ignore case when sorting names Fixes #356 --- build.gradle | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index 3d1b50ac0..b4759e19a 100644 --- a/build.gradle +++ b/build.gradle @@ -31,7 +31,7 @@ minecraft { version = "1.9.4-12.17.0.1959" runDir = "run" replace '${version}', project.version - + // the mappings can be changed at any time, and must be in the following format. // snapshot_YYYYMMDD snapshot are built nightly. // stable_# stables are built at the discretion of the MCP team. @@ -46,7 +46,7 @@ dependencies { // or you may define them like so.. //compile "some.group:artifact:version:classifier" //compile "some.group:artifact:version" - + // real examples //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 @@ -78,23 +78,25 @@ processResources { inputs.property "mcversion", project.minecraft.version 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'] Set contributors = [] - + 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) } from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' 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) { exclude 'mcmod.info' exclude 'assets/computercraft/lua/rom/help/credits.txt'