123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- buildscript
- {
- repositories
- {
- mavenCentral()
- google()
- }
- dependencies
- {
- // 4.1.2 is the minimum version to support native debug symbols file
- // https://developer.android.com/studio/build/shrink-code#android_gradle_plugin_version_41_or_later
- // 7.0.0 to fix https://stackoverflow.com/questions/68387270/android-studio-error-installed-build-tools-revision-31-0-0-is-corrupted
- classpath 'com.android.tools.build:gradle:8.2.1'
- }
- }
- allprojects
- {
- repositories
- {
- mavenCentral()
- google()
- }
- }
- apply plugin: 'com.android.application'
- android
- {
- // Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated.
- namespace project.getProperty('package_name')
- // buildToolsVersion is no longer needed https://developer.android.com/studio/releases/gradle-plugin.html#behavior_changes_1
- // Quote:
- // Build Tools 27.0.3 or higher. Keep in mind, you no longer need to specify a version for the build tools using the android.buildToolsVersion property—the plugin uses the minimum required version by default.
- compileSdkVersion compile_sdk_version.toInteger()
- ndkVersion ndk_version
- externalNativeBuild
- {
- ndkBuild
- {
- path 'Android.mk'
- }
- }
- defaultConfig
- {
- versionCode project.getProperty('version_code').toInteger()
- versionName project.getProperty('version_name')
- minSdkVersion min_sdk_version.toInteger()
- targetSdkVersion target_sdk_version.toInteger()
- externalNativeBuild
- {
- ndkBuild
- {
- def app_platform = "APP_PLATFORM=android-${min_sdk_version}"
- arguments app_platform, 'APP_STL=c++_static', cpu_core
- if (project.getProperty('compile_arch') == 'all')
- {
- abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
- }
- else
- {
- abiFilters project.getProperty('compile_arch')
- }
- }
- }
- def runTasks = gradle.startParameter.taskNames
- if ('bundleRelease' in runTasks)
- {
- // use SYMBOL_TABLE if too large later (max limit on google play is 300MB)
- ndk.debugSymbolLevel 'FULL'
- }
- }
- signingConfigs
- {
- release
- {
- storeFile file(keystore)
- storePassword storepass
- keyAlias alias
- keyPassword storepass
- }
- }
- buildTypes
- {
- debug
- {
- debuggable true
- jniDebuggable true
- minifyEnabled false
- shrinkResources false
- multiDexEnabled true
- externalNativeBuild
- {
- ndkBuild
- {
- arguments 'NDK_DEBUG=1'
- cFlags '-O0'
- cppFlags '-O0'
- }
- }
- ndk
- {
- if (project.getProperty('compile_arch') == 'all')
- {
- abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
- }
- else
- {
- abiFilters project.getProperty('compile_arch')
- }
- }
- }
- release
- {
- externalNativeBuild
- {
- ndkBuild
- {
- cFlags '-O3'
- cppFlags '-O3'
- }
- }
- signingConfig signingConfigs.release
- ndk
- {
- if (project.getProperty('compile_arch') == 'all')
- {
- abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
- }
- else
- {
- abiFilters project.getProperty('compile_arch')
- }
- }
- }
- }
- sourceSets
- {
- main
- {
- manifest.srcFile 'AndroidManifest.xml'
- res.srcDirs = ['res']
- assets.srcDirs = ['assets']
- }
- }
- }
- dependencies
- {
- implementation 'org.minidns:minidns-hla:0.3.3'
- }
|