Move to jar / *Jar tasks instead of compileJava
Prior to this PR, classes were compiled multiple times (presumably for each sourceset, so at-least twice in normal projects)
This commit is contained in:
parent
d4b36f9cde
commit
3bd253dcdd
|
|
@ -35,6 +35,7 @@ processResources {
|
||||||
expand buildProps
|
expand buildProps
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
mavenJava(MavenPublication) {
|
mavenJava(MavenPublication) {
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,12 @@ dependencies {
|
||||||
}
|
}
|
||||||
|
|
||||||
loom {
|
loom {
|
||||||
|
mods {
|
||||||
|
register(mod_id) {
|
||||||
|
sourceSet sourceSets.main
|
||||||
|
sourceSet project(":Common").sourceSets.main
|
||||||
|
}
|
||||||
|
}
|
||||||
runs {
|
runs {
|
||||||
client {
|
client {
|
||||||
client()
|
client()
|
||||||
|
|
@ -32,9 +38,7 @@ loom {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
from project(":Common").sourceSets.main.resources
|
|
||||||
inputs.property "version", project.version
|
inputs.property "version", project.version
|
||||||
|
|
||||||
filesMatching("fabric.mod.json") {
|
filesMatching("fabric.mod.json") {
|
||||||
|
|
@ -42,14 +46,16 @@ processResources {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
jar {
|
||||||
source(project(":Common").sourceSets.main.allSource)
|
from project(":Common").sourceSets.main.output
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
javadoc {
|
||||||
from("LICENSE") {
|
source project(":Common").sourceSets.main.allJava
|
||||||
rename { "${it}_${mod_name}" }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sourcesJar {
|
||||||
|
from project(":Common").sourceSets.main.allSource
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
|
|
|
||||||
|
|
@ -77,14 +77,17 @@ dependencies {
|
||||||
compileOnly project(":Common")
|
compileOnly project(":Common")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
jar {
|
||||||
source(project(":Common").sourceSets.main.allSource)
|
from project(":Common").sourceSets.main.output
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
javadoc {
|
||||||
from project(":Common").sourceSets.main.resources
|
source project(":Common").sourceSets.main.allJava
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sourcesJar {
|
||||||
|
from project(":Common").sourceSets.main.allSource
|
||||||
|
}
|
||||||
|
|
||||||
jar.finalizedBy('reobfJar')
|
jar.finalizedBy('reobfJar')
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user