Files
umbrix/android/app/build.gradle

134 lines
3.6 KiB
Groovy
Raw Normal View History

2023-07-06 17:18:41 +03:30
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
2023-10-11 17:38:02 +03:30
boolean hasKeyStore = false
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
hasKeyStore = true
} else {
println "+++"
println "No keystore defined. The app will not be signed."
println "Create a android/key.properties file with the following properties:"
println "storePassword"
println "keyPassword"
println "keyAlias"
println "storeFile"
println "+++"
}
2023-07-06 17:18:41 +03:30
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
namespace "com.hiddify.hiddify"
compileSdkVersion flutter.compileSdkVersion
2023-10-15 15:56:26 +03:30
ndkVersion "26.1.10909125"
2023-07-06 17:18:41 +03:30
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
2023-08-21 14:27:23 +00:00
applicationId "app.hiddify.com"
2023-07-06 17:18:41 +03:30
minSdkVersion 21
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
2023-09-23 00:54:17 +03:30
2023-08-22 08:05:05 +00:00
splits {
2023-09-23 00:54:17 +03:30
abi {
enable true
reset()
2023-10-11 17:38:02 +03:30
//noinspection ChromeOsAbiSupport
2023-09-23 00:54:17 +03:30
include "x86_64", "armeabi-v7a", "arm64-v8a"
universalApk true
}
2023-08-22 08:05:05 +00:00
}
2023-08-22 09:01:36 +00:00
2023-10-11 17:38:02 +03:30
if (hasKeyStore) {
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
2023-07-06 17:18:41 +03:30
}
}
2023-10-11 17:38:02 +03:30
2023-08-22 09:01:36 +00:00
buildTypes {
release {
2023-10-11 17:38:02 +03:30
if (hasKeyStore) {
signingConfig signingConfigs.release
} else {
signingConfig signingConfigs.debug
}
2023-09-23 00:54:17 +03:30
ndk {
2023-10-11 17:38:02 +03:30
//noinspection ChromeOsAbiSupport
2023-09-23 00:54:17 +03:30
abiFilters "x86_64", "armeabi-v7a", "arm64-v8a"
2023-10-15 15:56:26 +03:30
debugSymbolLevel 'FULL'
2023-09-23 00:54:17 +03:30
}
2023-08-22 09:01:36 +00:00
}
}
2023-08-22 08:05:05 +00:00
2023-08-19 22:27:23 +03:30
buildFeatures {
viewBinding true
aidl true
}
2023-09-23 00:54:17 +03:30
}
android.applicationVariants.all { variant ->
2023-09-23 00:54:17 +03:30
variant.outputs.each { output ->
output.versionCodeOverride = android.defaultConfig.versionCode
}
2023-07-06 17:18:41 +03:30
}
flutter {
source '../..'
}
dependencies {
2023-09-23 00:54:17 +03:30
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
2023-08-29 19:16:17 +03:30
implementation 'com.google.code.gson:gson:2.10.1'
2023-07-06 17:18:41 +03:30
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
2023-08-19 22:27:23 +03:30
implementation 'androidx.core:core-ktx:1.10.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1'
2023-10-15 15:56:26 +03:30
}