This repository has been archived by the owner on Sep 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from homchom/gradle
gradle multiproject build, convention plugins
- Loading branch information
Showing
373 changed files
with
321 additions
and
238 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 |
---|---|---|
@@ -1,24 +1,24 @@ | ||
#Gradle | ||
# Gradle | ||
.gradle/ | ||
build/ | ||
out/ | ||
classes/ | ||
gradle/wrapper/gradle-wrapper.properties | ||
|
||
#IDEA | ||
# IDEA | ||
.idea/ | ||
*.iml | ||
*.ipr | ||
*.iws | ||
|
||
#vscode | ||
# VSCode | ||
.settings/ | ||
.vscode/ | ||
bin/ | ||
.classpath | ||
.project | ||
|
||
#fabric | ||
# Fabric | ||
run/ | ||
logs/ | ||
*.launch |
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,28 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { | ||
name = "Fabric" | ||
url = uri("https://maven.fabricmc.net/") | ||
} | ||
} | ||
|
||
dependencies { | ||
fun pluginImplementation(plugin: Provider<PluginDependency>) { | ||
val dep = plugin.get() | ||
implementation(group = dep.pluginId, name = "${dep.pluginId}.gradle.plugin") { | ||
version { | ||
strictly(dep.version.strictVersion) | ||
require(dep.version.requiredVersion) | ||
prefer(dep.version.preferredVersion) | ||
for (version in dep.version.rejectedVersions) reject(version) | ||
} | ||
} | ||
} | ||
|
||
pluginImplementation(libs.plugins.kotlin.jvm) | ||
pluginImplementation(libs.plugins.fabric.loom) | ||
} |
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,7 @@ | ||
dependencyResolutionManagement { | ||
versionCatalogs { | ||
create("libs") { | ||
from(files("../gradle/libs.versions.toml")) | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
buildSrc/src/main/kotlin/recode.fabric-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,8 @@ | ||
plugins { | ||
id("recode.kotlin-conventions") | ||
id("fabric-loom") | ||
} | ||
|
||
java { | ||
withSourcesJar() | ||
} |
30 changes: 30 additions & 0 deletions
30
buildSrc/src/main/kotlin/recode.kotlin-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,30 @@ | ||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
plugins { | ||
kotlin("jvm") | ||
} | ||
|
||
object JvmVersions { | ||
val java get() = JavaVersion.VERSION_17 | ||
val kotlin get() = JvmTarget.JVM_17 | ||
} | ||
|
||
java { | ||
sourceCompatibility = JvmVersions.java | ||
targetCompatibility = JvmVersions.java | ||
} | ||
|
||
tasks.withType<JavaCompile>().configureEach { | ||
options.release = JvmVersions.java.majorVersion.toInt() | ||
options.encoding = "UTF-8" | ||
} | ||
|
||
tasks.withType<KotlinCompile>().configureEach { | ||
compilerOptions { | ||
jvmTarget = JvmVersions.kotlin | ||
freeCompilerArgs = listOf( | ||
"-Xjvm-default=all" | ||
) | ||
} | ||
} |
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,21 @@ | ||
[libraries] | ||
|
||
# required; change versions every minecraft update | ||
minecraft = { module = "com.mojang:minecraft", version = "1.20.4" } | ||
fabric-api = { module = "net.fabricmc.fabric-api:fabric-api", version = "0.96.1+1.20.4" } | ||
|
||
adventure-platform-fabric = { module = "net.kyori:adventure-platform-fabric", version = "5.12.0" } | ||
libgui = { module = "io.github.cottonmc:LibGui", version = "9.2.2+1.20.2" } | ||
clothConfig = { module = "me.shedaniel.cloth:cloth-config-fabric", version = "13.0.121" } | ||
|
||
# optional; change versions every minecraft update | ||
modmenu = { module = "com.terraformersmc:modmenu", version = "9.0.0" } | ||
sodium = { module = "maven.modrinth:sodium", version = "mc1.20.4-0.5.8" } | ||
|
||
# change versions as needed | ||
fabric-loader = { module = "net.fabricmc:fabric-loader", version = "0.15.2" } | ||
fabric-language-kotlin = { module = "net.fabricmc:fabric-language-kotlin", version = "1.11.0+kotlin.2.0.0" } | ||
|
||
[plugins] | ||
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version = "2.0.0" } | ||
fabric-loom = { id = "fabric-loom", version = "1.7-SNAPSHOT" } |
Oops, something went wrong.