Skip to content

Commit f113214

Browse files
committed
Merge branch 'multiversion/dev' into feature/splitscreen
# Conflicts: # buildSrc/build.gradle.kts # buildSrc/src/main/kotlin/dev/isxander/controlify/project.gradle.kts # settings.gradle.kts # src/main/java/dev/isxander/controlify/Controlify.java # src/main/resources/controlify-compat.iris.mixins.json # src/main/resources/controlify-compat.reeses-sodium-options.mixins.json # src/main/resources/controlify-compat.simple-voice-chat.mixins.json # src/main/resources/controlify-compat.sodium.mixins.json # src/main/resources/controlify-compat.yacl.mixins.json # src/main/resources/controlify-platform.fabric.mixins.json # src/main/resources/controlify-platform.neoforge.mixins.json # src/main/resources/controlify.mixins.json # stonecutter.gradle.kts
2 parents 646dcde + 3032f49 commit f113214

133 files changed

Lines changed: 2915 additions & 1318 deletions

File tree

Some content is hidden

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

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ko_fi: isxander
1+
patreon: isxander

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ jobs:
4747
with:
4848
java-version: 21
4949
distribution: temurin
50-
- name: Setup gradle
51-
uses: gradle/actions/setup-gradle@v3
52-
with:
53-
cache-read-only: false
50+
- name: Make gradlew executable
51+
run: chmod +x ./gradlew
5452
- name: Overwrite current version
5553
run: printf "%s" "${{ matrix.target }}" | cut -d':' -f1 | tr -d '\n' > ./versions/current
5654
- name: Build ${{ matrix.target }}
57-
run: ./gradlew "Refresh active project" buildAndCollectActive --stacktrace
55+
run: |
56+
./gradlew "Refresh active project"
57+
./gradlew buildAndCollectActive --stacktrace
5858
env:
5959
CI_SINGLE_BUILD: ${{ matrix.target }}
6060

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Update gamecontrollerdb.txt
2+
3+
on:
4+
workflow_dispatch:
5+
6+
# Runs on a schedule (every Sunday at 3:00 AM UTC)
7+
schedule:
8+
- cron: '0 3 * * 0'
9+
10+
jobs:
11+
update-gamecontrollerdb:
12+
runs-on: ubuntu-latest
13+
14+
permissions:
15+
contents: write # Required to commit changes to the repository
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up JDK
22+
uses: actions/setup-java@v4
23+
with:
24+
java-version: '21'
25+
distribution: 'temurin'
26+
27+
- name: Make gradlew executable
28+
run: chmod +x ./gradlew
29+
30+
- name: Update gamecontrollerdb.txt
31+
run: ./gradlew :downloadHidDb
32+
33+
- name: Commit and push changes
34+
uses: stefanzweifel/git-auto-commit-action@v6
35+
with:
36+
file_pattern: '**/gamecontrollerdb-*.txt'
37+
commit_message: "chore: update gamecontrollerdb.txt"

.run/Build (Active).run.xml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.run/Build (All).run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</option>
1111
<option name="taskNames">
1212
<list>
13-
<option value="chiseledBuildAndCollect" />
13+
<option value="build" />
1414
</list>
1515
</option>
1616
<option name="vmOptions" />

.run/Run Dev Client (Active).run.xml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.run/Run Prod Client (Active).run.xml

Lines changed: 0 additions & 24 deletions
This file was deleted.

build.gradle.kts

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,8 @@ dependencies {
8383
}
8484

8585
modstitchModApi("dev.isxander:yet-another-config-lib:${property("deps.yacl")}") {
86-
// was including old fapi version that broke things at runtime
87-
exclude(group = "net.fabricmc.fabric-api", module = "fabric-api")
8886
exclude(group = "thedarkcolour")
89-
}.productionMod()
87+
}.productionMod().jij()
9088

