Files
MobileGL/android-plugin/app/build.gradle
T

126 lines
3.4 KiB
Groovy

plugins {
id 'com.android.application'
}
def mobileGlEnvString = { backendType ->
[
LIBGL_ES : '3',
POJAV_RENDERER : 'opengles3',
MOBILEGL_BACKEND_TYPE: backendType,
].collect { key, value -> "${key}=${value}" }.join(':')
}
def signingStoreFile = file('../keystore.jks')
def signingStorePassword = System.getenv('SIGNING_STORE_PASSWORD')
def signingKeyAlias = System.getenv('SIGNING_KEY_ALIAS')
def signingKeyPassword = System.getenv('SIGNING_KEY_PASSWORD')
def releaseSigningReady = signingStoreFile.exists()
&& signingStorePassword
&& signingKeyAlias
&& signingKeyPassword
android {
namespace 'top.mobilegl.plugin'
compileSdk 34
ndkVersion '27.3.13750724'
defaultConfig {
minSdk 26
targetSdk 34
versionCode 1
versionName 'dev'
ndk {
abiFilters 'arm64-v8a'
}
}
flavorDimensions 'backend', 'profile'
productFlavors {
espryt {
dimension 'backend'
applicationId 'top.mobilegl.plugin.espryt'
def env = mobileGlEnvString('DirectGLES')
resValue 'string', 'mobilegl_default_backend', 'DirectGLES'
manifestPlaceholders = [
appLabel: 'MobileGL Espryt',
des : 'MobileGL Espryt',
renderer: 'MobileGL Espryt:libMobileGL.so:/libMobileGL.so',
boatEnv : env,
pojavEnv: env,
]
}
magma {
dimension 'backend'
applicationId 'top.mobilegl.plugin.magma'
def env = mobileGlEnvString('DirectVulkan')
resValue 'string', 'mobilegl_default_backend', 'DirectVulkan'
manifestPlaceholders = [
appLabel: 'MobileGL Magma',
des : 'MobileGL Magma',
renderer: 'MobileGL Magma:libMobileGL.so:/libMobileGL.so',
boatEnv : env,
pojavEnv: env,
]
}
plugin {
dimension 'profile'
}
trace {
dimension 'profile'
applicationIdSuffix '.trace'
versionNameSuffix '-trace'
}
}
if (releaseSigningReady) {
signingConfigs {
release {
storeFile signingStoreFile
storePassword signingStorePassword
keyAlias signingKeyAlias
keyPassword signingKeyPassword
}
}
}
buildTypes {
release {
minifyEnabled false
if (releaseSigningReady) {
signingConfig signingConfigs.release
}
}
}
externalNativeBuild {
cmake {
path file('src/trace/cpp/CMakeLists.txt')
version '3.22.1'
}
}
packaging {
jniLibs {
useLegacyPackaging true
excludes += ['**/libSPIRV-Tools-shared.so']
}
}
}
android.applicationVariants.configureEach { variant ->
variant.outputs.configureEach {
outputFileName = "MobileGL-${variant.flavorName.capitalize()}-${variant.buildType.name}.apk"
}
}
androidComponents {
onVariants(selector().withFlavor('profile', 'plugin')) { variant ->
variant.packaging.jniLibs.excludes.add('**/libtrace_replay_runner.so')
}
}
dependencies {
implementation project(':MobileGL')
}