-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move common build logic to convention plugins
- Loading branch information
Showing
16 changed files
with
164 additions
and
193 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,28 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
maven { | ||
name = "Architectury" | ||
url = uri("https://maven.architectury.dev") | ||
} | ||
maven { | ||
name = "Fabric" | ||
url = uri("https://maven.fabricmc.net") | ||
} | ||
maven { | ||
name = "NeoForge" | ||
url = uri("https://maven.neoforged.net/releases") | ||
} | ||
gradlePluginPortal() | ||
} | ||
|
||
dependencies { | ||
implementation(libs.architectury.loom) | ||
implementation(libs.architectury.plugin) | ||
|
||
// Enable using version catalog in local plugins | ||
// https://github.com/gradle/gradle/issues/15383 | ||
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location)) | ||
} |
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,13 @@ | ||
pluginManagement { | ||
repositories { | ||
gradlePluginPortal() | ||
} | ||
} | ||
|
||
dependencyResolutionManagement { | ||
versionCatalogs { | ||
create("libs") { | ||
from(files("../gradle/libs.versions.toml")) | ||
} | ||
} | ||
} |
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,30 @@ | ||
plugins { | ||
id("base") | ||
} | ||
|
||
val baseName = project.property("archives_name").toString() | ||
|
||
val mavenGroup = project.property("maven_group").toString() | ||
val modVersion = project.property("mod_version").toString() | ||
|
||
base { | ||
archivesName = baseName | ||
} | ||
|
||
group = mavenGroup | ||
version = modVersion | ||
|
||
if (project.hasProperty("loom.platform")) { | ||
val platform = project.property("loom.platform") | ||
val minecraft = project.property("minecraft_version_min") | ||
|
||
version = "${modVersion}+minecraft-${minecraft}-${platform}" | ||
} | ||
|
||
tasks.withType<ProcessResources> { | ||
inputs.property("version", modVersion) | ||
|
||
filesMatching(listOf("fabric.mod.json", "mods.toml", "neoforge.mods.toml", "quilt.mod.json")) { | ||
expand(inputs.properties) | ||
} | ||
} |
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,19 @@ | ||
plugins { | ||
id("java") | ||
} | ||
|
||
java { | ||
withSourcesJar() | ||
|
||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(21) | ||
} | ||
} | ||
|
||
tasks.withType<JavaCompile> { | ||
options.encoding = "UTF-8" | ||
|
||
javaCompiler = javaToolchains.compilerFor { | ||
languageVersion = JavaLanguageVersion.of(21) | ||
} | ||
} |
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,36 @@ | ||
import org.gradle.accessors.dm.LibrariesForLibs | ||
|
||
plugins { | ||
id("dynamic_fps.base") | ||
id("dynamic_fps.java") | ||
id("architectury-plugin") | ||
id("dev.architectury.loom") | ||
} | ||
|
||
val libs = the<LibrariesForLibs>() | ||
|
||
architectury { | ||
minecraft = libs.versions.minecraft.get() | ||
} | ||
|
||
loom { | ||
silentMojangMappingsLicense() | ||
|
||
mods.create("dynamic_fps") { | ||
sourceSet(sourceSets.main.get()) | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
name = "LostLuma" | ||
url = uri("https://maven.lostluma.net/releases") | ||
} | ||
} | ||
|
||
dependencies { | ||
minecraft(libs.minecraft) | ||
mappings(loom.officialMojangMappings()) | ||
|
||
implementation(libs.battery) | ||
} |
This file was deleted.
Oops, something went wrong.
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,3 @@ | ||
plugins { | ||
alias(libs.plugins.architectury.loom).apply(false) | ||
} |
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 was deleted.
Oops, something went wrong.
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,19 @@ | ||
plugins { | ||
id("dynamic_fps.module") | ||
} | ||
|
||
val platforms = project.property("enabled_platforms").toString() | ||
|
||
architectury { | ||
common(platforms.split(",")) | ||
} | ||
|
||
loom { | ||
accessWidenerPath = file("src/main/resources/dynamic_fps.accesswidener") | ||
} | ||
|
||
dependencies { | ||
modImplementation(libs.cloth.config) | ||
// Note: This is only here for the @Environment annotation, do not use! | ||
modImplementation(libs.fabric.loader) | ||
} |
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
Oops, something went wrong.