Skip to content

Commit

Permalink
Generate variant run configs
Browse files Browse the repository at this point in the history
  • Loading branch information
MattSturgeon committed Dec 18, 2023
1 parent ace4316 commit 09bab0f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ plugins {
id "com.github.johnrengelman.shadow"
}

def variants = [ "normal", "modrinth" ]

architectury {
platformSetupLoomIde()
fabric()
Expand All @@ -15,6 +17,20 @@ configurations {
developmentFabric.extendsFrom common
}

variants.each {variant ->
def set = sourceSets.create(variant) {
java.srcDirs = [ ]
resources.srcDirs = [ ]
compileClasspath += sourceSets.main.compileClasspath
runtimeClasspath += sourceSets.main.runtimeClasspath
}
loom.runs.create(variant) {
inherit loom.runs.client
configName = "Run $variant"
source set
}
}

dependencies {
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}"
Expand Down
16 changes: 16 additions & 0 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ plugins {
id "com.github.johnrengelman.shadow"
}

def variants = [ "normal", "modrinth" ]

architectury {
platformSetupLoomIde()
forge()
Expand All @@ -25,6 +27,20 @@ configurations {
developmentForge.extendsFrom common
}

variants.each {variant ->
def set = sourceSets.create(variant) {
java.srcDirs = [ ]
resources.srcDirs = [ ]
compileClasspath += sourceSets.main.compileClasspath
runtimeClasspath += sourceSets.main.runtimeClasspath
}
loom.runs.create(variant) {
inherit loom.runs.client
configName = "Run $variant"
source set
}
}

dependencies {
forge "net.minecraftforge:forge:${rootProject.forge_version}"

Expand Down

0 comments on commit 09bab0f

Please sign in to comment.