From 3d29308de6ae620806fd3b11e4146d89ba06a2aa Mon Sep 17 00:00:00 2001 From: Olanti Date: Tue, 20 Dec 2022 00:15:18 +0300 Subject: [PATCH] Fix android build, add android to CI (#2244) * Add android builds to CI * Fix compilation of mutation_ui.cpp on android * Remove unused bits from workflow file --- .github/workflows/android.yml | 52 +++++++++++++++++++++++++++++++++++ src/mutation_ui.cpp | 4 +-- 2 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/android.yml diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml new file mode 100644 index 000000000000..0ef5d9d94dd9 --- /dev/null +++ b/.github/workflows/android.yml @@ -0,0 +1,52 @@ +name: Cataclysm Android build + +on: + pull_request: + branches: + - upload + paths-ignore: + - 'build-data/osx/**' + - 'doc/**' + - 'doxygen_doc/**' + - 'gfx/**' + - 'lang/**' + - 'lgtm/**' + - 'msvc-object_creator/**' + - 'object_creator/**' + - 'tools/**' + - '!tools/format/**' + - 'utilities/**' + +# We only care about the latest revision of a PR, so cancel previous instances. +concurrency: + group: android-build-${{ github.event.pull_request.number || github.ref_name }} + cancel-in-progress: true + +jobs: + build_catatclysm: + name: Build + runs-on: ubuntu-22.04 + if: github.event.pull_request.draft == false + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 1 + + - name: Set up JDK 8 (android) + uses: actions/setup-java@v2 + with: + java-version: "8" + distribution: "adopt" + + - name: Setup build and dependencies + run: | + sudo apt-get update + sudo apt-get install gettext + + - name: Build + working-directory: ./android + run: | + chmod +x gradlew + ./gradlew -Pj=$((`nproc`+0)) -Pabi_arm_32=false assembleExperimentalRelease diff --git a/src/mutation_ui.cpp b/src/mutation_ui.cpp index ddba7c256620..59e5d59f6eeb 100644 --- a/src/mutation_ui.cpp +++ b/src/mutation_ui.cpp @@ -242,10 +242,10 @@ detail::mutations_ui_result detail::show_mutations_ui_internal( Character &who ) ctxt.register_action( "QUIT" ); #if defined(__ANDROID__) for( const auto &p : passive ) { - ctxt.register_manual_key( my_mutations[p].key, p.obj().name() ); + ctxt.register_manual_key( who.my_mutations[p].key, p.obj().name() ); } for( const auto &a : active ) { - ctxt.register_manual_key( my_mutations[a].key, a.obj().name() ); + ctxt.register_manual_key( who.my_mutations[a].key, a.obj().name() ); } #endif