|
@@ -27,44 +27,53 @@ dependencies {
|
|
processResources {
|
|
processResources {
|
|
inputs.property "version", project.version
|
|
inputs.property "version", project.version
|
|
|
|
|
|
- from(sourceSets.main.resources.srcDirs) {
|
|
|
|
- include "fabric.mod.json"
|
|
|
|
|
|
+ filesMatching("fabric.mod.json") {
|
|
expand "version": project.version
|
|
expand "version": project.version
|
|
}
|
|
}
|
|
-
|
|
|
|
- from(sourceSets.main.resources.srcDirs) {
|
|
|
|
- exclude "fabric.mod.json"
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-// ensure that the encoding is set to UTF-8, no matter what the system default is
|
|
|
|
-// this fixes some edge cases with special characters not displaying correctly
|
|
|
|
-// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
|
|
|
|
-tasks.withType(JavaCompile) {
|
|
|
|
- options.encoding = "UTF-8"
|
|
|
|
|
|
+tasks.withType(JavaCompile).configureEach {
|
|
|
|
+ // ensure that the encoding is set to UTF-8, no matter what the system default is
|
|
|
|
+ // this fixes some edge cases with special characters not displaying correctly
|
|
|
|
+ // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
|
|
|
|
+ // If Javadoc is generated, this must be specified in that task too.
|
|
|
|
+ it.options.encoding = "UTF-8"
|
|
}
|
|
}
|
|
|
|
|
|
-// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
|
|
|
|
-// if it is present.
|
|
|
|
-// If you remove this task, sources will not be generated.
|
|
|
|
-task sourcesJar(type: Jar, dependsOn: classes) {
|
|
|
|
- classifier = "sources"
|
|
|
|
- from sourceSets.main.allSource
|
|
|
|
|
|
+java {
|
|
|
|
+ // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
|
|
|
|
+ // if it is present.
|
|
|
|
+ // If you remove this line, sources will not be generated.
|
|
|
|
+ withSourcesJar()
|
|
}
|
|
}
|
|
|
|
|
|
jar {
|
|
jar {
|
|
- from "LICENSE"
|
|
|
|
|
|
+ from("LICENSE") {
|
|
|
|
+ rename { "${it}_${project.archivesBaseName}"}
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
-task javadocs(type: Javadoc) {
|
|
|
|
|
|
+javadoc {
|
|
|
|
+ options {
|
|
|
|
+ source = "8"
|
|
|
|
+ encoding = "UTF-8"
|
|
|
|
+ charSet = "UTF-8"
|
|
|
|
+ memberLevel = JavadocMemberLevel.PROTECTED
|
|
|
|
+ // Disable the crazy super-strict doclint tool in Java 8
|
|
|
|
+ addStringOption("Xdoclint:none", "-quiet")
|
|
|
|
+ }
|
|
source = sourceSets.main.allJava
|
|
source = sourceSets.main.allJava
|
|
|
|
+ failOnError false
|
|
}
|
|
}
|
|
|
|
|
|
-task javadocsJar(type: Jar, dependsOn: javadocs) {
|
|
|
|
- classifier = "javadocs"
|
|
|
|
- from javadocs.destinationDir
|
|
|
|
|
|
+task javadocJar(type: Jar) {
|
|
|
|
+ dependsOn javadoc
|
|
|
|
+ from javadoc.destinationDir
|
|
|
|
+ archiveClassifier = "javadoc"
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+build.dependsOn javadocJar
|
|
|
|
+
|
|
// configure the maven publication
|
|
// configure the maven publication
|
|
publishing {
|
|
publishing {
|
|
publications {
|
|
publications {
|
|
@@ -76,7 +85,7 @@ publishing {
|
|
artifact(sourcesJar) {
|
|
artifact(sourcesJar) {
|
|
builtBy remapSourcesJar
|
|
builtBy remapSourcesJar
|
|
}
|
|
}
|
|
- artifact javadocsJar
|
|
|
|
|
|
+ artifact javadocJar
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|