Skip to content

Commit

Permalink
Update the plugin to Godot v2 Android plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
m4gr3d committed Aug 18, 2023
1 parent c1db954 commit 44c4458
Show file tree
Hide file tree
Showing 28 changed files with 877 additions and 31 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-addon-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ jobs:
cp aar/CHANGES.md asset/addons/godotopenxr/GodotOpenXRLoaders_CHANGES.md
- name: Adding vendor licences
run: |
cp aar/godotopenxrmeta/LICENSE.txt asset/addons/godotopenxr/export/meta/
cp aar/godotopenxrpico/src/main/jniLibs/arm64-v8a/README.md asset/addons/godotopenxr/export/pico/LICENSE.md
cp aar/godotopenxrkhr/LICENSE asset/addons/godotopenxr/export/khr/LICENSE
cp aar/godotopenxrmeta/LICENSE.txt asset/addons/godotopenxr/.export/meta/
cp aar/godotopenxrpico/src/main/jniLibs/arm64-v8a/README.md asset/addons/godotopenxr/.export/pico/LICENSE.md
cp aar/godotopenxrkhr/LICENSE asset/addons/godotopenxr/.export/khr/LICENSE
- name: Create Godot OpenXR loader addon artifact
uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## 2.0.0
- Update to the new Godot 4.2 Android plugin packaging format
- Update the plugin to Godot v2 Android plugin
- Update to the Godot 4.2 Android library

