Skip to content

Commit b58fba3

Browse files
authored
Fixed frame rotation on iOS (#28)
1 parent 3dcbb92 commit b58fba3

20 files changed

Lines changed: 236 additions & 161 deletions

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ body:
7878
label: Plugin Version
7979
description: What version of the plugin are you running?
8080
options:
81-
- "1.0"
8281
- "1.1"
82+
- "1.0"
8383
- Other
84-
default: 1
84+
default: 0
8585
validations:
8686
required: true
8787
- type: dropdown

.github/ISSUE_TEMPLATE/feature_request.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ body:
4040
label: Plugin Version
4141
description: What version of the plugin are you running?
4242
options:
43-
- "1.0"
4443
- "1.1"
44+
- "1.0"
4545
- Other
46-
default: 1
46+
default: 0
4747
validations:
4848
required: true
4949
- type: textarea

addon/addon-build.gradle.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ tasks {
152152
@Suppress("UNCHECKED_CAST")
153153
val iosLinkerFlags = extra["iosLinkerFlags"] as List<String>
154154

155+
@Suppress("UNCHECKED_CAST")
156+
val iosBundleFiles = extra["iosBundleFiles"] as List<String>
157+
155158
@Suppress("UNCHECKED_CAST")
156159
val iosSpmDependencies = extra["iosSpmDependencies"] as List<SpmDependency>
157160

@@ -209,6 +212,7 @@ tasks {
209212
put("iosFrameworks", iosFrameworks.toQuotedString())
210213
put("iosEmbeddedFrameworks", iosEmbeddedFrameworks.toQuotedString())
211214
put("iosLinkerFlags", iosLinkerFlags.toQuotedString())
215+
put("iosBundleFiles", iosBundleFiles.toQuotedString())
212216
put("spmDependencies", iosSpmDependencies.toGdscriptFormat())
213217
}
214218

@@ -239,6 +243,7 @@ tasks {
239243
inputs.property("iosFrameworks", iosFrameworks.joinToString())
240244
inputs.property("iosEmbeddedFrameworks", iosEmbeddedFrameworks.joinToString())
241245
inputs.property("iosLinkerFlags", iosLinkerFlags.joinToString())
246+
inputs.property("iosBundleFiles", iosBundleFiles.joinToString())
242247
inputs.property("iosSpmDependencies", iosSpmDependencies.joinToString())
243248

244249
outputs.dir("$outputDir/addons/GMPShared")
@@ -273,6 +278,7 @@ tasks {
273278
put("iosFrameworks", iosFrameworks.toQuotedString())
274279
put("iosEmbeddedFrameworks", iosEmbeddedFrameworks.toQuotedString())
275280
put("iosLinkerFlags", iosLinkerFlags.toQuotedString())
281+
put("iosBundleFiles", iosBundleFiles.toQuotedString())
276282
put("spmDependencies", iosSpmDependencies.toGdscriptFormat())
277283
}
278284

@@ -303,6 +309,7 @@ tasks {
303309
inputs.property("iosFrameworks", iosFrameworks.joinToString())
304310
inputs.property("iosEmbeddedFrameworks", iosEmbeddedFrameworks.joinToString())
305311
inputs.property("iosLinkerFlags", iosLinkerFlags.joinToString())
312+
inputs.property("iosBundleFiles", iosBundleFiles.joinToString())
306313
inputs.property("iosSpmDependencies", iosSpmDependencies.joinToString())
307314

308315
outputs.dir("$outputDir/addons/${pluginConfig.pluginName}")

android/android-build.gradle.kts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,12 +336,31 @@ val testRuntimeOnlyDependencies =
336336
.map { findLibrary(it).get().get() }
337337
}
338338

339+
val artifactType = Attribute.of("artifactType", String::class.java)
340+
339341
dependencies {
340342
"rewrite"(libs.rewrite.static.analysis)
341343
implementation("godot:godot-lib:${godotConfig.godotVersion}.${godotConfig.godotReleaseType}@aar")
342344
androidDependencies.forEach { implementation(it) }
343345
testDependencies.forEach { testImplementation(it) }
344346
testRuntimeOnlyDependencies.forEach { testRuntimeOnly(it) }
347+
348+
attributesSchema {
349+
attribute(artifactType) {
350+
disambiguationRules.add(JarFirstRule::class.java)
351+
}
352+
}
353+
}
354+
355+
// Helper class to prioritize JARs when multiple variants match
356+
abstract class JarFirstRule : AttributeDisambiguationRule<String> {
357+
override fun execute(details: MultipleCandidatesDetails<String>) {
358+
if (details.candidateValues.contains("jar")) {
359+
details.closestMatch("jar")
360+
} else if (details.candidateValues.contains("android-classes-jar")) {
361+
details.closestMatch("android-classes-jar")
362+
}
363+
}
345364
}
346365

347366
// -- Helpers -------------------------------------------------------------------
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44

55
// Compiles all convention plugins (precompiled script plugins) in
6-
// src/main/kotlin/*.gradle.kts and makes them - together with their
6+
// src/main/java/*.gradle.kts and makes them - together with their
77
// runtime dependencies - available to every subproject that applies them.
88
//
99
// Versions are kept in sync with gradle/libs.versions.toml via the
@@ -26,3 +26,12 @@ sourceSets {
2626
java.srcDirs("src/main/kotlin")
2727
}
2828
}
29+
30+
kotlin {
31+
jvmToolchain(17)
32+
}
33+
34+
tasks.withType<JavaCompile>().configureEach {
35+
targetCompatibility = "17"
36+
sourceCompatibility = "17"
37+
}

common/build-logic/settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ dependencyResolutionManagement {
2020
}
2121

2222
rootProject.name = "build-logic"
23+
rootProject.buildFileName = "logic.gradle.kts"
File renamed without changes.
File renamed without changes.

common/build-logic/src/main/kotlin/IosConfig.kt renamed to common/build-logic/src/main/java/IosConfig.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import kotlinx.serialization.decodeFromString
3939
* | `frameworks` | [frameworks] | System framework names to link, e.g. `["Foundation.framework"]` |
4040
* | `embedded_frameworks` | [embeddedFrameworks] | Frameworks to embed in the app bundle (may be empty) |
4141
* | `flags` | [linkerFlags] | Extra linker flags, e.g. `["-ObjC"]` |
42+
* | `bundle_files` | [bundleFiles] | Files to include in the app bundle, e.g. `["res://afile.task"]` |
4243
*
4344
* Comma-separated properties (`frameworks`, `embedded_frameworks`, `flags`) are
4445
* split into [List]s at load time - blank entries are dropped - so consumers never
@@ -91,6 +92,13 @@ data class IosConfig(
9192
* Empty when no extra flags are required.
9293
*/
9394
val linkerFlags: List<String>,
95+
/**
96+
* Files to include in the app bundle.
97+
*
98+
* Parsed from the comma-separated `bundle_files` key in `ios.properties`.
99+
* Empty when no extra files are required.
100+
*/
101+
val bundleFiles: List<String>,
94102
/**
95103
* Swift Package Manager dependencies decoded from `ios/config/spm_dependencies.json`.
96104
*
@@ -155,6 +163,7 @@ data class IosConfig(
155163
frameworks = props.splitList("frameworks"),
156164
embeddedFrameworks = props.splitList("embedded_frameworks"),
157165
linkerFlags = props.splitList("flags"),
166+
bundleFiles = props.splitList("bundle_files"),
158167
spmDependencies = spmDependencies,
159168
testPlatform = props.require("test_platform"),
160169
testDestinationName = props.require("test_destination_name"),
File renamed without changes.

0 commit comments

Comments
 (0)