add support for building Android version
This commit is contained in:
70
android-project/app/build.gradle
Normal file
70
android-project/app/build.gradle
Normal file
@@ -0,0 +1,70 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
}
|
||||
|
||||
//def buildWithCMake = project.hasProperty('BUILD_WITH_CMAKE');
|
||||
def buildWithCMake = true;
|
||||
|
||||
android {
|
||||
namespace "fi.jetro.rousku"
|
||||
compileSdkVersion 34
|
||||
defaultConfig {
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
externalNativeBuild {
|
||||
ndkBuild {
|
||||
arguments "APP_PLATFORM=android-19"
|
||||
// abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
||||
abiFilters 'arm64-v8a'
|
||||
}
|
||||
cmake {
|
||||
arguments "-DANDROID_PLATFORM=android-19", "-DANDROID_STL=c++_static"
|
||||
// abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
||||
abiFilters 'arm64-v8a'
|
||||
}
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
applicationVariants.all { variant ->
|
||||
tasks["merge${variant.name.capitalize()}Assets"]
|
||||
.dependsOn("externalNativeBuild${variant.name.capitalize()}")
|
||||
}
|
||||
if (!project.hasProperty('EXCLUDE_NATIVE_LIBS')) {
|
||||
sourceSets.main {
|
||||
jniLibs.srcDir 'libs'
|
||||
}
|
||||
externalNativeBuild {
|
||||
if (buildWithCMake) {
|
||||
cmake {
|
||||
//path 'jni/CMakeLists.txt'
|
||||
path '../../CMakeLists.txt'
|
||||
}
|
||||
} else {
|
||||
ndkBuild {
|
||||
path 'jni/Android.mk'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
lint {
|
||||
abortOnError false
|
||||
}
|
||||
buildFeatures {
|
||||
prefab true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
//implementation files('libs/SDL3-3.2.20.aar')
|
||||
implementation files('libs/SDL3_ttf-3.2.2.aar')
|
||||
implementation files('libs/SDL3_image-3.2.4.aar')
|
||||
}
|
||||
Reference in New Issue
Block a user