Skip to content

Commit

Permalink
Make use of version catalogue
Browse files Browse the repository at this point in the history
  • Loading branch information
nea89o committed Nov 23, 2023
1 parent 45fb5f6 commit e176385
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 50 deletions.
32 changes: 13 additions & 19 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@ import java.io.ByteArrayOutputStream
import java.net.URL

plugins {
kotlin("jvm") version "1.8.21"
id("gg.essential.loom") version "0.10.0.+" apply false
id("dev.architectury.architectury-pack200") version "0.1.3"
id("xyz.wagyourtail.unimined") version "1.1.0-SNAPSHOT" apply false
id("org.jetbrains.dokka") version "1.8.10"
kotlin("plugin.lombok") version "1.8.21"
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
alias(libs.plugins.dokka)
}


Expand Down Expand Up @@ -39,18 +33,18 @@ allprojects {
maven("https://maven.neoforged.net/releases")
}
afterEvaluate {
(tasks.findByName("dokkaHtml") as? DokkaTask)?.apply {
dokkaSourceSets {
"main" {
sourceLink {
println(project.path)
localDirectory.set(file("src/main/"))
remoteUrl.set(URL("https://github.com/NotEnoughUpdates/MoulConfig/blob/$hash/src/main/"))
remoteLineSuffix.set("#L")
}
}
}
}
// (tasks.findByName("dokkaHtml") as? DokkaTask)?.apply {
// dokkaSourceSets {
// "main" {
// sourceLink {
// println(project.path)
// localDirectory.set(file("src/main/"))
// remoteUrl.set(URL("https://github.com/NotEnoughUpdates/MoulConfig/blob/$hash/src/main/"))
// remoteLineSuffix.set("#L")
// }
// }
// }
// }
extensions.findByType<PublishingExtension>()?.apply {
repositories {
if (project.hasProperty("moulconfigPassword")) {
Expand Down
24 changes: 12 additions & 12 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
java
kotlin("jvm")
id("org.jetbrains.dokka")
kotlin("plugin.lombok")
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.lombok)
alias(libs.plugins.dokka)
}

java.toolchain.languageVersion.set(JavaLanguageVersion.of(8))
Expand All @@ -20,12 +20,12 @@ val singleFile by configurations.creating
artifacts {
add(singleFile.name, tasks.jar)
}
tasks.dokkaHtml {
dokkaSourceSets {
("main") {
moduleName.set("MoulConfig-Common")
sourceRoots.from(sourceSets.main.get().allSource)
classpath.from(tasks.compileJava.get().classpath)
}
}
}
//tasks.dokkaHtml {
// dokkaSourceSets {
// ("main") {
// moduleName.set("MoulConfig-Common")
// sourceRoots.from(sourceSets.main.get().allSource)
// classpath.from(tasks.compileJava.get().classpath)
// }
// }
//}
27 changes: 27 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[versions]
mc_modern = "1.20.2"
mc_legacy = "1.8.9"
mcp = "22-1.8.9"
forge_loader = "11.15.1.2318-1.8.9"
fabric_loader = "0.14.22"
fabric_api = "0.89.2+1.20.2"
yarn_build = "1"
lombok = "1.18.26"
jbAnnotations = "24.0.1"
kotlin = "1.8.21"
shadow = "8.1.1"
dokka = "1.9.10"
unimined = "1.1.0-SNAPSHOT"

[libraries]
jbAnnotations = { module = "org.jetbrains:annotations", version.ref = "jbAnnotations" }
lombok = { module = "org.projectlombok:lombok", version.ref = "lombok" }
fabric_api = { module = "net.fabricmc.fabric-api:fabric-api", version.ref = "fabric_api" }

[plugins]
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
kotlin_jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin_lombok = { id = "org.jetbrains.kotlin.plugin.lombok", version.ref = "kotlin" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
unimined = { id = "xyz.wagyourtail.unimined", version.ref = "unimined" }

22 changes: 11 additions & 11 deletions legacy/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ plugins {
idea
java
`maven-publish`
kotlin("jvm")
id("org.jetbrains.dokka")
id("com.github.johnrengelman.shadow")
id("xyz.wagyourtail.unimined")
kotlin("plugin.lombok")
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.lombok)
alias(libs.plugins.shadow)
alias(libs.plugins.unimined)
alias(libs.plugins.dokka)
}

unimined.minecraft {
version("1.8.9")
version(libs.versions.mc.legacy.get())
mappings {
searge()
mcp("stable", "22-1.8.9")
mcp("stable", libs.versions.mcp.get())
}
minecraftForge {
loader("11.15.1.2318-1.8.9")
loader(libs.versions.forge.loader.get())
}
runs {
config("client") {
Expand All @@ -40,9 +40,9 @@ val include by configurations.creating {
}

dependencies {
annotationProcessor("org.projectlombok:lombok:1.18.26")
compileOnly("org.projectlombok:lombok:1.18.26")
compileOnly("org.jetbrains:annotations:24.0.1")
annotationProcessor(libs.lombok)
compileOnly(libs.lombok)
compileOnly(libs.jbAnnotations)
implementation((project(":common")))
include(project(":common", configuration = "singleFile"))
}
Expand Down
18 changes: 10 additions & 8 deletions modern/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,24 @@ import xyz.wagyourtail.unimined.api.task.RemapJarTask
plugins {
java
idea
kotlin("jvm")
id("com.github.johnrengelman.shadow")
`maven-publish`
id("xyz.wagyourtail.unimined")
kotlin("plugin.lombok")
alias(libs.plugins.unimined)
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.lombok)
alias(libs.plugins.dokka)
alias(libs.plugins.shadow)

}

unimined.minecraft {
version("1.20.2")
version(libs.versions.mc.modern.get())
mappings {
intermediary()
yarn(1)
yarn(libs.versions.yarn.build.get())
}

fabric {
loader("0.14.22")
loader(libs.versions.fabric.loader.get())
}
// runs {
// config("client") {
Expand All @@ -34,7 +36,7 @@ java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
val shadowInclude by configurations.creating
dependencies {
implementation(project(":common"))
"modImplementation"("net.fabricmc.fabric-api:fabric-api:0.89.2+1.20.2")
"modImplementation"(libs.fabric.api)
shadowInclude(project(":common", configuration = "singleFile"))
}

Expand Down

0 comments on commit e176385

Please sign in to comment.