@@ -111,45 +111,29 @@ dependencies {
111
111
processResources {
112
112
inputs. property " version" , project. version
113
113
114
- filesMatching(" fabric.mod.json" ) {
114
+ from(sourceSets. main. resources. srcDirs) {
115
+ include " fabric.mod.json"
115
116
expand " version" : project. version
116
117
}
117
- }
118
118
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"
132
121
}
133
122
}
134
123
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"
146
126
}
147
127
148
128
task sourcesJar (type : Jar , dependsOn : classes) {
149
129
classifier = " sources"
150
130
from sourceSets. main. allSource
151
131
}
152
132
133
+ jar {
134
+ from " LICENSE"
135
+ }
136
+
153
137
publishing {
154
138
publications {
155
139
mavenJava(MavenPublication ) {
@@ -168,27 +152,4 @@ publishing {
168
152
// uncomment to publish to the local maven
169
153
// mavenLocal()
170
154
}
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
- }
194
155
}
0 commit comments