Skip to content

Commit 104e440

Browse files
committed
Add Meta prebuilt APK install tool
1 parent 52c2be0 commit 104e440

File tree

15 files changed

+13605
-663
lines changed

15 files changed

+13605
-663
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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 -PgodotDir=godot
172171
cd ..
173172
- name: Create Godot Meta Toolkit Addon
174173
run: |

.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: 36 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("godotDir") ? project.property("godotDir") : ""
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,18 +225,26 @@ 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
239+
}
240+
241+
void verifyGodotDir() {
242+
if (godotDir == "" || !file(godotDir).exists() || !file(godotDir).isDirectory()) {
243+
throw new GradleException("godotDir property is empty or invalid.")
244+
}
241245
}
242246

247+
243248
/**
244249
* Generate the prebuilt apks.
245250
*/
@@ -257,11 +262,17 @@ task generatePrebuiltApks() {
257262

258263
if (sconsExecutableFile != null && sconsExecutableFile.exists()) {
259264
tasks.create(name: "buildGodotAndroidArm64Debug", type: Exec) {
265+
doFirst {
266+
verifyGodotDir()
267+
}
260268
executable sconsExecutableFile.absolutePath
261269
args "--directory=${godotDir}", "platform=android", "target=template_debug", "arch=arm64"
262270
}
263271

264272
tasks.create(name: "buildGodotAndroidArm64Release", type: Exec) {
273+
doFirst {
274+
verifyGodotDir()
275+
}
265276
executable sconsExecutableFile.absolutePath
266277
args "--directory=${godotDir}", "platform=android", "target=template_release", "arch=arm64"
267278
}
@@ -274,6 +285,9 @@ task generatePrebuiltApks() {
274285
if (sconsExecutableFile != null && sconsExecutableFile.exists()) {
275286
dependsOn 'buildGodotAndroidArm64Debug'
276287
}
288+
doFirst {
289+
verifyGodotDir()
290+
}
277291
executable gradlewExecutable.absolutePath
278292
args "-p",
279293
godotJavaDir,
@@ -289,6 +303,9 @@ task generatePrebuiltApks() {
289303
if (sconsExecutableFile != null && sconsExecutableFile.exists()) {
290304
dependsOn 'buildGodotAndroidArm64Release'
291305
}
306+
doFirst {
307+
verifyGodotDir()
308+
}
292309
executable gradlewExecutable.absolutePath
293310
args "-p",
294311
godotJavaDir,
@@ -300,5 +317,5 @@ task generatePrebuiltApks() {
300317
dependsOn 'assemblePrebuiltDebugApk'
301318
dependsOn 'assemblePrebuiltReleaseApk'
302319

303-
finalizedBy 'copyPrebuiltApksToAddon'
320+
finalizedBy 'zipPrebuiltApks'
304321
}

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()) {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#Mon Mar 25 17:51:26 PDT 2024
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionSha256Sum=38f66cd6eef217b4c35855bb11ea4e9fbc53594ccccb5fb82dfd317ef8c2c5a3
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
4+
distributionSha256Sum=f397b287023acdba1e9f6fc5ea72d22dd63669d59ed4a289a29b1a76eee151c6
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

Submodule godot-cpp updated 135 files

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)