Skip to content

Commit 8198f06

Browse files
committed
Add Meta prebuilt APK install tool
1 parent fa3242f commit 8198f06

File tree

15 files changed

+13599
-665
lines changed

15 files changed

+13599
-665
lines changed

.github/workflows/build-addon-on-push.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
matrix:
2323
include:
2424
- name: 🐧 Linux (x86_64)
25-
os: ubuntu-20.04
25+
os: ubuntu-22.04
2626
platform: linux
2727
flags: arch=x86_64
2828
artifact_name: godotmetatoolkit-build-files-linux-x86_64
@@ -42,7 +42,7 @@ jobs:
4242
artifact_path: godot_meta_toolkit/demo/addons/godot_meta_toolkit/.bin/macos/*/*.framework
4343
cache-name: macos-universal
4444
- name: 🤖 Android (arm64)
45-
os: ubuntu-20.04
45+
os: ubuntu-22.04
4646
platform: android
4747
flags: arch=arm64
4848
artifact_name: godotmetatoolkit-build-files-android
@@ -122,7 +122,7 @@ jobs:
122122
123123
asset:
124124
name: Assembling the asset
125-
runs-on: ubuntu-20.04
125+
runs-on: ubuntu-22.04
126126
needs: build
127127

128128
steps:
@@ -166,9 +166,8 @@ jobs:
166166
run: |
167167
cd godot_meta_toolkit
168168
./gradlew build
169-
scons --directory=thirdparty/godot platform=android target=template_debug arch=arm64
170-
scons --directory=thirdparty/godot platform=android target=template_release arch=arm64
171-
./gradlew generatePrebuiltApks
169+
git clone --branch 4.4.1-stable https://github.com/godotengine/godot.git
170+
./gradlew generatePrebuiltApks -Pgodot_dir=godot
172171
cd ..
173172
- name: Create Godot Meta Toolkit Addon
174173
run: |

.github/workflows/static_checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on: [push, pull_request]
55
jobs:
66
static-checks:
77
name: Formatting (clang-format, file format)
8-
runs-on: ubuntu-20.04
8+
runs-on: ubuntu-22.04
99
steps:
1010
- name: Checkout
1111
uses: actions/checkout@v4

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
[submodule "thirdparty/godot-cpp"]
22
path = thirdparty/godot-cpp
33
url = https://github.com/godotengine/godot-cpp
4-
[submodule "thirdparty/godot"]
5-
path = thirdparty/godot
6-
url = https://github.com/godotengine/godot.git

build.gradle

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ plugins {}
1919
apply from: 'config.gradle'
2020

2121
ext {
22-
addonPrebuiltDir = "demo/addons/godot_meta_toolkit/.build_template/prebuilt"
23-
24-
godotDir = "thirdparty/godot"
22+
godotDir = project.hasProperty("godot_dir") ? project.property("godot_dir") : ""
2523
godotJavaDir = "${godotDir}/platform/android/java/"
2624

2725
godotAppStandardManifestDir = "${godotJavaDir}/app/src/standard/"
@@ -57,13 +55,10 @@ task buildToolkit {
5755
}
5856

5957
/**
60-
* Generate the addon by building the 'toolkit' module and the prebuilt apks.
58+
* Generate the addon by building the 'toolkit' module
6159
*/
6260
task generateAddon {
6361
dependsOn buildToolkit
64-
65-
// Generate the prebuilt apks
66-
dependsOn ':generatePrebuiltApks'
6762
}
6863

