164 lines
4.7 KiB
Groovy
164 lines
4.7 KiB
Groovy
apply plugin: 'com.github.ben-manes.versions'
|
|
|
|
buildscript {
|
|
ext{
|
|
kotlin_version = "1.4.30-M1"
|
|
// 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'
|
|
}
|
|
|
|
repositories {
|
|
google()
|
|
jcenter()
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
classpath 'com.android.tools.build:gradle:4.0.0'
|
|
classpath 'com.github.ben-manes:gradle-versions-plugin:0.21.0'
|
|
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.8.0'
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
google()
|
|
jcenter()
|
|
mavenCentral()
|
|
}
|
|
|
|
apply plugin: 'com.android.application'
|
|
apply plugin: 'kotlin-android'
|
|
apply plugin: 'kotlin-android-extensions'
|
|
apply plugin: 'kotlinx-serialization'
|
|
apply plugin: 'kotlin-kapt'
|
|
|
|
dependencies {
|
|
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
|
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"
|
|
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')
|
|
}
|
|
|
|
androidExtensions {
|
|
experimental = true
|
|
}
|
|
|
|
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()
|
|
|
|
//buildToolsVersion '28.0.3'
|
|
|
|
dexOptions {
|
|
javaMaxHeapSize "3g"
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
manifest.srcFile 'AndroidManifest.xml'
|
|
java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java']
|
|
aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl']
|
|
res.srcDirs = [qt5AndroidDir + '/res', 'res']
|
|
resources.srcDirs = ['resources']
|
|
renderscript.srcDirs = ['src']
|
|
assets.srcDirs = ['assets']
|
|
jniLibs.srcDirs = ['libs']
|
|
androidTest.assets.srcDirs += files("${qt5AndroidDir}/schemas".toString())
|
|
}
|
|
}
|
|
|
|
tasks.withType(JavaCompile) {
|
|
options.incremental = true
|
|
}
|
|
|
|
compileOptions {
|
|
// Flag to enable support for the new language APIs
|
|
coreLibraryDesugaringEnabled true
|
|
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8
|
|
|
|
lintOptions {
|
|
abortOnError false
|
|
}
|
|
|
|
// Do not compress Qt binary resources file
|
|
aaptOptions {
|
|
noCompress 'rcc'
|
|
}
|
|
|
|
defaultConfig {
|
|
resConfig "en"
|
|
minSdkVersion = 24
|
|
targetSdkVersion = 30
|
|
versionCode 10 // Change to a higher number
|
|
versionName "2.0.10" // Change to a higher number
|
|
|
|
javaCompileOptions.annotationProcessorOptions.arguments = [
|
|
"room.schemaLocation": "${qt5AndroidDir}/schemas".toString()
|
|
]
|
|
}
|
|
|
|
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 {
|
|
//applicationIdSuffix ".debug"
|
|
//versionNameSuffix "-debug"
|
|
externalNativeBuild {
|
|
cmake {
|
|
arguments "-DANDROID_PACKAGE_NAME=${groupName}", "-DGRADLE_USER_HOME=${project.gradle.gradleUserHomeDir}"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// externalNativeBuild {
|
|
// cmake {
|
|
// path 'wireguard/CMakeLists.txt'
|
|
// }
|
|
// }
|
|
|
|
// externalNativeBuild {
|
|
// cmake {
|
|
// path 'openvpn/src/main/cpp/CMakeLists.txt'
|
|
// }
|
|
// }
|
|
}
|
|
|
|
|
|
|