Skip to content

Commit 545a6fa

Browse files
authored
Merge pull request #372 from Polyfrost/dgt-port
Port to Deftu's Gradle Toolkit, replace UniversalCraft with OmniCore, add support for new versions
2 parents abb4630 + c873a10 commit 545a6fa

File tree

219 files changed

+2246
-5118
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

219 files changed

+2246
-5118
lines changed

.github/workflows/build.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ jobs:
4747
- name: Setup Java
4848
uses: actions/setup-java@v4
4949
with:
50-
java-version: |
51-
8
52-
16
53-
17
50+
java-version: 21
5451
distribution: temurin
5552

5653
- name: Setup Gradle

build.gradle.kts

+22-43
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,31 @@
1-
import org.quiltmc.gradle.licenser.extension.QuiltLicenserGradleExtension
2-
31
plugins {
4-
alias(libs.plugins.kotlin) apply false
5-
alias(libs.plugins.pgt.defaults.repo) apply false
6-
alias(libs.plugins.licenser) apply false
2+
alias(libs.plugins.kotlin) apply(false)
3+
alias(libs.plugins.licenser) apply(false)
74
alias(libs.plugins.jetbrains.idea.ext)
8-
}
95

10-
val major = project.properties["version_major"]
11-
val minor = project.properties["version_minor"]
12-
val patch = project.properties["version_patch"]
6+
alias(libs.plugins.dgt.base) apply(false)
7+
}
138

14-
version = "$major.$minor.$patch"
15-
group = properties["group"] as String
9+
// Note for future devs: DON'T apply the java-library plugin to subprojects here.
10+
// This will cause loom to completely break apart and throw itself into oblivion.
11+
// I have no idea how to fix it, and honestly, I don't want to know.
1612

