-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move common gradle project configuration to conventions plugin
- Loading branch information
Showing
8 changed files
with
156 additions
and
108 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
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,18 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
maven("https://maven.fabricmc.net/") { name = "Fabric" } | ||
maven("https://maven.architectury.dev/") | ||
maven("https://files.minecraftforge.net/maven/") | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
|
||
dependencies { | ||
implementation("architectury-plugin:architectury-plugin.gradle.plugin:3.4-SNAPSHOT") | ||
implementation("dev.architectury:architectury-loom:1.7-SNAPSHOT") | ||
implementation("com.gradleup.shadow:shadow-gradle-plugin:8.3.3") | ||
} | ||
|
42 changes: 42 additions & 0 deletions
42
buildSrc/src/main/kotlin/xaeroplus-all.conventions.gradle.kts
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,42 @@ | ||
plugins { | ||
java | ||
id("maven-publish") | ||
id("architectury-plugin") | ||
} | ||
|
||
configure<BasePluginExtension> { | ||
archivesName = "XaeroPlus" | ||
} | ||
|
||
version = gradle.extra.get("mod_version").toString() | ||
group = gradle.extra.get("maven_group").toString() | ||
|
||
repositories { | ||
maven("https://api.modrinth.com/maven") { | ||
name = "Modrinth" | ||
} | ||
maven("https://maven.2b2t.vc/releases") { | ||
name = "maven.2b2t.vc" | ||
} | ||
maven("https://maven.parchmentmc.org") { | ||
name = "ParchmentMC" | ||
} | ||
maven("https://maven.lenni0451.net/releases") { | ||
name = "Lenni0451" | ||
} | ||
maven("https://maven.shedaniel.me/") | ||
maven("https://maven.terraformersmc.com/releases/") | ||
mavenLocal() | ||
} | ||
|
||
tasks { | ||
withType<JavaCompile> { | ||
options.encoding = "UTF-8" | ||
options.release = 17 | ||
} | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} |
49 changes: 49 additions & 0 deletions
49
buildSrc/src/main/kotlin/xaeroplus-platform.conventions.gradle.kts
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,49 @@ | ||
plugins { | ||
id("dev.architectury.loom") | ||
id("com.gradleup.shadow") | ||
} | ||
|
||
loom { | ||
silentMojangMappingsLicense() | ||
runs { | ||
getByName("client") { | ||
programArgs("--username", "rfresh2") | ||
} | ||
} | ||
} | ||
|
||
val minecraft_version: String by gradle.extra | ||
val parchment_version: String by gradle.extra | ||
val mc = "com.mojang:minecraft:${minecraft_version}" | ||
val parchment = "org.parchmentmc.data:parchment-${minecraft_version}:${parchment_version}" | ||
|
||
dependencies { | ||
minecraft(mc) | ||
mappings(loom.layered { | ||
officialMojangMappings() | ||
parchment(parchment) | ||
}) | ||
} | ||
|
||
tasks { | ||
shadowJar { | ||
archiveClassifier.set("shadow") | ||
exclude("com/google/**") | ||
exclude("org/objectweb/**") | ||
exclude("org/checkerframework/**") | ||
exclude("org/rfresh/sqlite/native/FreeBSD/**") | ||
exclude("org/rfresh/sqlite/native/Linux-Android/**") | ||
exclude("org/rfresh/sqlite/native/Linux-Musl/**") | ||
exclude("org/rfresh/sqlite/native/Linux/arm/**") | ||
exclude("org/rfresh/sqlite/native/Linux/aarch64/**") | ||
exclude("org/rfresh/sqlite/native/Linux/armv6/**") | ||
exclude("org/rfresh/sqlite/native/Linux/x86/**") | ||
exclude("org/rfresh/sqlite/native/Linux/armv7/**") | ||
exclude("org/rfresh/sqlite/native/Linux/ppc64/**") | ||
exclude("org/rfresh/sqlite/native/Linux/riscv64/**") | ||
exclude("org/rfresh/sqlite/native/Windows/armv7/**") | ||
exclude("org/rfresh/sqlite/native/Windows/aarch64/**") | ||
exclude("org/rfresh/sqlite/native/Windows/armv7/**") | ||
exclude("org/slf4j/**") | ||
} | ||
} |
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