Skip to content

Commit 9355bbf

Browse files
authored
Fix build for android (#348)
Motivation: 7164389 did introduce some build changes but did not correctly specify things for android. Modifications: - Fix build on android - Enable PR builds for android Result: Be able to build on android again
1 parent 7164389 commit 9355bbf

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

.github/workflows/ci-pr.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,55 @@ jobs:
173173
path: |
174174
**/target/surefire-reports/
175175
**/hs_err*.log
176+
177+
178+
build-pr-android:
179+
runs-on: ubuntu-latest
180+
name: android
181+
env:
182+
SDK_VER: "platforms;android-21"
183+
NDK_VER: "ndk;21.4.7075529"
184+
steps:
185+
- uses: actions/checkout@v2
186+
187+
- name: Setup ninja-build
188+
run: sudo apt-get install ninja-build
189+
190+
- name: Setup go
191+
uses: actions/setup-go@v2
192+
193+
- name: Install cargo-ndk
194+
uses: actions-rs/[email protected]
195+
with:
196+
crate: cargo-ndk
197+
198+
- name: Install Rust toolchain for Android architectures
199+
run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
200+
201+
- name: Set up JDK 1.8
202+
uses: actions/setup-java@v1
203+
with:
204+
java-version: 1.8
205+
206+
- name: Setup Android SDK
207+
uses: android-actions/setup-android@v2
208+
209+
- name: Install Android SDK platforms
210+
run: sdkmanager "${{ env.SDK_VER }}"
211+
212+
- name: Install Android NDK
213+
run: sdkmanager "${{ env.NDK_VER }}"
214+
215+
- name: Setup environment
216+
run: export ANDROID_NDK_HOME=${{ steps.setup-ndk.outputs.ndk-path }}
217+
218+
- name: Build project
219+
run: ./mvnw -B -ntp --file pom.xml clean package -Dandroid
220+
221+
- uses: actions/upload-artifact@v2
222+
if: ${{ failure() }}
223+
with:
224+
name: build-pr-android-target
225+
path: |
226+
**/target/surefire-reports/
227+
**/hs_err*.log

pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,8 @@
430430
<filter token="MIN_SDK_VERSION" value="${androidMinSdkVersion}" />
431431

432432
<copy file="src/main/AndroidManifest.xml" todir="${project.build.directory}/android-build/" filtering="true" />
433-
433+
<!-- Create an empty MANIFEST.MF file -->
434+
<touch file="${project.build.outputDirectory}/META-INF/MANIFEST.MF" mkdirs="true"/>
434435
</target>
435436
</configuration>
436437
</execution>

0 commit comments

Comments
 (0)