Skip to content

Commit 7174e21

Browse files
committed
Merge pull request godotengine#96967 from m4gr3d/update_android_editor_flavors
[Android editor] Update the Android editor flavors
2 parents 4106648 + 741efa6 commit 7174e21

File tree

10 files changed

+32
-28
lines changed

10 files changed

+32
-28
lines changed

.github/workflows/android_builds.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
run: |
8787
cd platform/android/java
8888
./gradlew generateGodotEditor
89-
./gradlew generateGodotMetaEditor
89+
./gradlew generateGodotHorizonOSEditor
9090
cd ../../..
9191
ls -l bin/android_editor_builds/
9292

platform/android/java/build.gradle

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ allprojects {
2525
ext {
2626
supportedAbis = ["arm32", "arm64", "x86_32", "x86_64"]
2727
supportedFlavors = ["editor", "template"]
28-
supportedEditorVendors = ["google", "meta"]
28+
supportedAndroidDistributions = ["android", "horizonos"]
2929
supportedFlavorsBuildTypes = [
3030
"editor": ["dev", "debug", "release"],
3131
"template": ["dev", "debug", "release"]
@@ -94,17 +94,17 @@ def templateExcludedBuildTask() {
9494
/**
9595
* Generates the build tasks for the given flavor
9696
* @param flavor Must be one of the supported flavors ('template' / 'editor')
97-
* @param editorVendor Must be one of the supported editor vendors ('google' / 'meta')
97+
* @param androidDistro Must be one of the supported Android distributions ('android' / 'horizonos')
9898
*/
99-
def generateBuildTasks(String flavor = "template", String editorVendor = "google") {
99+
def generateBuildTasks(String flavor = "template", String androidDistro = "android") {
100100
if (!supportedFlavors.contains(flavor)) {
101101
throw new GradleException("Invalid build flavor: $flavor")
102102
}
103-
if (!supportedEditorVendors.contains(editorVendor)) {
104-
throw new GradleException("Invalid editor vendor: $editorVendor")
103+
if (!supportedAndroidDistributions.contains(androidDistro)) {
104+
throw new GradleException("Invalid Android distribution: $androidDistro")
105105
}
106106

107-
String capitalizedEditorVendor = editorVendor.capitalize()
107+
String capitalizedAndroidDistro = androidDistro.capitalize()
108108
def buildTasks = []
109109

110110
// Only build the binary files for which we have native shared libraries unless we intend
@@ -170,28 +170,28 @@ def generateBuildTasks(String flavor = "template", String editorVendor = "google
170170
}
171171
} else {
172172
// Copy the generated editor apk to the bin directory.
173-
String copyEditorApkTaskName = "copyEditor${capitalizedEditorVendor}${capitalizedTarget}ApkToBin"
173+
String copyEditorApkTaskName = "copyEditor${capitalizedAndroidDistro}${capitalizedTarget}ApkToBin"
174174
if (tasks.findByName(copyEditorApkTaskName) != null) {
175175
buildTasks += tasks.getByName(copyEditorApkTaskName)
176176
} else {
177177
buildTasks += tasks.create(name: copyEditorApkTaskName, type: Copy) {
178-
dependsOn ":editor:assemble${capitalizedEditorVendor}${capitalizedTarget}"
179-
from("editor/build/outputs/apk/${editorVendor}/${target}")
178+
dependsOn ":editor:assemble${capitalizedAndroidDistro}${capitalizedTarget}"
179+
from("editor/build/outputs/apk/${androidDistro}/${target}")
180180
into(androidEditorBuildsDir)
181-
include("android_editor-${editorVendor}-${target}*.apk")
181+
include("android_editor-${androidDistro}-${target}*.apk")
182182
}
183183
}
184184

185185
// Copy the generated editor aab to the bin directory.
186-
String copyEditorAabTaskName = "copyEditor${capitalizedEditorVendor}${capitalizedTarget}AabToBin"
186+
String copyEditorAabTaskName = "copyEditor${capitalizedAndroidDistro}${capitalizedTarget}AabToBin"
187187
if (tasks.findByName(copyEditorAabTaskName) != null) {
188188
buildTasks += tasks.getByName(copyEditorAabTaskName)
189189
} else {
190190
buildTasks += tasks.create(name: copyEditorAabTaskName, type: Copy) {
191-
dependsOn ":editor:bundle${capitalizedEditorVendor}${capitalizedTarget}"
192-
from("editor/build/outputs/bundle/${editorVendor}${capitalizedTarget}")
191+
dependsOn ":editor:bundle${capitalizedAndroidDistro}${capitalizedTarget}"
192+
from("editor/build/outputs/bundle/${androidDistro}${capitalizedTarget}")
193193
into(androidEditorBuildsDir)
194-
include("android_editor-${editorVendor}-${target}*.aab")
194+
include("android_editor-${androidDistro}-${target}*.aab")
195195
}
196196
}
197197
}
@@ -204,27 +204,27 @@ def generateBuildTasks(String flavor = "template", String editorVendor = "google
204204
}
205205

206206
/**
207-
* Generate the Godot Editor Android binaries.
207+
* Generate the Godot Editor binaries for Android devices.
208208
*
209209
* Note: Unless the 'generateNativeLibs` argument is specified, the Godot 'tools' shared libraries
210210
* must have been generated (via scons) prior to running this gradle task.
211211
* The task will only build the binaries for which the shared libraries is available.
212212
*/
213213
task generateGodotEditor {
214214
gradle.startParameter.excludedTaskNames += templateExcludedBuildTask()
215-
dependsOn = generateBuildTasks("editor", "google")
215+
dependsOn = generateBuildTasks("editor", "android")
216216
}
217217

218218
/**
219-
* Generate the Godot Editor Android binaries for Meta devices.
219+
* Generate the Godot Editor binaries for HorizonOS devices.
220220
*
221221
* Note: Unless the 'generateNativeLibs` argument is specified, the Godot 'tools' shared libraries
222222
* must have been generated (via scons) prior to running this gradle task.
223223
* The task will only build the binaries for which the shared libraries is available.
224224
*/
225-
task generateGodotMetaEditor {
225+
task generateGodotHorizonOSEditor {
226226
gradle.startParameter.excludedTaskNames += templateExcludedBuildTask()
227-
dependsOn = generateBuildTasks("editor", "meta")
227+
dependsOn = generateBuildTasks("editor", "horizonos")
228228
}
229229

230230
/**

platform/android/java/editor/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,14 @@ android {
145145
}
146146
}
147147

148-
flavorDimensions = ["vendor"]
148+
flavorDimensions = ["android_distribution"]
149149
productFlavors {
150-
google {
151-
dimension "vendor"
150+
android {
151+
dimension "android_distribution"
152152
missingDimensionStrategy 'products', 'editor'
153153
}
154-
meta {
155-
dimension "vendor"
154+
horizonos {
155+
dimension "android_distribution"
156156
missingDimensionStrategy 'products', 'editor'
157157
ndk {
158158
//noinspection ChromeOsAbiSupport
@@ -176,5 +176,5 @@ dependencies {
176176
implementation "org.bouncycastle:bcprov-jdk15to18:1.77"
177177

178178
// Meta dependencies
179-
metaImplementation "org.godotengine:godot-openxr-vendors-meta:3.0.0-stable"
179+
horizonosImplementation "org.godotengine:godot-openxr-vendors-meta:3.0.0-stable"
180180
}

platform/android/java/editor/src/google/java/org/godotengine/editor/GodotEditor.kt renamed to platform/android/java/editor/src/android/java/org/godotengine/editor/GodotEditor.kt

File renamed without changes.

platform/android/java/editor/src/meta/AndroidManifest.xml renamed to platform/android/java/editor/src/horizonos/AndroidManifest.xml

File renamed without changes.

platform/android/java/editor/src/meta/assets/vr_splash.png renamed to platform/android/java/editor/src/horizonos/assets/vr_splash.png

File renamed without changes.

platform/android/java/editor/src/meta/java/org/godotengine/editor/GodotEditor.kt renamed to platform/android/java/editor/src/horizonos/java/org/godotengine/editor/GodotEditor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import org.godotengine.godot.utils.isNativeXRDevice
3636
/**
3737
* Primary window of the Godot Editor.
3838
*
39-
* This is the implementation of the editor used when running on Meta devices.
39+
* This is the implementation of the editor used when running on HorizonOS devices.
4040
*/
4141
open class GodotEditor : BaseGodotEditor() {
4242

platform/android/java/editor/src/meta/java/org/godotengine/editor/GodotXRGame.kt renamed to platform/android/java/editor/src/horizonos/java/org/godotengine/editor/GodotXRGame.kt

File renamed without changes.

platform/android/java/editor/src/main/java/org/godotengine/editor/BaseGodotEditor.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,10 @@ abstract class BaseGodotEditor : GodotActivity() {
517517
return isNativeXRDevice();
518518
}
519519

520+
if (featureTag == "horizonos") {
521+
return isHorizonOSDevice()
522+
}
523+
520524
return false
521525
}
522526
}

platform/android/java/lib/src/org/godotengine/godot/utils/DeviceUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ package org.godotengine.godot.utils
3838
import android.os.Build
3939

4040
/**
41-
* Returns true if running on Meta's Horizon OS.
41+
* Returns true if running on Meta Horizon OS.
4242
*/
4343
fun isHorizonOSDevice(): Boolean {
4444
return "Oculus".equals(Build.BRAND, true)

0 commit comments

Comments
 (0)