Permalink
Browse files

Fixed curse integration in build script

  • Loading branch information...
1 parent 82ba00b commit b58afe17d75cbc656090e5ce2f8fd7780f0e5be6 @CrazyPants CrazyPants committed Jul 2, 2016
Showing with 55 additions and 31 deletions.
  1. +54 −30 build.gradle
  2. +1 −1 gradle.properties
View
@@ -9,7 +9,7 @@ buildscript {
}
plugins {
- id "com.matthewprenger.cursegradle" version "1.0.5"
+ id "com.matthewprenger.cursegradle" version "1.0.7"
}
apply plugin: 'net.minecraftforge.gradle.forge'
@@ -25,13 +25,18 @@ group = "com.enderio.enderzoo"
archivesBaseName = "EnderZoo"
version = "${minecraft_version}-${mod_version}.${buildnumber}"
-if (project.hasProperty('mod_appendix'))
- version += "_${project.mod_appendix}"
+boolean dev = System.getenv("RELEASE") == null || System.getenv("RELEASE").equalsIgnoreCase("false")
+
+def type = 'release'
+if (project.hasProperty('mod_appendix')) {
+ version += "-${project.mod_appendix}"
+ type = project.mod_appendix
+}
minecraft {
mappings = "snapshot_20160518"
version = "${minecraft_version}-${forge_version}"
- runDir = "run"
+ runDir = 'run'
replace "@VERSION@", project.version
replaceIn "EnderZoo.java"
@@ -43,10 +48,6 @@ configurations {
repositories {
mavenCentral()
-}
-
-repositories {
- mavenCentral()
maven { url "http://mobiusstrip.eu/maven" }
}
@@ -84,41 +85,66 @@ processResources {
jar {
from { configurations.exportedCompile.collect { it.isDirectory() ? it : zipTree(it) } }
-}
-
-task sourcesJar(type: Jar) {
- from sourceSets.main.allSource
- classifier = 'sources'
-}
+ }
-task javadocJar(type: Jar, dependsOn: javadoc) {
- from javadoc.destinationDir
- classifier = 'javadoc'
-}
-task deobfJar(type: Jar) {
- from sourceSets.main.output
- from { configurations.exportedCompile.collect { it.isDirectory() ? it : zipTree(it) } }
- classifier = 'dev'
+if (JavaVersion.current().isJava8Compatible()) {
+ allprojects {
+ tasks.withType(Javadoc) {
+ options.addStringOption('Xdoclint:none', '-quiet')
+ }
+ }
}
-build.dependsOn sourceJar, deobfJar, javadocJar
+build.dependsOn sourceJar
publishing {
tasks.publish.dependsOn 'build'
publications {
mavenJava(MavenPublication) {
from components.java
- artifact sourceJar
- artifact javadocJar
- artifact deobfJar
+ artifact sourceJar
}
}
repositories {
if (project.hasProperty('mavendir')) {
maven { url mavendir }
+ } else {
+ mavenLocal()
+ }
+ }
+}
+
+task checkTranslations << {
+ Map<String, String> mapen = new HashMap<String, String>()
+ (new File('resources/assets/enderio/lang/en_US.lang')).eachLine {
+ def (value1, value2) = it.tokenize( '=' )
+ if (value1 == null || value2 == null) {return}
+ mapen.put(value1, value2)
+ }
+
+ new File('resources/assets/enderio/lang/').eachFileMatch( ~".*\\.lang\$" ) { langfile ->
+ if (!langfile.getName().contains("en_US")) {
+ Map<String, String> map = new HashMap<String, String>()
+ File outfile = new File("${langfile}.txt")
+ Writer outwriter = outfile.newWriter("UTF8")
+ outwriter.write("\n// Additional translations:\n")
+ outwriter << langfile.filterLine {
+ def (value1, value2) = it.tokenize( '=' )
+ if (value1 == null || value2 == null) {return false}
+ map.put(value1, value2)
+ return !mapen.containsKey(value1)
+ }
+
+ outwriter.append("\n// Missing translations:\n")
+ for (e in mapen) {
+ if (!map.containsKey(e.key)) {
+ outwriter.append(e.key + "=" + e.value + "\n")
+ }
+ }
+ println "Created translation report ${outfile}"
}
}
}
@@ -132,13 +158,11 @@ curseforge {
project {
id = project.projectId
- changelog = System.getenv('CHANGELOG') == null || System.getenv('CHANGELOG').equals('none') ? getChangelogText() : System.getenv('CHANGELOG')
+ changelog = System.getenv('CHANGELOG') == null || System.getenv('CHANGELOG').equals('none') ? "NA" : System.getenv('CHANGELOG')
changelogType = 'html'
releaseType = type
mainArtifact(jar) {
displayName = "${archivesBaseName} - ${version}"
}
- addArtifact(apiJar)
}
-}
-
+}
View
@@ -8,4 +8,4 @@ mod_version=1.2.3
waila_version=1.7.0-B3_1.9.4
-curse_projectId=225247
+projectId=225247

0 comments on commit b58afe1

Please sign in to comment.