1713
subprojects {
18-
version = rootProject.version
19-
group = "${rootProject.group}.${rootProject.properties["mod_id"] as String}"
20-
21-
apply(plugin = rootProject.libs.plugins.licenser.get().pluginId)
22-
// Note for future devs: DON'T apply the java-library plugin to subprojects here.
23-
// This will cause loom to completely break apart and throw itself into oblivion.
24-
// I have no idea how to fix it, and honestly, I don't want to know.
25-
apply(plugin = "maven-publish")
26-
apply(plugin = "signing")
27-
28-
afterEvaluate { // ew.
29-
if (project.pluginManager.hasPlugin("java")) {
30-
configure<JavaPluginExtension> {
31-
withSourcesJar()
32-
}
33-
}
34-
}
35-
36-
// configure<QuiltLicenserGradleExtension> {
37-
// rule("${rootProject.rootDir}/FILEHEADER")
38-
// include("**/*.kt")
39-
// include("**/*.java")
40-
// }
41-
42-
configure<PublishingExtension> {
43-
repositories {
44-
arrayOf("releases", "snapshots", "private").forEach { type ->
45-
maven {
46-
name = type
47-
url = uri("https://repo.polyfrost.org/$type")
48-
credentials(PasswordCredentials::class)
49-
authentication { create<BasicAuthentication>("basic") }
14+
pluginManager.withPlugin("java") {
15+
apply(plugin = rootProject.libs.plugins.licenser.get().pluginId)
16+
apply(plugin = rootProject.libs.plugins.dgt.base.get().pluginId)
17+
apply(plugin = rootProject.libs.plugins.dgt.publishing.maven.get().pluginId)
18+
apply(plugin = "signing")
19+
20+
configure<PublishingExtension> {
21+
repositories {
22+
arrayOf("releases", "snapshots", "private").forEach { type ->
23+
maven {
24+
name = type
25+
url = uri("https://repo.polyfrost.org/$type")
26+
credentials(PasswordCredentials::class)
27+
authentication { create<BasicAuthentication>("basic") }
28+
}
5029
}
5130
}
5231
}

buildSrc/src/main/kotlin/org/polyfrost/gradle/addDependencies.kt

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ fun Project.provideIncludedDependencies(version: Triple<Int, Int, Int>?, loader:
2323
deps.addAll(libs.findBundle("nightconfig").get().get())
2424
deps.add(libs.findLibrary("snakeyaml").get().get())
2525
deps.add(libs.findLibrary("isolated-lwjgl3-loader").get().get())
26+
deps.add(libs.findLibrary("textile").get().get())
2627
deps.add(libs.findLibrary("polyio").get().get())
2728
val copycat = libs.findLibrary("copycat").get().get()
2829
deps.add(copycat)
@@ -47,6 +48,7 @@ fun Project.provideIncludedDependencies(version: Triple<Int, Int, Int>?, loader:
4748
in 16..18 -> "3.2.2"
4849
19 -> "3.3.1"
4950
20 -> "3.3.2"
51+
21 -> "3.3.3"
5052
else -> error("Unsupported Minecraft version: ${version.toMCVer()}")
5153
}
5254

@@ -75,7 +77,8 @@ fun Project.provideIncludedDependencies(version: Triple<Int, Int, Int>?, loader:
7577
actualDeps.add(OCDependency(dep))
7678
}
7779
if (version != null) {
78-
actualDeps.add(OCDependency("org.polyfrost:universalcraft-${version.toMCVer()}-$loader:${libs.findVersion("universalcraft").get().displayName}", true))
80+
actualDeps.add(OCDependency("dev.deftu:textile-${version.toMCVer()}-$loader:${libs.findVersion("textile").get().displayName}", true))
81+
actualDeps.add(OCDependency("dev.deftu:omnicore-${version.toMCVer()}-$loader:${libs.findVersion("omnicore").get().displayName}", true))
7982
}
8083
return actualDeps
8184
}

gradle.properties

+12-18
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
1-
group=org.polyfrost
2-
name=OneConfig
3-
mod_id=oneconfig
4-
version_major=1
5-
version_minor=0
6-
version_patch=0-alpha.68
7-
8-
polyfrost.defaults.loom=3
9-
10-
kotlin.code.style=official
11-
1+
# Gradle Configuration -- DO NOT TOUCH THESE VALUES.
2+
org.gradle.daemon=true
123
org.gradle.parallel=true
13-
org.gradle.caching=true
14-
#org.gradle.configuration-cache=true
154
org.gradle.configureondemand=true
165
org.gradle.parallel.threads=4
17-
org.gradle.dependency.verification=strict
18-
org.gradle.kotlin.dsl.allWarningsAsErrors=true
19-
org.gradle.kotlin.dsl.precompiled.accessors.strict=true
20-
org.gradle.workers.max=4
21-
org.gradle.jvmargs=-Xmx4G -Dfile.encoding=UTF-8
6+
org.gradle.jvmargs=-Xmx10G
7+
8+
kotlin.code.style=official
9+
10+
dgt.java.version=8
11+
12+
# Project Configuration
13+
project.group=org.polyfrost.oneconfig
14+
project.name=OneConfig
15+
project.version=1.0.0-alpha.70

gradle/libs.versions.toml

+17-13
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ copycat = "0.1.3"
2020
copycat-image-awt = "0.1.1"
2121

2222
# Per version
23-
universalcraft = "2.0.0"
23+
textile = "0.8.0"
24+
omnicore = "0.21.0"
2425
lwjgl = "3.3.3" # All downloaded by the isolated-lwjgl3-loader
2526

2627
# Legacy only
@@ -29,10 +30,9 @@ mixin-extras = "0.4.1"
2930
asm = "5.2"
3031

3132
# Gradle
33+
dgt = "2.27.1"
3234
kotlinx-abi = "0.14.0"
33-
pgt = "0.6.6"
34-
shadow = "8.1.1"
35-
licenser = "2.0.1"
35+
licenser = "2.1.1"
3636
jetbrains-idea-ext = "1.1.8"
3737

3838
log4j-api = "2.0-beta9" # used because this is the version that 1.8.9 supports, so we have to compile against the same (annoying)
@@ -64,6 +64,8 @@ annotations = { module = "org.jetbrains:annotations", version.ref = "annotations
6464
logging-api = { module = "org.apache.logging.log4j:log4j-api", version.ref = "log4j-api" }
6565
logging-impl = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j-impl" }
6666

67+
textile = { module = "dev.deftu:textile", version.ref = "textile" }
68+
6769
lwjgl = { module = "org.lwjgl:lwjgl", version.ref = "lwjgl" }
6870
lwjgl-nvg = { module = "org.lwjgl:lwjgl-nanovg", version.ref = "lwjgl" }
6971
lwjgl-stb = { module = "org.lwjgl:lwjgl-stb", version.ref = "lwjgl" }
@@ -97,14 +99,16 @@ test-core = ["junit", "logging-impl"]
9799
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
98100
kotlinx-api-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "kotlinx-abi" }
99101

100-
pgt-main = { id = "org.polyfrost.multi-version", version.ref = "pgt" }
101-
pgt-root = { id = "org.polyfrost.multi-version.root", version.ref = "pgt" }
102-
pgt-api-validator = { id = "org.polyfrost.multi-version.api-validation", version.ref = "pgt" }
103-
pgt-default = { id = "org.polyfrost.defaults", version.ref = "pgt" }
104-
pgt-defaults-repo = { id = "org.polyfrost.defaults.repo", version.ref = "pgt" }
105-
pgt-defaults-java = { id = "org.polyfrost.defaults.java", version.ref = "pgt" }
106-
107-
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
108-
licenser = { id = "org.quiltmc.gradle.licenser", version.ref = "licenser" }
102+
dgt-base = { id = "dev.deftu.gradle.tools", version.ref = "dgt" }
103+
dgt-multiversion-platform = { id = "dev.deftu.gradle.multiversion", version.ref = "dgt" }
104+
dgt-multiversion-root = { id = "dev.deftu.gradle.multiversion-root", version.ref = "dgt" }
105+
dgt-java = { id = "dev.deftu.gradle.tools.java", version.ref = "dgt" }
106+
dgt-kotlin = { id = "dev.deftu.gradle.tools.kotlin", version.ref = "dgt" }
107+
dgt-resources = { id = "dev.deftu.gradle.tools.resources", version.ref = "dgt" }
108+
dgt-shadow = { id = "dev.deftu.gradle.tools.shadow", version.ref = "dgt" }
109+
dgt-publishing-maven = { id = "dev.deftu.gradle.tools.publishing.maven", version.ref = "dgt" }
110+
dgt-loom = { id = "dev.deftu.gradle.tools.minecraft.loom", version.ref = "dgt" }
111+
112+
licenser = { id = "dev.yumi.gradle.licenser", version.ref = "licenser" }
109113

110114
jetbrains-idea-ext = { id = "org.jetbrains.gradle.plugin.idea-ext", version.ref = "jetbrains-idea-ext" }

gradle/wrapper/gradle-wrapper.jar

-51 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME
File renamed without changes.

versions/README.md minecraft/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ The project is designed to be version agnostic, and so the version specific code
77
It is designed to be as small as possible, with the majority of the code being in the `modules/` directory.
88
This project was originally made for `1.8.9-forge`, and so this is the `mainProject` and the API used in the `src/main` directory.
99

10-
Each of the other directories is a separate project, which is automatically generated using [Polyfrost's Gradle Toolkit](https://github.com/Polyfrost/polyfrost-gradle-toolkit) and [ReplayMod's preprocessor](https://github.com/ReplayMod/preprocessor).
11-
Some very version specific code is overwritten in these directories as well, with the exact same path as the `src/main` directory.
10+
Each of the other directories is a separate project, which is automatically generated using [Deftu's Gradle Toolkit](https://github.com/Deftu/gradle-toolkit) and [ReplayMod's preprocessor](https://github.com/ReplayMod/preprocessor).
11+
Some very version specific code is overwritten in these directories as well, with the exact same path as the `src/main` directory.

0 commit comments

Comments
 (0)