2017-06-13 16:04:55 -04:00
buildscript
{
repositories
{
2022-01-02 22:04:55 -05:00
mavenCentral ( )
2019-05-20 16:30:17 -04:00
google ( )
2017-06-13 16:04:55 -04:00
}
dependencies
{
2021-09-25 03:19:21 -04:00
// 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
2022-01-02 22:04:55 -05:00
// 7.0.0 to fix https://stackoverflow.com/questions/68387270/android-studio-error-installed-build-tools-revision-31-0-0-is-corrupted
2022-11-10 21:21:47 -05:00
classpath 'com.android.tools.build:gradle:7.3.0'
2019-05-20 16:30:17 -04:00
}
}
allprojects
{
repositories
{
2022-01-02 22:04:55 -05:00
mavenCentral ( )
2019-05-20 16:30:17 -04:00
google ( )
2017-06-13 16:04:55 -04:00
}
}
apply plugin: 'com.android.application'
android
{
2022-11-10 21:21:47 -05:00
// Setting the namespace via a source AndroidManifest.xml's package attribute is deprecated.
namespace project . getProperty ( 'package_name' )
2022-01-02 22:04:55 -05:00
// 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.
2018-02-04 16:37:02 -05:00
compileSdkVersion compile_sdk_version . toInteger ( )
2021-09-25 03:19:21 -04:00
ndkVersion ndk_version
externalNativeBuild
{
ndkBuild
{
path 'Android.mk'
}
}
defaultConfig
{
2022-11-10 21:21:47 -05:00
versionCode project . getProperty ( 'version_code' ) . toInteger ( )
versionName project . getProperty ( 'version_name' )
2022-01-02 22:04:55 -05:00
minSdkVersion min_sdk_version . toInteger ( )
targetSdkVersion target_sdk_version . toInteger ( )
2021-09-25 03:19:21 -04:00
externalNativeBuild
{
ndkBuild
{
2022-01-02 22:04:55 -05:00
def app_platform = "APP_PLATFORM=android-${min_sdk_version}"
arguments app_platform , 'APP_STL=c++_static' , cpu_core
2021-09-25 03:19:21 -04:00
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'
}
}
2017-06-13 16:04:55 -04:00
2020-08-27 04:28:13 -04:00
signingConfigs
{
release
{
storeFile file ( keystore )
storePassword storepass
keyAlias alias
keyPassword storepass
}
}
buildTypes
{
2021-09-25 03:19:21 -04:00
debug
{
debuggable true
jniDebuggable true
minifyEnabled false
shrinkResources false
multiDexEnabled true
externalNativeBuild
{
ndkBuild
{
arguments 'NDK_DEBUG=1'
cFlags '-O0'
cppFlags '-O0'
}
}
2022-04-30 21:55:06 -04:00
ndk
{
if ( project . getProperty ( 'compile_arch' ) = = 'all' )
{
abiFilters 'armeabi-v7a' , 'arm64-v8a' , 'x86' , 'x86_64'
}
else
{
abiFilters project . getProperty ( 'compile_arch' )
}
}
2021-09-25 03:19:21 -04:00
}
2020-08-27 04:28:13 -04:00
release
{
2021-09-25 03:19:21 -04:00
externalNativeBuild
{
ndkBuild
{
cFlags '-O3'
cppFlags '-O3'
}
}
2020-08-27 04:28:13 -04:00
signingConfig signingConfigs . release
2022-04-30 21:55:06 -04:00
ndk
{
if ( project . getProperty ( 'compile_arch' ) = = 'all' )
{
abiFilters 'armeabi-v7a' , 'arm64-v8a' , 'x86' , 'x86_64'
}
else
{
abiFilters project . getProperty ( 'compile_arch' )
}
}
2020-08-27 04:28:13 -04:00
}
}
2017-06-13 16:04:55 -04:00
sourceSets
{
main
{
manifest . srcFile 'AndroidManifest.xml'
res . srcDirs = [ 'res' ]
assets . srcDirs = [ 'assets' ]
}
}
}
2020-03-13 09:31:33 -04:00
dependencies
{
implementation 'org.minidns:minidns-hla:0.3.3'
}