## 1.1.0
- Update Meta OpenXR loader to version 54
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ buildscript {
google()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/"}
}
dependencies {
classpath "com.android.tools.build:gradle:$versions.gradlePluginVersion"
Expand Down
10 changes: 8 additions & 2 deletions config.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
final snapshotGodotAndroidLib = "io.github.m4gr3d:godot:4.2.0.dev-SNAPSHOT"
final stableGodotAndroidLib = "org.godotengine:godot:4.1.0.stable"

ext {
versions = [
gradlePluginVersion: '7.2.1',
gradlePluginVersion: '7.4.0',
compileSdk : 33,
minSdk : 21,
targetSdk : 33,
godotLibVersion : '4.1.0.stable',
javaVersion : JavaVersion.VERSION_11,
nexusPublishVersion : '1.3.0'
]

libraries = [
godotAndroidLib: snapshotGodotAndroidLib,
]
}

// Parse the release version from the gradle project properties (e.g: -Prelease_version=<version>)
Expand Down
2 changes: 1 addition & 1 deletion demo/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Godot 4+ specific ignores
.godot/
/addons/godotopenxr/export/*/*.aar
/addons/godotopenxr/.bin/*/*.aar
/android/
File renamed without changes.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func _get_name() -> String:
# Path to the Android library aar file
# If this is not available, we fall back to the maven central dependency
func _get_android_aar_file_path(debug: bool) -> String:
return "res://addons/godotopenxr/export/" + _vendor + "/godotopenxr" + _vendor + "-" + ("debug.aar" if debug else "release.aar")
return "res://addons/godotopenxr/.bin/" + _vendor + "/godotopenxr" + _vendor + "-" + ("debug.aar" if debug else "release.aar")


# Maven central dependency used as fall back when the Android library aar file is not available
Expand Down Expand Up @@ -114,7 +114,7 @@ func _get_android_libraries(platform, debug) -> PackedStringArray:
if not _supports_platform(platform):
return PackedStringArray()

if _is_vendor_plugin_enabled() and _is_android_aar_file_available(debug):
if _is_vendor_plugin_enabled() and _is_android_aar_file_available(debug):
return PackedStringArray([_get_android_aar_file_path(debug)])

return PackedStringArray()
2 changes: 1 addition & 1 deletion demo/addons/godotopenxr/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ name="GodotOpenXR"
description="Godot OpenXR loader plugin"
author="https://github.com/GodotVR/godot_openxr_loaders/blob/master/CONTRIBUTORS.md"
version="2.0.0-dev"
script="export/godot_openxr_editor_plugin.gd"
script=".export/godot_openxr_editor_plugin.gd"
2 changes: 2 additions & 0 deletions demo/export_presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ package/signed=true
package/app_category=2
package/retain_data_on_uninstall=false
package/exclude_from_recents=false
package/show_in_android_tv=false
package/show_as_launcher_app=false
launcher_icons/main_192x192=""
launcher_icons/adaptive_foreground_432x432=""
launcher_icons/adaptive_background_432x432=""
Expand Down
835 changes: 835 additions & 0 deletions demo/openxr_action_map.tres

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions godotopenxrkhr/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ android {
}

dependencies {
compileOnly "org.godotengine:godot:$versions.godotLibVersion"
compileOnly libraries.godotAndroidLib
}

task copyDebugAARToAddons(type: Copy) {
from 'build/outputs/aar'
include 'godotopenxrkhr-debug.aar'
into '../demo/addons/godotopenxr/export/khr'
into '../demo/addons/godotopenxr/.bin/khr'
}

task copyReleaseAARToAddons(type: Copy) {
from 'build/outputs/aar'
include 'godotopenxrkhr-release.aar'
into '../demo/addons/godotopenxr/export/khr'
into '../demo/addons/godotopenxr/.bin/khr'
}

assemble.finalizedBy(copyDebugAARToAddons)
Expand Down
5 changes: 2 additions & 3 deletions godotopenxrkhr/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.godotengine.openxrloaders.khr"
xmlns:tools="http://schemas.android.com/tools">
package="org.godotengine.openxrloaders.khr">

<!-- Tell the system this app works in either 3dof or 6dof mode -->
<uses-feature
Expand All @@ -22,7 +21,7 @@

<application>
<meta-data
android:name="org.godotengine.plugin.v1.GodotOpenXRKHR"
android:name="org.godotengine.plugin.v2.GodotOpenXRKHR"
android:value="org.godotengine.openxrloaders.khr.GodotOpenXRKHR" />
</application>

Expand Down
6 changes: 3 additions & 3 deletions godotopenxrlynx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ android {
}

dependencies {
compileOnly "org.godotengine:godot:$versions.godotLibVersion"
compileOnly libraries.godotAndroidLib
}

task copyDebugAARToAddons(type: Copy) {
from 'build/outputs/aar'
include 'godotopenxrlynx-debug.aar'
into '../demo/addons/godotopenxr/export/lynx'
into '../demo/addons/godotopenxr/.bin/lynx'
}

task copyReleaseAARToAddons(type: Copy) {
from 'build/outputs/aar'
include 'godotopenxrlynx-release.aar'
into '../demo/addons/godotopenxr/export/lynx'
into '../demo/addons/godotopenxr/.bin/lynx'
}

assemble.finalizedBy(copyDebugAARToAddons)
Expand Down
7 changes: 3 additions & 4 deletions godotopenxrlynx/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.godotengine.openxrloaders.lynx"
xmlns:tools="http://schemas.android.com/tools">
package="org.godotengine.openxrloaders.lynx">

<uses-permission android:name="org.khronos.openxr.permission.OPENXR_SYSTEM" />

Expand All @@ -19,10 +18,10 @@

<application>
<meta-data
android:name="org.godotengine.plugin.v1.GodotOpenXRLynx"
android:name="org.godotengine.plugin.v2.GodotOpenXRLynx"
android:value="org.godotengine.openxrloaders.khr.GodotOpenXRLynx" />

<meta-data android:name="handtracking" android:value="1" />
</application>

</manifest>
</manifest>
6 changes: 3 additions & 3 deletions godotopenxrmeta/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ android {
}

dependencies {
compileOnly "org.godotengine:godot:$versions.godotLibVersion"
compileOnly libraries.godotAndroidLib
}

task copyDebugAARToAddons(type: Copy) {
from 'build/outputs/aar'
include 'godotopenxrmeta-debug.aar'
into '../demo/addons/godotopenxr/export/meta'
into '../demo/addons/godotopenxr/.bin/meta'
}

task copyReleaseAARToAddons(type: Copy) {
from 'build/outputs/aar'
include 'godotopenxrmeta-release.aar'
into '../demo/addons/godotopenxr/export/meta'
into '../demo/addons/godotopenxr/.bin/meta'
}

assemble.finalizedBy(copyDebugAARToAddons)
Expand Down
2 changes: 1 addition & 1 deletion godotopenxrmeta/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<application>
<meta-data
android:name="org.godotengine.plugin.v1.GodotOpenXRMeta"
android:name="org.godotengine.plugin.v2.GodotOpenXRMeta"
android:value="org.godotengine.openxrloaders.meta.GodotOpenXRMeta" />

<meta-data
Expand Down
6 changes: 3 additions & 3 deletions godotopenxrpico/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ android {
}

dependencies {
compileOnly "org.godotengine:godot:$versions.godotLibVersion"
compileOnly libraries.godotAndroidLib
}

task copyDebugAARToAddons(type: Copy) {
from 'build/outputs/aar'
include 'godotopenxrpico-debug.aar'
into '../demo/addons/godotopenxr/export/pico'
into '../demo/addons/godotopenxr/.bin/pico'
}

task copyReleaseAARToAddons(type: Copy) {
from 'build/outputs/aar'
include 'godotopenxrpico-release.aar'
into '../demo/addons/godotopenxr/export/pico'
into '../demo/addons/godotopenxr/.bin/pico'
}

assemble.finalizedBy(copyDebugAARToAddons)
Expand Down
2 changes: 1 addition & 1 deletion godotopenxrpico/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<application>
<!-- Godot plugin registration -->
<meta-data android:name="org.godotengine.plugin.v1.GodotOpenXRPico"
<meta-data android:name="org.godotengine.plugin.v2.GodotOpenXRPico"
android:value="org.godotengine.openxrloaders.pico.GodotOpenXRPico" />

<!-- Enable VR mode on Pico headsets -->
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Mar 11 11:10:12 NZDT 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
2 changes: 2 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/"}
}
}
rootProject.name = "GodotOpenXRLoaders"
Expand Down

0 comments on commit 44c4458

Please sign in to comment.