apply plugin: 'com.android.application' def getProcessesCountArg() { def procCount = Runtime.runtime.availableProcessors() Gradle gradle = getGradle() def isClean = gradle.getStartParameter().getTaskNames().find { it ==~ /.*clean.*/ } if (isClean) { procCount = 1 } return "-j" + procCount } android { namespace "com.ensoft.eepp" defaultConfig { applicationId "com.ensoft.eepp" minSdk 27 compileSdk 34 targetSdkVersion 33 versionCode 1 versionName "1.0" ndk { abiFilters 'arm64-v8a', 'x86_64' } externalNativeBuild { ndkBuild { arguments "APP_LDLIBS=-llog -lGLESv2 -lGLESv1_CM -lm -lz -lOpenSLES -lEGL -landroid" arguments "APP_PLATFORM=android-21" arguments getProcessesCountArg() } } signingConfig signingConfigs.debug } flavorDimensions += "eepp" buildFeatures { buildConfig true } productFlavors { ecode { buildConfigField "String", "SO_NAME", "\"ecode\"" applicationId "com.ensoft.ecode" dimension "eepp" resValue "string", "app_name", "ecode" externalNativeBuild { ndkBuild { arguments "APP_MODULES=ecode" } } } eterm { buildConfigField "String", "SO_NAME", "\"eterm\"" applicationId "com.ensoft.eterm" dimension "eepp" resValue "string", "app_name", "eterm" externalNativeBuild { ndkBuild { arguments "APP_MODULES=eterm-app" } } } fulltest { buildConfigField "String", "SO_NAME", "\"main\"" versionNameSuffix "-test" dimension "eepp" resValue "string", "app_name", "eepp" externalNativeBuild { ndkBuild { arguments "APP_MODULES=main" } } } } buildTypes { debug { debuggable true externalNativeBuild { ndkBuild { arguments "APP_CFLAGS=-g -DDEBUG -DEE_DEBUG" arguments "APP_CPPFLAGS=-std=c++20 -frtti -fexceptions" arguments "APP_OPTIM=debug" } } } release { externalNativeBuild { ndkBuild { arguments "APP_CFLAGS=-fno-strict-aliasing -O3 -s -DNDEBUG" arguments "APP_CPPFLAGS=-std=c++20 -frtti -fexceptions" } } minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } sourceSets.main { jniLibs.srcDir 'libs' } externalNativeBuild { ndkBuild { path 'jni/Android.mk' } } compileOptions { sourceCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11 } ndkVersion "29.0.14206865" lint { abortOnError false } } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') }