6964
/*
@@ -208,15 +203,17 @@ task cleanPrebuiltApks(type: Delete) {
208203
}
209204
}
210205

211-
delete(godotAppStandardManifestDir)
206+
delete "meta-export-template.zip"
212207

213-
delete(addonPrebuiltDir)
208+
if (godotDir != "") {
209+
delete(godotAppStandardManifestDir)
214210

215-
tasks.create(name: "cleanGodot", type: Exec) {
216-
executable gradlewExecutable.absolutePath
217-
args "-p", godotJavaDir, "clean"
211+
tasks.create(name: "cleanGodot", type: Exec) {
212+
executable gradlewExecutable.absolutePath
213+
args "-p", godotJavaDir, "clean"
214+
}
215+
dependsOn 'cleanGodot'
218216
}
219-
dependsOn 'cleanGodot'
220217
}
221218

222219
/**
@@ -228,16 +225,17 @@ task copyPrebuiltManifestToGodotApp(type: Copy) {
228225
file(godotAppStandardManifestDir).mkdirs()
229226

230227
from "./prebuilt/AndroidManifest.xml"
231-
into "./thirdparty/godot/platform/android/java/app/src/standard/"
228+
into godotAppStandardManifestDir
232229
}
233230

234231
/**
235-
* Copy the generated prebuilt apks to the addon directory.
232+
* Zip the generated prebuilt apks
236233
*/
237-
task copyPrebuiltApksToAddon(type: Copy) {
238-
from godotAppOutputDir
239-
into addonPrebuiltDir
234+
task zipPrebuiltApks(type: Zip) {
235+
from(godotAppOutputDir)
240236
include '**/*.apk'
237+
archiveFileName = "meta-export-template.zip"
238+
destinationDirectory = project.rootDir
241239
}
242240

243241
/**
@@ -257,11 +255,21 @@ task generatePrebuiltApks() {
257255

258256
if (sconsExecutableFile != null && sconsExecutableFile.exists()) {
259257
tasks.create(name: "buildGodotAndroidArm64Debug", type: Exec) {
258+
doFirst {
259+
if (godotDir == "") {
260+
throw new GradleException("godot_dir property is required")
261+
}
262+
}
260263
executable sconsExecutableFile.absolutePath
261264
args "--directory=${godotDir}", "platform=android", "target=template_debug", "arch=arm64"
262265
}
263266

264267
tasks.create(name: "buildGodotAndroidArm64Release", type: Exec) {
268+
doFirst {
269+
if (godotDir == "") {
270+
throw new GradleException("godot_dir property is required")
271+
}
272+
}
265273
executable sconsExecutableFile.absolutePath
266274
args "--directory=${godotDir}", "platform=android", "target=template_release", "arch=arm64"
267275
}
@@ -274,6 +282,11 @@ task generatePrebuiltApks() {
274282
if (sconsExecutableFile != null && sconsExecutableFile.exists()) {
275283
dependsOn 'buildGodotAndroidArm64Debug'
276284
}
285+
doFirst {
286+
if (godotDir == "") {
287+
throw new GradleException("godot_dir property is required")
288+
}
289+
}
277290
executable gradlewExecutable.absolutePath
278291
args "-p",
279292
godotJavaDir,
@@ -289,6 +302,11 @@ task generatePrebuiltApks() {
289302
if (sconsExecutableFile != null && sconsExecutableFile.exists()) {
290303
dependsOn 'buildGodotAndroidArm64Release'
291304
}
305+
doFirst {
306+
if (godotDir == "") {
307+
throw new GradleException("godot_dir property is required")
308+
}
309+
}
292310
executable gradlewExecutable.absolutePath
293311
args "-p",
294312
godotJavaDir,
@@ -300,5 +318,5 @@ task generatePrebuiltApks() {
300318
dependsOn 'assemblePrebuiltDebugApk'
301319
dependsOn 'assemblePrebuiltReleaseApk'
302320

303-
finalizedBy 'copyPrebuiltApksToAddon'
321+
finalizedBy 'zipPrebuiltApks'
304322
}

config.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
ext {
22
versions = [
3-
gradlePluginVersion : '8.2.0',
4-
compileSdk : 34,
3+
gradlePluginVersion : '8.6.1',
4+
compileSdk : 35,
55
minSdk : 21,
6-
targetSdk : 34,
6+
targetSdk : 35,
77
javaVersion : JavaVersion.VERSION_17,
8-
kotlinVersion : '1.9.20',
8+
kotlinVersion : '2.1.20',
99
ndkVersion : '23.2.8568313',
1010
openxrVendorsVersion : '3.1.2-stable'
1111
]
@@ -17,7 +17,7 @@ ext {
1717

1818
// Parse the release version from the gradle project properties (e.g: -Prelease_version=<version>)
1919
ext.getReleaseVersion = { ->
20-
final String defaultVersion = "0.1.0-dev-SNAPSHOT"
20+
final String defaultVersion = "1.0.2-dev-SNAPSHOT"
2121

2222
String releaseVersion = project.hasProperty("release_version") ? project.property("release_version") : defaultVersion
2323
if (releaseVersion == null || releaseVersion.isEmpty()) {

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
distributionSha256Sum=38f66cd6eef217b4c35855bb11ea4e9fbc53594ccccb5fb82dfd317ef8c2c5a3
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
66
zipStoreBase=GRADLE_USER_HOME
77
zipStorePath=wrapper/dists

thirdparty/godot

Lines changed: 0 additions & 1 deletion
This file was deleted.

thirdparty/godot_cpp_build_profile/build_profile.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,27 @@
88
"ConfirmationDialog",
99
"Container",
1010
"Control",
11+
"DirAccess",
1112
"EditorExportPlatform",
1213
"EditorExportPlatformAndroid",
1314
"EditorExportPlugin",
1415
"EditorFileDialog",
1516
"EditorInterface",
17+
"EditorPaths",
1618
"EditorPlugin",
1719
"EditorSettings",
1820
"Engine",
1921
"FileAccess",
2022
"HBoxContainer",
23+
"HTTPClient",
24+
"HTTPRequest",
2125
"Label",
2226
"LineEdit",
2327
"MainLoop",
2428
"Node",
2529
"OS",
2630
"ProjectSettings",
31+
"ProgressBar",
2732
"RefCounted",
2833
"Resource",
2934
"RichTextLabel",
@@ -35,6 +40,7 @@
3540
"VBoxContainer",
3641
"Viewport",
3742
"Window",
38-
"XRInterface"
43+
"XRInterface",
44+
"ZIPReader"
3945
]
40-
}
46+
}

0 commit comments

Comments
 (0)