diff --git a/Makefile b/Makefile index b2f2a3e..81d627d 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ ASSETS_DIR := res/assets/ss_ee BUILD_DIR := build ARCH := $(shell uname -m) -.PHONY: all dist build-image engine assets package apk clean +.PHONY: all dist build-image engine assets package apk android-studio clean all: dist @@ -108,6 +108,21 @@ apk: ./run-image.sh bash build-image/build-apk.sh; \ fi +# Stages a scratch, patched copy of engine/ and android/gl4es-src/, plus +# the Android SDL2/SDL2_mixer/fluidsynth-lite/openxr prebuilts, with +# host-resolvable paths (writes android/engine.properties) so Android +# Studio can compile and deploy android/ natively - see README's "5.2. +# Building natively in Android Studio". `make apk` doesn't need this; it +# stages the same things itself inside the build-image. Re-run after +# `make clean` (which deletes android/engine.properties) or after +# changing engine/, android/engine-patches/, android/gl4es-src/, +# android/gl4es-patches/, or the prebuilt-library versions in +# build-image/Dockerfile - Android Studio's own Gradle build already +# does this automatically via its stageEngine task, so this is mainly +# useful for first-time setup or confirming staging succeeded on its own. +android-studio: + ./run-image.sh bash build-image/prepare-android-project.sh --host-paths + clean: rm -rf "$(DIST_DIR)" "$(BUILD_DIR)" "$(ENGINE_OUT)" \ engine/build_ext engine/CMakeCache.txt engine/CMakeFiles \ diff --git a/README.md b/README.md index 08c88f6..6552a76 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,11 @@ a cross-platform port of the original game. Android-based OpenXR headsets. Unlike every other target, this needs network access at build time (Gradle/AGP's own dependency resolution). See "5. Android / Quest build" below. + - `android-studio` - stages `engine/`/`android/gl4es-src/` (scratch, + patched copies) and the Android prebuilts with host-resolvable paths, + so Android Studio can compile and deploy `android/` natively instead + of inside the build-image. See "5.2. Building natively in Android + Studio" below. - `clean` - removes all build output (`dist/`, `build/`, compiled engine artifacts, and the staged Android project files). - `android/` - the Quest app (Java `SDLActivity` glue, Gradle project). @@ -168,11 +173,12 @@ that happens inside a container it isn't running. To have Android Studio compile and deploy `android/` itself instead: ```sh -./run-image.sh bash build-image/prepare-android-project.sh --host-paths +make android-studio ``` -This stages everything `make apk` normally stages (scratch, patched copies -of `engine/` and `android/gl4es-src/`; the Android +(equivalent to `./run-image.sh bash build-image/prepare-android-project.sh +--host-paths` directly.) This stages everything `make apk` normally stages +(scratch, patched copies of `engine/` and `android/gl4es-src/`; the Android SDL2/SDL2_mixer/fluidsynth-lite/openxr prebuilts; bundled assets) - the same as `build-apk.sh`'s own prep step - except it writes `android/engine.properties` with paths that resolve on your host @@ -184,12 +190,13 @@ Studio's own native build (a CMake subdirectory of `engine/`'s build, not a separate prebuilt step), so `android/gl4es-src/`/`android/gl4es-patches/` changes are picked up by a normal rebuild here - no need to re-run `./build-image.sh` first, unlike `build-image/Dockerfile` changes. Re-run -this script whenever `engine/`, `android/engine-patches/`, +`make android-studio` whenever `engine/`, `android/engine-patches/`, `android/gl4es-src/`, `android/gl4es-patches/`, or the prebuilt-library versions in `build-image/Dockerfile` change (the Gradle build already does this automatically for you via its `stageEngine` task, so this manual re-run is mainly useful for confirming staging succeeded on its -own). +own) - and always after `make clean`, which deletes +`android/engine.properties` along with everything else. Then, in Android Studio, use File > Open and select the `android/` directory itself (the one containing `settings.gradle` - not the repo @@ -226,7 +233,7 @@ the same as any other Android Studio project: `QuestShock`, so filtering Logcat by that tag shows everything questshock-specific without gl4es/OpenXR loader/system noise (drop the filter to see those too). -6. Only re-run `prepare-android-project.sh` manually (see above) after +6. Only re-run `make android-studio` manually (see above) after changing `engine/`, `android/engine-patches/`, `android/gl4es-src/`, `android/gl4es-patches/`, or the prebuilt-library versions in `build-image/Dockerfile` - the Gradle build's `stageEngine` task does