Skip to content

Commit 3da3761

Browse files
committed
2 parents 97d1eb1 + 0831c52 commit 3da3761

File tree

1 file changed

+10
-49
lines changed

1 file changed

+10
-49
lines changed

build.gradle

Lines changed: 10 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -111,45 +111,29 @@ dependencies {
111111
processResources {
112112
inputs.property "version", project.version
113113

114-
filesMatching("fabric.mod.json") {
114+
from(sourceSets.main.resources.srcDirs) {
115+
include "fabric.mod.json"
115116
expand "version": project.version
116117
}
117-
}
118118

119-
tasks.withType(JavaCompile).configureEach {
120-
// ensure that the encoding is set to UTF-8, no matter what the system default is
121-
// this fixes some edge cases with special characters not displaying correctly
122-
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
123-
// If Javadoc is generated, this must be specified in that task too.
124-
it.options.encoding = "UTF-8"
125-
126-
// The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too
127-
// JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.
128-
// We'll use that if it's available, but otherwise we'll use the older option.
129-
def targetVersion = 8
130-
if (JavaVersion.current().isJava9Compatible()) {
131-
it.options.release = targetVersion
119+
from(sourceSets.main.resources.srcDirs) {
120+
exclude "fabric.mod.json"
132121
}
133122
}
134123

135-
java {
136-
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
137-
// if it is present.
138-
// If you remove this line, sources will not be generated.
139-
withSourcesJar()
140-
}
141-
142-
jar {
143-
from("LICENSE") {
144-
rename { "${it}_${project.archivesBaseName}" }
145-
}
124+
tasks.withType(JavaCompile) {
125+
options.encoding = "UTF-8"
146126
}
147127

148128
task sourcesJar(type: Jar, dependsOn: classes) {
149129
classifier = "sources"
150130
from sourceSets.main.allSource
151131
}
152132

133+
jar {
134+
from "LICENSE"
135+
}
136+
153137
publishing {
154138
publications {
155139
mavenJava(MavenPublication) {
@@ -168,27 +152,4 @@ publishing {
168152
// uncomment to publish to the local maven
169153
// mavenLocal()
170154
}
171-
}
172-
173-
// configure the maven publication
174-
publishing {
175-
publications {
176-
mavenJava(MavenPublication) {
177-
// add all the jars that should be included when publishing to maven
178-
artifact(remapJar) {
179-
builtBy remapJar
180-
}
181-
artifact(sourcesJar) {
182-
builtBy remapSourcesJar
183-
}
184-
}
185-
}
186-
187-
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
188-
repositories {
189-
// Add repositories to publish to here.
190-
// Notice: This block does NOT have the same function as the block in the top level.
191-
// The repositories here will be used for publishing your artifact, not for
192-
// retrieving dependencies.
193-
}
194155
}

0 commit comments

Comments
 (0)