9189
// bindings for SDL3
9290
modstitchApi("dev.isxander:libsdl4j:${property("deps.sdl3Target")}-${property("deps.sdl34jBuild")}")
@@ -132,30 +130,33 @@ j52j {
132130

133131
/*
134132
START
135-
Set up the configuration to put natives in the jar
133+
Include native libraries for SDL3 in the jar.
136134
*/
137-
class NativeTarget(
135+
data class NativeTarget(
138136
val classifier: String,
139137
val fileExtension: String,
140138
val jnaPrefix: String,
141139
val fileName: String,
142-
configuration: String,
143-
) {
144-
val configuration = configurations.create("offlineNative$configuration")
145-
}
140+
val configurationName: String,
141+
)
142+
146143
val nativeTargets = listOf(
147-
NativeTarget(classifier = "linux-aarch64", fileExtension = "so", jnaPrefix = "linux-aarch64/", fileName = "libSDL3", configuration = "LinuxAarch64"),
148-
NativeTarget(classifier = "linux-x86_64", fileExtension = "so", jnaPrefix = "linux-x86-64/", fileName = "libSDL3", configuration = "LinuxX86_64"),
149-
NativeTarget(classifier = "macos-aarch64", fileExtension = "dylib", jnaPrefix = "darwin-aarch64/", fileName = "libSDL3", configuration = "MacArm"),
150-
NativeTarget(classifier = "macos-x86_64", fileExtension = "dylib", jnaPrefix = "darwin-x86-64/", fileName = "libSDL3", configuration = "MacIntel"),
151-
NativeTarget(classifier = "windows-x86_64", fileExtension = "dll", jnaPrefix = "win32-x86-64/", fileName = "SDL3", configuration = "WinX86_64"),
144+
NativeTarget(classifier = "linux-aarch64", fileExtension = "so", jnaPrefix = "linux-aarch64/", fileName = "libSDL3", configurationName = "offlineNativeLinuxAarch64"),
145+
NativeTarget(classifier = "linux-x86_64", fileExtension = "so", jnaPrefix = "linux-x86-64/", fileName = "libSDL3", configurationName = "offlineNativeLinuxX86_64"),
146+
NativeTarget(classifier = "macos-aarch64", fileExtension = "dylib", jnaPrefix = "darwin-aarch64/", fileName = "libSDL3", configurationName = "offlineNativeMacArm"),
147+
NativeTarget(classifier = "macos-x86_64", fileExtension = "dylib", jnaPrefix = "darwin-x86-64/", fileName = "libSDL3", configurationName = "offlineNativeMacIntel"),
148+
NativeTarget(classifier = "windows-x86_64", fileExtension = "dll", jnaPrefix = "win32-x86-64/", fileName = "SDL3", configurationName = "offlineNativeWinX86_64"),
152149
)
153150

151+
// Create configurations
152+
val nativeConfigurations = nativeTargets.associate { target ->
153+
target.configurationName to configurations.create(target.configurationName)
154+
}
154155
val nativeHashConfiguration = configurations.create("nativeHashes")
155156

156157
nativeTargets.forEach { target ->
157158
dependencies {
158-
target.configuration("dev.isxander:libsdl4j-natives:${property("deps.sdl3Target")}:${target.classifier}@${target.fileExtension}")
159+
nativeConfigurations[target.configurationName]!!("dev.isxander:libsdl4j-natives:${property("deps.sdl3Target")}:${target.classifier}@${target.fileExtension}")
159160
nativeHashConfiguration("dev.isxander:libsdl4j-natives:${property("deps.sdl3Target")}:${target.classifier}@${target.fileExtension}.md5")
160161
}
161162
}
@@ -166,12 +167,12 @@ val prepareNatives = tasks.register<Sync>("prepareNativeResources") {
166167
into(layout.buildDirectory.dir("generated-resources/sdl-natives"))
167168

168169
nativeTargets.forEach { target ->
169-
from(target.configuration) {
170+
from(configurations.named(target.configurationName)) {
170171
into(target.jnaPrefix)
171172
rename { "${target.fileName}.${target.fileExtension}" }
172173
}
173174
}
174-
from(nativeHashConfiguration) {
175+
from(configurations.named("nativeHashes")) {
175176
into("sdl3-hashes/")
176177
}
177178
}
@@ -187,7 +188,7 @@ tasks.processResources {
187188
}
188189
/*
189190
END
190-
Set up the configuration to put native hashes in the jar
191+
Include native libraries for SDL3 in the jar.
191192
*/
192193

193194

@@ -202,6 +203,12 @@ val releaseModVersion by tasks.registering {
202203
}
203204
createActiveTask(releaseModVersion)
204205

206+
if (project.isPublishingEnabled) {
207+
rootProject.tasks.named("releaseModVersions") {
208+
dependsOn(releaseModVersion)
209+
}
210+
}
211+
205212
val finalJarTasks = listOf(
206213
modstitch.finalJarTask,
207214
)
@@ -237,7 +244,7 @@ publishMods {
237244
val stableMCVersions = versionList("pub.stableMC")
238245

239246
val modrinthId: String by project
240-
if (modrinthId.isNotBlank() && hasProperty("modrinth.token") && !isExperimentalBuild) {
247+
if (modrinthId.isNotBlank() && hasProperty("modrinth.token")) {
241248
modrinth {
242249
projectId.set(modrinthId)
243250
accessToken.set(findProperty("modrinth.token")?.toString())
@@ -256,7 +263,7 @@ publishMods {
256263
}
257264

258265
val curseforgeId: String by project
259-
if (curseforgeId.isNotBlank() && hasProperty("curseforge.token") && !isExperimentalBuild) {
266+
if (curseforgeId.isNotBlank() && hasProperty("curseforge.token")) {
260267
curseforge {
261268
projectId = curseforgeId
262269
projectSlug = findProperty("curseforgeSlug")!!.toString()

buildSrc/build.gradle.kts

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,34 @@ plugins {
44
}
55

66
repositories {
7-
mavenCentral()
8-
gradlePluginPortal()
9-
maven("https://maven.fabricmc.net")
10-
maven("https://maven.neoforged.net/releases")
11-
exclusiveContent {
12-
forRepositories(
13-
maven("https://maven.kikugie.dev/releases"),
14-
maven("https://maven.kikugie.dev/snapshots")
15-
)
16-
filter {
17-
includeGroupAndSubgroups("dev.kikugie")
7+
fun strictMaven(url: String, action: Action<in InclusiveRepositoryContentDescriptor>) =
8+
exclusiveContent {
9+
forRepository { maven(url) }
10+
filter(action)
1811
}
12+
13+
gradlePluginPortal()
14+
mavenCentral()
15+
strictMaven("https://maven.fabricmc.net") {
16+
includeGroupAndSubgroups("net.fabricmc")
17+
includeGroup("fabric-loom")
18+
}
19+
strictMaven("https://maven.neoforged.net/releases/") {
20+
includeGroupAndSubgroups("net.neoforged")
21+
}
22+
strictMaven("https://maven.kikugie.dev/releases") {
23+
includeGroupAndSubgroups("dev.kikugie")
24+
}
25+
strictMaven("https://quiltmc.org/repository/release") {
26+
includeGroupAndSubgroups("org.quiltmc")
1927
}
2028
}
2129

2230
dependencies {
2331
fun plugin(id: String, version: String) = "$id:$id.gradle.plugin:$version"
2432

25-
implementation(plugin("dev.isxander.modstitch.base", "0.6.2-unstable"))
26-
implementation(plugin("dev.kikugie.stonecutter", "0.7.1"))
27-
implementation(plugin("fabric-loom", "1.10.5"))
28-
implementation(plugin("net.neoforged.moddev", "2.0.80"))
33+
implementation(plugin("dev.isxander.modstitch.base", "0.7.0-unstable"))
34+
implementation(plugin("dev.kikugie.stonecutter", "0.7.6"))
35+
implementation(plugin("fabric-loom", "1.11.4"))
36+
implementation(plugin("net.neoforged.moddev", "2.0.103"))
2937
}

buildSrc/src/main/kotlin/dev/isxander/controlify/Project.kt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ package dev.isxander.controlify
22

33
import dev.isxander.modstitch.base.extensions.ModstitchExtension
44
import dev.kikugie.stonecutter.build.StonecutterBuildExtension
5+
import org.gradle.api.Action
56
import org.gradle.api.Project
7+
import org.gradle.api.artifacts.dsl.RepositoryHandler
8+
import org.gradle.api.artifacts.repositories.InclusiveRepositoryContentDescriptor
69
import org.gradle.api.tasks.TaskProvider
710
import org.gradle.kotlin.dsl.*
811

@@ -19,8 +22,8 @@ val Project.modVersion: String
1922
get() = prop("modVersion")!!
2023
val Project.mcVersion: String
2124
get() = prop("mcVersion")!!
22-
val Project.isExperimentalBuild: Boolean
23-
get() = "exp" in stonecutter.current.project
25+
val Project.isPublishingEnabled: Boolean
26+
get() = prop("pub.enabled") { "true" }!!.toBooleanStrict()
2427

2528
fun <T> Project.propMap(property: String, required: Boolean = false, ifNull: () -> String? = { null }, block: (String) -> T?): T? {
2629
return ((System.getenv(property) ?: branchProj.findProperty(property)?.toString())
@@ -64,4 +67,10 @@ fun Project.createActiveTask(
6467
return activeTaskName
6568
}
6669

70+
fun RepositoryHandler.strictMaven(url: String, action: Action<in InclusiveRepositoryContentDescriptor>) =
71+
exclusiveContent {
72+
forRepository { maven(url) }
73+
filter(action)
74+
}
75+
6776

0 commit comments

Comments
 (0)