Use CMake for Android build and add GitHub CI
This commit is contained in:
parent
125c1ff37d
commit
dfda9c764b
|
@ -0,0 +1,33 @@
|
||||||
|
name: Android CI
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Set up build environment
|
||||||
|
run: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;20.0.5594570"
|
||||||
|
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- run: git fetch origin +refs/tags/*:refs/tags/*
|
||||||
|
|
||||||
|
- uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ~/.gradle/caches
|
||||||
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-gradle-
|
||||||
|
|
||||||
|
- name: Gradle
|
||||||
|
working-directory: shell/android-studio
|
||||||
|
run: ./gradlew assembleDreamcastDebug --parallel
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: reicast-dreamcast-debug.apk
|
||||||
|
path: shell/android-studio/reicast/build/outputs/apk/dreamcast/debug/reicast-dreamcast-debug.apk
|
|
@ -35,8 +35,14 @@ android {
|
||||||
versionName getVersionName()
|
versionName getVersionName()
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
|
|
||||||
|
externalNativeBuild {
|
||||||
|
cmake {
|
||||||
|
arguments '-DANDROID_ARM_MODE=arm'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ndk {
|
ndk {
|
||||||
moduleName "dc"
|
moduleName 'flycast'
|
||||||
abiFilters 'armeabi-v7a', 'arm64-v8a'
|
abiFilters 'armeabi-v7a', 'arm64-v8a'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,13 +78,14 @@ android {
|
||||||
flavorDimensions "systemtype"
|
flavorDimensions "systemtype"
|
||||||
productFlavors {
|
productFlavors {
|
||||||
dreamcast {
|
dreamcast {
|
||||||
externalNativeBuild { ndkBuild { arguments ("-j" + Runtime.runtime.availableProcessors()) } }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
ndkBuild {
|
cmake {
|
||||||
path 'src/main/jni/Android.mk'
|
version '3.10.2+'
|
||||||
|
path '../../../CMakeLists.txt'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import android.util.Log;
|
||||||
import static android.media.AudioTrack.STATE_INITIALIZED;
|
import static android.media.AudioTrack.STATE_INITIALIZED;
|
||||||
|
|
||||||
public final class AudioBackend {
|
public final class AudioBackend {
|
||||||
static { System.loadLibrary("dc"); }
|
static { System.loadLibrary("flycast"); }
|
||||||
|
|
||||||
private AudioTrack audioTrack;
|
private AudioTrack audioTrack;
|
||||||
private long writePosition;
|
private long writePosition;
|
||||||
|
|
|
@ -7,7 +7,7 @@ import com.reicast.emulator.periph.SipEmulator;
|
||||||
|
|
||||||
public final class JNIdc
|
public final class JNIdc
|
||||||
{
|
{
|
||||||
static { System.loadLibrary("dc"); }
|
static { System.loadLibrary("flycast"); }
|
||||||
|
|
||||||
public static native String initEnvironment(Emulator emulator, String homeDirectory);
|
public static native String initEnvironment(Emulator emulator, String homeDirectory);
|
||||||
public static native void setExternalStorageDirectories(Object[] pathList);
|
public static native void setExternalStorageDirectories(Object[] pathList);
|
||||||
|
|
|
@ -10,7 +10,7 @@ import com.reicast.emulator.Emulator;
|
||||||
public final class InputDeviceManager implements InputManager.InputDeviceListener {
|
public final class InputDeviceManager implements InputManager.InputDeviceListener {
|
||||||
public static final int VIRTUAL_GAMEPAD_ID = 0x12345678;
|
public static final int VIRTUAL_GAMEPAD_ID = 0x12345678;
|
||||||
|
|
||||||
static { System.loadLibrary("dc"); }
|
static { System.loadLibrary("flycast"); }
|
||||||
private static final InputDeviceManager INSTANCE = new InputDeviceManager();
|
private static final InputDeviceManager INSTANCE = new InputDeviceManager();
|
||||||
private InputManager inputManager;
|
private InputManager inputManager;
|
||||||
private int maple_port = 0;
|
private int maple_port = 0;
|
||||||
|
|
|
@ -90,7 +90,7 @@ LOCAL_CPP_FEATURES :=
|
||||||
# LOCAL_SHARED_LIBRARIES:= libcutils libutils
|
# LOCAL_SHARED_LIBRARIES:= libcutils libutils
|
||||||
LOCAL_PRELINK_MODULE := false
|
LOCAL_PRELINK_MODULE := false
|
||||||
|
|
||||||
LOCAL_MODULE := dc
|
LOCAL_MODULE := flycast
|
||||||
LOCAL_DISABLE_FORMAT_STRING_CHECKS=true
|
LOCAL_DISABLE_FORMAT_STRING_CHECKS=true
|
||||||
LOCAL_ASFLAGS := -fPIC -fvisibility=hidden
|
LOCAL_ASFLAGS := -fPIC -fvisibility=hidden
|
||||||
LOCAL_LDLIBS := -llog -lEGL -lz -landroid
|
LOCAL_LDLIBS := -llog -lEGL -lz -landroid
|
||||||
|
|
Loading…
Reference in New Issue