172 lines
5.8 KiB
Groovy
172 lines
5.8 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.lifecycle:lifecycle-livedata-ktx:2.4.0-alpha02"
|
|
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"
|
|
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.0.10"
|
|
implementation project(path: ':shadowsocks')
|
|
//ss
|
|
// implementation 'androidx.lifecycle:lifecycle-common-java8:2.4.0'
|
|
// implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
|
// implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0"
|
|
// //implementation "androidx.core:core-ktx:1.2.0"
|
|
// implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
|
|
// implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.4.0"
|
|
// implementation "androidx.lifecycle:lifecycle-livedata-core-ktx:2.4.0"
|
|
// implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0"
|
|
// implementation "androidx.room:room-runtime:2.2.5" // runtime
|
|
// implementation "androidx.preference:preference:1.1.0"
|
|
// implementation "androidx.work:work-runtime-ktx:2.3.4"
|
|
// implementation "androidx.browser:browser:1.3.0-alpha01"
|
|
// implementation "androidx.constraintlayout:constraintlayout:1.1.3"
|
|
// implementation "com.google.android.material:material:1.2.0-alpha05"
|
|
// implementation "com.google.code.gson:gson:2.8.5"
|
|
// implementation "dnsjava:dnsjava:2.1.9"
|
|
// implementation "org.connectbot.jsocks:jsocks:1.0.0"
|
|
// implementation "com.afollestad.material-dialogs:core:2.6.0"
|
|
// implementation 'com.takisoft.preferencex:preferencex:1.1.0'
|
|
// implementation 'com.android.support:multidex:1.0.0'
|
|
// api 'org.connectbot.jsocks:jsocks:1.0.0'
|
|
// annotationProcessor "androidx.room:room-compiler:2.2.5"
|
|
// annotationProcessor "androidx.lifecycle:lifecycle-compiler:2.4.0"
|
|
}
|
|
|
|
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 {
|
|
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 8 // Change to a higher number
|
|
versionName "2.0.8" // 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}"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|