-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Done the basic quilt gradle settings
- Loading branch information
1 parent
1b84a36
commit 5dc4bae
Showing
7 changed files
with
178 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
architectury { | ||
common(project.property("enabled_platforms").toString().split(",")) | ||
} | ||
|
||
base.archivesName.set("${project.property("archives_base_name")}-fabric-like") | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { | ||
url = uri("https://bai.jfrog.io/artifactory/maven") //ModMenu | ||
content { | ||
includeGroup("com.terraformersmc") | ||
} | ||
} | ||
maven { | ||
// Patchouli | ||
url = uri("https://maven.blamejared.com") | ||
} | ||
} | ||
|
||
dependencies { | ||
modImplementation("net.fabricmc:fabric-loader:${project.property("fabric_loader_version")}") | ||
modApi("net.fabricmc.fabric-api:fabric-api:${project.property("fabric_api_version")}") | ||
// Remove the next line if you don't want to depend on the API | ||
modApi("dev.architectury:architectury-fabric:${project.property("architectury_version")}") | ||
modApi("me.shedaniel.cloth:cloth-config-fabric:${project.property("cloth_config_version")}") { | ||
exclude(module = "fabric-api") | ||
} | ||
|
||
modImplementation("vazkii.patchouli:Patchouli:${project.property("patchouli_version")}-FABRIC-SNAPSHOT") | ||
|
||
"compileClasspath"(project(path = ":common", configuration = "namedElements")) { isTransitive = false } | ||
|
||
modImplementation("com.terraformersmc:modmenu:4.0.0") | ||
} | ||
|
||
val accessWidenerFile = project(":common").file("src/main/resources/rpmtw_platform_mod.accesswidener") | ||
|
||
loom { | ||
accessWidenerPath.set(accessWidenerFile) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
plugins { | ||
id("com.github.johnrengelman.shadow") version "7.1.2" | ||
} | ||
|
||
repositories { | ||
maven { url = uri("https://maven.quiltmc.org/repository/release/") } | ||
maven { url = uri("https://maven.quiltmc.org/repository/snapshot/") } // Kotlin currently is in snapshot | ||
} | ||
|
||
architectury { | ||
platformSetupLoomIde() | ||
loader("quilt") | ||
} | ||
|
||
base.archivesName.set("${project.property("archives_base_name")}-quilt") | ||
|
||
val common by configurations.registering | ||
val shadowCommon by configurations.registering // Don't use shadow from the shadow plugin because we don't want IDEA to index this. | ||
configurations { | ||
compileClasspath { | ||
extendsFrom(common.get()) | ||
} | ||
|
||
runtimeClasspath { | ||
extendsFrom(common.get()) | ||
} | ||
|
||
getByName("developmentQuilt").extendsFrom(common.get()) | ||
} | ||
|
||
val accessWidenerFile = project(":common").file("src/main/resources/rpmtw_platform_mod.accesswidener") | ||
|
||
loom { | ||
accessWidenerPath.set(accessWidenerFile) | ||
} | ||
|
||
dependencies { | ||
modImplementation("org.quiltmc:quilt-loader:${project.property("quilt_loader_version")}") | ||
modApi("org.quiltmc.quilted-fabric-api:quilted-fabric-api:${project.property("quilted_fabric_api_version")}-${project.property("minecraft_version")}") | ||
// Remove the next few lines if you don't want to depend on the API | ||
modApi("dev.architectury:architectury-fabric:${project.property("architectury_version")}") { | ||
exclude(group = "net.fabricmc") | ||
exclude(group = "net.fabricmc.fabric-api") | ||
} | ||
modApi("org.quiltmc.quilt-kotlin-libraries:quilt-kotlin-libraries:${project.property("quilt_kotlin_libraries")}") | ||
|
||
"common"(project(path = ":common", configuration = "namedElements")) { isTransitive = false } | ||
"shadowCommon"(project(path = ":common", configuration = "transformProductionQuilt")) { isTransitive = false } | ||
"common"(project(path = ":fabric-like", configuration = "namedElements")) { isTransitive = false } | ||
"shadowCommon"(project(path = ":fabric-like", configuration = "transformProductionQuilt")) { isTransitive = false } | ||
|
||
"shadowCommon"( | ||
"com.github.RPMTW:RPMTW-API-Client-Kotlin:${project.property("rpmtw_api_client_version")}" | ||
) { | ||
exclude("com.google.code.gson") | ||
exclude("org.jetbrains.kotlinx") | ||
exclude("org.jetbrains.kotlin") | ||
}.let { | ||
implementation(it) | ||
} | ||
} | ||
|
||
tasks { | ||
val resourcesPath = file("src/main/resources") | ||
// The access widener file is needed in :fabric project resources when the game is run. | ||
val copyAccessWidener by registering(Copy::class) { | ||
from(accessWidenerFile) | ||
into(resourcesPath) | ||
} | ||
|
||
processResources { | ||
dependsOn(copyAccessWidener) | ||
inputs.property("group", project.group) | ||
inputs.property("version", project.version) | ||
|
||
filesMatching("quilt.mod.json") { | ||
expand("group" to project.group, "version" to project.version) | ||
} | ||
} | ||
|
||
|
||
shadowJar { | ||
configurations = listOf(shadowCommon.get()) | ||
archiveClassifier.set("dev-shadow") | ||
} | ||
|
||
remapJar { | ||
inputFile.set(shadowJar.get().archiveFile) | ||
dependsOn(shadowJar) | ||
archiveClassifier.set(null as String?) | ||
} | ||
|
||
jar { | ||
archiveClassifier.set("dev") | ||
} | ||
|
||
sourcesJar { | ||
val commonSources = project(":common").tasks.sourcesJar | ||
dependsOn(commonSources) | ||
from(commonSources.get().archiveFile.map { zipTree(it) }) | ||
exclude("rpmtw_platform_mod.accesswidener") | ||
exclude("rpmtw_platform_mod.mixins.json") | ||
} | ||
} | ||
|
||
components.getByName<AdhocComponentWithVariants>("java") { | ||
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements.get()) { | ||
skip() | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
create<MavenPublication>("mavenQuilt") { | ||
artifactId = project.property("archives_base_name").toString() | ||
from(components["java"]) | ||
} | ||
} | ||
|
||
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. | ||
repositories {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
loom.platform=quilt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters