Files
amnezia-client/client/android/build.gradle
T

170 lines
4.9 KiB
Groovy
Raw Normal View History

2022-04-01 10:05:58 +05:30
apply plugin: 'com.github.ben-manes.versions'
2021-08-08 18:10:09 +03:00
buildscript {
2021-09-30 15:56:48 +03:00
ext{
2023-01-17 16:12:42 +03:00
kotlin_version = "1.4.30-M1"
2021-09-30 15:56:48 +03:00
// for libwg
appcompatVersion = '1.1.0'
annotationsVersion = '1.0.1'
databindingVersion = '3.3.1'
jsr305Version = '3.0.2'
streamsupportVersion = '1.7.0'
threetenabpVersion = '1.1.1'
groupName = 'org.amnezia.vpn'
}
2021-08-08 18:10:09 +03:00
repositories {
google()
jcenter()
2021-09-30 15:56:48 +03:00
mavenCentral()
2021-08-08 18:10:09 +03:00
}
dependencies {
2023-01-17 16:12:42 +03:00
classpath 'com.android.tools.build:gradle:7.2.1'
2022-04-01 10:05:58 +05:30
classpath 'com.github.ben-manes:gradle-versions-plugin:0.21.0'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.8.0'
2021-09-30 15:56:48 +03:00
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
2021-08-08 18:10:09 +03:00
}
}
repositories {
google()
jcenter()
2021-09-30 15:56:48 +03:00
mavenCentral()
2021-08-08 18:10:09 +03:00
}
apply plugin: 'com.android.application'
2021-09-30 15:56:48 +03:00
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlinx-serialization'
2022-04-01 10:05:58 +05:30
apply plugin: 'kotlin-kapt'
2021-08-08 18:10:09 +03:00
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
2021-09-30 15:56:48 +03:00
implementation 'androidx.core:core-ktx:1.1.0'
implementation "androidx.security:security-crypto:1.1.0-alpha03"
implementation "androidx.security:security-identity-credential:1.0.0-alpha02"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.2.2"
2022-04-26 23:49:20 +05:30
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0"
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5"
implementation project(path: ':shadowsocks')
2022-04-01 10:05:58 +05:30
}
androidExtensions {
experimental = true
2021-08-08 18:10:09 +03:00
}
android {
/*******************************************************
* The following variables:
* - androidBuildToolsVersion,
* - androidCompileSdkVersion
* - qt5AndroidDir - holds the path to qt android files
* needed to build any Qt application
* on Android.
*
* are defined in gradle.properties file. This file is
* updated by QtCreator and androiddeployqt tools.
* Changing them manually might break the compilation!
*******************************************************/
compileSdkVersion androidCompileSdkVersion.toInteger()
2022-12-23 17:32:20 +03:00
buildToolsVersion androidBuildToolsVersion
ndkVersion androidNdkVersion
// Extract native libraries from the APK
packagingOptions.jniLibs.useLegacyPackaging true
2021-08-08 18:10:09 +03:00
2021-10-01 03:01:48 +03:00
dexOptions {
javaMaxHeapSize "3g"
}
2021-08-08 18:10:09 +03:00
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
2022-12-23 17:32:20 +03:00
java.srcDirs = [qtAndroidDir + '/src', 'src', 'java']
aidl.srcDirs = [qtAndroidDir + '/src', 'src', 'aidl']
res.srcDirs = [qtAndroidDir + '/res', 'res']
2021-08-08 18:10:09 +03:00
resources.srcDirs = ['resources']
renderscript.srcDirs = ['src']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
2022-04-01 10:05:58 +05:30
androidTest.assets.srcDirs += files("${qt5AndroidDir}/schemas".toString())
2021-08-08 18:10:09 +03:00
}
}
tasks.withType(JavaCompile) {
options.incremental = true
}
compileOptions {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
2021-08-08 18:10:09 +03:00
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
2022-03-17 11:38:48 +05:30
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8
2021-08-08 18:10:09 +03:00
lintOptions {
abortOnError false
}
// Do not compress Qt binary resources file
aaptOptions {
noCompress 'rcc'
}
defaultConfig {
resConfig "en"
2021-09-30 15:56:48 +03:00
minSdkVersion = 24
2023-01-17 16:12:42 +03:00
targetSdkVersion = 30
2022-06-11 15:52:44 +03:00
versionCode 10 // Change to a higher number
versionName "2.0.10" // Change to a higher number
2022-04-01 10:05:58 +05:30
javaCompileOptions.annotationProcessorOptions.arguments = [
"room.schemaLocation": "${qt5AndroidDir}/schemas".toString()
]
2021-08-08 18:10:09 +03:00
}
2021-09-30 15:56:48 +03:00
2021-10-01 03:01:48 +03:00
buildTypes {
release {
// That would enable treeshaking and remove java code that is just called from qt
minifyEnabled false
externalNativeBuild {
cmake {
arguments "-DANDROID_PACKAGE_NAME=${groupName}", "-DGRADLE_USER_HOME=${project.gradle.gradleUserHomeDir}"
}
}
}
debug {
2021-10-01 12:18:48 -07:00
//applicationIdSuffix ".debug"
//versionNameSuffix "-debug"
2022-12-23 17:32:20 +03:00
minifyEnabled false
2021-10-01 03:01:48 +03:00
externalNativeBuild {
cmake {
2021-10-01 12:18:48 -07:00
arguments "-DANDROID_PACKAGE_NAME=${groupName}", "-DGRADLE_USER_HOME=${project.gradle.gradleUserHomeDir}"
2021-10-01 03:01:48 +03:00
}
}
}
}
2022-08-09 17:06:03 +03:00
// externalNativeBuild {
// cmake {
// path 'wireguard/CMakeLists.txt'
// }
// }
// externalNativeBuild {
// cmake {
// path 'openvpn/src/main/cpp/CMakeLists.txt'
// }
// }
2021-08-08 18:10:09 +03:00
}
2021-10-06 22:45:25 +03:00