acl/android/acl_c++_shared/build.gradle

121 lines
4.0 KiB
Groovy
Raw Normal View History

2017-09-13 18:57:12 +08:00
apply plugin: 'com.android.library'
buildscript {
repositories {
2019-03-07 16:40:47 +08:00
google()
2017-09-13 18:57:12 +08:00
jcenter()
}
dependencies {
2019-03-07 16:40:47 +08:00
//classpath 'com.android.tools.build:gradle:3.3.2'
//classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.android.tools.build:gradle:3.3.1'
2017-09-13 18:57:12 +08:00
}
2019-03-07 16:40:47 +08:00
//implementation {}
2017-09-13 18:57:12 +08:00
}
android {
2019-03-07 16:40:47 +08:00
compileSdkVersion 28
buildToolsVersion "28.0.3"
repositories {
maven { url 'https://repo1.maven.org/maven2' }
}
2017-09-13 18:57:12 +08:00
defaultConfig {
2019-11-01 15:13:01 +08:00
minSdkVersion 14
2019-03-07 16:40:47 +08:00
targetSdkVersion 28
2017-09-13 18:57:12 +08:00
versionCode 1
versionName "1.0"
2021-06-21 11:34:16 +08:00
def HOOK_NEW = false
2021-06-21 10:36:59 +08:00
// testIstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
//arguments "-DANDROID_STL=stl_shared"
//arguments "-DANDROID_STL=gnustl_shared" // for ndk12b, ndk16b
//arguments "-DACL_DISABLE_HOOK_IO=YES" // for ndk12b
arguments "-DANDROID_STL=c++_shared" // for ndk20 or above
arguments "-DHAS_ATOMIC=YES" // for ndk20 or above
arguments "-DCMAKE_BUILD_TYPE=RELEASE"
arguments "-DCMAKE_CXX_FLAGS_RELEASE=-O3"
arguments "-DCMAKE_C_FLAGS_RELEASE=-O3"
//arguments "-DCMAKE_VERBOSE_MAKEFILE=ON"
arguments "-DACL_CLIENT_ONLY=YES"
arguments "-DHAS_MBEDTLS=YES"
arguments "-DACL_BUILD_SHARED=YES"
//cppFlags "-fexceptions"
if (HOOK_NEW) {
arguments "-DACL_HOOK_NEW=YES"
}
2021-06-21 10:36:59 +08:00
//abiFilters 'armeabi', 'arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64'
//abiFilters 'armeabi', 'arm64-v8a', 'armeabi-v7a', 'x86' // for ndk16b
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86' // for ndk20 or above
2017-09-13 18:57:12 +08:00
}
2021-06-21 10:36:59 +08:00
cmake {
//arguments '-DANDROID_PLATFORM=android-14','-DANDROID_TOOLCHAIN=clang'
//targets 'acl_static', 'protocol_static', 'acl_cpp_static', 'fiber_static', 'fiber_cpp_static' // for ndk12b, ndk16b
targets 'acl_static', 'protocol_static', 'acl_cpp_static', 'fiber_static', 'fiber_cpp_static', 'acl', 'protocol', 'acl_cpp', 'fiber', 'fiber_cpp' // for ndk20 or above
}
2017-09-13 18:57:12 +08:00
}
}
2017-09-13 18:57:12 +08:00
buildTypes {
release {
minifyEnabled true
2017-09-13 18:57:12 +08:00
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
jniDebuggable true
debuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2017-09-13 18:57:12 +08:00
}
}
2017-09-13 18:57:12 +08:00
externalNativeBuild {
cmake {
path '../../CMakeLists.txt'
2022-09-19 23:24:04 +08:00
//version "3.10.2"
2017-09-13 18:57:12 +08:00
}
}
2017-09-13 18:57:12 +08:00
packagingOptions {
2019-10-08 11:34:01 +08:00
exclude 'lib/arm64-v8a/libgnustl_shared.so'
exclude 'lib/armeabi-v7a/libgnustl_shared.so'
exclude 'lib/armeabi/libgnustl_shared.so'
exclude 'lib/x86/libgnustl_shared.so'
2019-03-07 16:40:47 +08:00
exclude 'lib/arm64-v8a/libc++_shared.so'
exclude 'lib/armeabi-v7a/libc++_shared.so'
exclude 'lib/armeabi/libc++_shared.so'
exclude 'lib/x86/libc++_shared.so'
2017-09-13 18:57:12 +08:00
}
2017-09-13 18:57:12 +08:00
productFlavors {
}
}
dependencies {
2019-03-07 16:40:47 +08:00
//compile fileTree(include: ['*.jar'], dir: 'libs')
implementation fileTree(include: ['*.jar'], dir: 'libs')
//androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
2017-09-17 00:02:43 +08:00
//compile 'com.android.support:appcompat-v7:25.3.1'
//compile 'com.android.support.constraint:constraint-layout:1.0.2'
//testCompile 'junit:junit:4.12'
2019-03-07 16:40:47 +08:00
//compile files('libs/junit-4.12.jar')
//implementation files('libs/junit-4.12.jar')
2017-09-13 18:57:12 +08:00
}
allprojects {
repositories {
2019-03-07 16:40:47 +08:00
google()
2017-09-13 18:57:12 +08:00
jcenter()
}
}