Updated gradle script (might help with #376)

This commit is contained in:
Frank 2022-01-19 23:25:23 +01:00
parent 5d765d3877
commit 2892e6fa11

View file

@ -5,8 +5,6 @@ buildscript {
}
plugins {
id 'idea'
id 'eclipse'
id 'fabric-loom' version "${loom_version}"
id 'maven-publish'
}
@ -86,17 +84,11 @@ def useApi(String dep) {
}
processResources {
inputs.property "version", project.version
duplicatesStrategy = 'WARN'
from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"
expand "version": project.version
}
from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
}
println "Version: ${project.version}"
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
// ensure that the encoding is set to UTF-8, no matter what the system default is
@ -104,6 +96,7 @@ processResources {
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
it.options.release = 17
}
javadoc {
@ -123,6 +116,13 @@ task sourcesJar(type: Jar, dependsOn: classes) {
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 {
from "LICENSE"
}
@ -159,21 +159,21 @@ task release(dependsOn: [remapJar, sourcesJar, javadocJar]) {
}
// configure the maven publication
//publishing {
// publications {
// mavenJava(MavenPublication) {
// artifact(remapJar) {
// builtBy remapJar
// }
// artifact(sourcesJar) {
// builtBy remapSourcesJar
// }
// }
// }
//
// // select the repositories you want to publish to
// repositories {
// // uncomment to publish to the local maven
// // mavenLocal()
// }
//}
publishing {
publications {
mavenJava(MavenPublication) {
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}
// select the repositories you want to publish to
repositories {
// uncomment to publish to the local maven
// mavenLocal()
}
}