Skip to content

Commit

Permalink
Deduplicate bits
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaz492 committed Aug 6, 2023
1 parent e292f56 commit 515fd37
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 68 deletions.
20 changes: 20 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,26 @@ subprojects {
}
}
}

if (project.name != "common") {
tasks.withType(JavaCompile).configureEach {
if (!it.name.toLowerCase().contains("test")) {
source(project(":common").sourceSets.main.allSource)
}
}

tasks.withType(Javadoc).configureEach {
source(project(":common").sourceSets.main.allJava)
}

tasks.named("sourcesJar", Jar) {
from(project(":common").sourceSets.main.allSource)
}

processResources {
from project(":common").sourceSets.main.resources
}
}
}

publishMods {
Expand Down
41 changes: 7 additions & 34 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,47 +28,30 @@ minecraft {
}

runs {
client {
configureEach {
workingDirectory project.file('run')
ideaModule "${rootProject.name}.${project.name}.main"
taskName 'Client'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
ideaModule "${rootProject.name}.${project.name}.main"

mods {
modClientRun {
"${mod_id}" {
source sourceSets.main
source project(":common").sourceSets.main
}
}
}
client {
taskName 'Client'
}

server {
workingDirectory project.file('run')
ideaModule "${rootProject.name}.${project.name}.main"
taskName 'Server'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
mods {
modServerRun {
source sourceSets.main
source project(":common").sourceSets.main
}
}
}

data {
workingDirectory project.file('run')
ideaModule "${rootProject.name}.${project.name}.main"
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
taskName 'Data'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
mods {
modDataRun {
source sourceSets.main
source project(":common").sourceSets.main
}
}
}
}
}
Expand All @@ -81,16 +64,6 @@ dependencies {
annotationProcessor("org.spongepowered:mixin:0.8.5:processor")
}

tasks.withType(JavaCompile).configureEach {
source(project(":common").sourceSets.main.allSource)
}
tasks.withType(Javadoc).configureEach {
source(project(":common").sourceSets.main.allJava)
}
tasks.named("sourcesJar", Jar) {
from(project(":common").sourceSets.main.allSource)
}

processResources {
from project(":common").sourceSets.main.resources
}
Expand Down
41 changes: 7 additions & 34 deletions neo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,47 +22,30 @@ minecraft {
}

runs {
client {
configureEach {
workingDirectory project.file('run')
ideaModule "${rootProject.name}.${project.name}.main"
taskName 'Client'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
ideaModule "${rootProject.name}.${project.name}.main"

mods {
modClientRun {
"${mod_id}" {
source sourceSets.main
source project(":common").sourceSets.main
}
}
}
client {
taskName 'Client'
}

server {
workingDirectory project.file('run')
ideaModule "${rootProject.name}.${project.name}.main"
taskName 'Server'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
mods {
modServerRun {
source sourceSets.main
source project(":common").sourceSets.main
}
}
}

data {
workingDirectory project.file('run')
ideaModule "${rootProject.name}.${project.name}.main"
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
taskName 'Data'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
mods {
modDataRun {
source sourceSets.main
source project(":common").sourceSets.main
}
}
}
}
}
Expand All @@ -75,16 +58,6 @@ dependencies {
annotationProcessor("org.spongepowered:mixin:0.8.5:processor")
}

tasks.withType(JavaCompile).configureEach {
source(project(":common").sourceSets.main.allSource)
}
tasks.withType(Javadoc).configureEach {
source(project(":common").sourceSets.main.allJava)
}
tasks.named("sourcesJar", Jar) {
from(project(":common").sourceSets.main.allSource)
}

processResources {
from project(":common").sourceSets.main.resources
}
Expand Down

0 comments on commit 515fd37

Please sign in to comment.