android: added product flavors to separatly build apk for arm64-v8a or x86_64
This commit is contained in:
@@ -2,11 +2,14 @@
|
||||
|
||||
Notes and resources for MPD android maintainers.
|
||||
|
||||
## Build
|
||||
|
||||
See [Compiling for Android](https://github.com/MusicPlayerDaemon/MPD/blob/45cb098cd765af12316f8dca5635ef10a852e013/doc/user.rst#compiling-for-android)
|
||||
|
||||
## Android studio
|
||||
|
||||
### Version control
|
||||
|
||||
|
||||
git ignoring .idea directory completely until a good reason emerges not to
|
||||
|
||||
* [How to manage projects under Version Control Systems (jetbrains.com)](https://intellij-support.jetbrains.com/hc/en-us/articles/206544839-How-to-manage-projects-under-Version-Control-Systems)
|
||||
@@ -17,10 +20,9 @@ git ignoring .idea directory completely until a good reason emerges not to
|
||||
|
||||
* [Include prebuilt native libraries (developer.android.com)](https://developer.android.com/studio/projects/gradle-external-native-builds#jniLibs)
|
||||
|
||||
## Permissions
|
||||
|
||||
### Permissions
|
||||
|
||||
#### Files access
|
||||
### Files access
|
||||
|
||||
The required permission depends on android SDK version:
|
||||
|
||||
@@ -29,7 +31,7 @@ The required permission depends on android SDK version:
|
||||
else
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE
|
||||
|
||||
#### Permission request
|
||||
### Permission request
|
||||
|
||||
[Request runtime permissions](https://developer.android.com/training/permissions/requesting)
|
||||
|
||||
|
@@ -18,11 +18,6 @@ android {
|
||||
vectorDrawables {
|
||||
useSupportLibrary = true
|
||||
}
|
||||
ndk {
|
||||
// Specifies the ABI configurations of your native
|
||||
// libraries Gradle should build and package with your app.
|
||||
abiFilters += "arm64-v8a"
|
||||
}
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
@@ -46,12 +41,29 @@ android {
|
||||
)
|
||||
}
|
||||
}
|
||||
// flavors
|
||||
flavorDimensions += "base"
|
||||
productFlavors {
|
||||
create("arm64-v8a") {
|
||||
ndk {
|
||||
// ABI to include in package
|
||||
//noinspection ChromeOsAbiSupport
|
||||
abiFilters += listOf("arm64-v8a")
|
||||
}
|
||||
}
|
||||
create("x86_64") {
|
||||
ndk {
|
||||
// ABI to include in package
|
||||
abiFilters += listOf("x86_64")
|
||||
}
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_9
|
||||
targetCompatibility = JavaVersion.VERSION_1_9
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "9"
|
||||
jvmTarget = JavaVersion.VERSION_1_9.toString()
|
||||
}
|
||||
packaging {
|
||||
resources {
|
||||
|
@@ -70,3 +70,11 @@ ninja = shutil.which("ninja")
|
||||
subprocess.check_call([ninja], env=toolchain.env)
|
||||
|
||||
subprocess.check_call([ninja, 'install'], env=toolchain.env)
|
||||
|
||||
print("""
|
||||
-------------------------------------
|
||||
## To build the android app:
|
||||
# cd ../../android
|
||||
# ./gradlew assemble{}Debug
|
||||
-------------------------------------
|
||||
""".format(android_abi.capitalize()))
|
Reference in New Issue
Block a user