2022-04-04 20:22:30 +02:00
|
|
|
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.")
|
|
|
|
}
|
|
|
|
|
|
|
|
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"
|
2022-04-05 20:30:20 +02:00
|
|
|
def keystoreProperties = new Properties()
|
|
|
|
def keystorePropertiesFile = rootProject.file('key.properties')
|
|
|
|
if (keystorePropertiesFile.exists()) {
|
|
|
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
|
|
|
}
|
2022-04-04 20:22:30 +02:00
|
|
|
|
|
|
|
android {
|
2022-11-17 12:19:38 +01:00
|
|
|
compileSdkVersion 33
|
2022-04-04 20:22:30 +02:00
|
|
|
|
|
|
|
compileOptions {
|
2022-11-17 12:19:38 +01:00
|
|
|
// Flag to enable support for the new language APIs
|
|
|
|
coreLibraryDesugaringEnabled true
|
|
|
|
// Sets Java compatibility to Java 8
|
2022-04-04 20:22:30 +02:00
|
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
|
|
}
|
|
|
|
|
|
|
|
kotlinOptions {
|
|
|
|
jvmTarget = '1.8'
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
main.java.srcDirs += 'src/main/kotlin'
|
|
|
|
}
|
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
applicationId "cz.hernikplays.opencanteen"
|
|
|
|
minSdkVersion 18
|
2022-11-17 12:19:38 +01:00
|
|
|
targetSdkVersion 33
|
2022-04-04 20:22:30 +02:00
|
|
|
versionCode flutterVersionCode.toInteger()
|
|
|
|
versionName flutterVersionName
|
2022-06-08 17:12:44 +02:00
|
|
|
multiDexEnabled true
|
2022-04-04 20:22:30 +02:00
|
|
|
}
|
|
|
|
|
2022-04-05 20:30:20 +02:00
|
|
|
signingConfigs {
|
|
|
|
release {
|
|
|
|
keyAlias keystoreProperties['keyAlias']
|
|
|
|
keyPassword keystoreProperties['keyPassword']
|
|
|
|
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
|
|
|
|
storePassword keystoreProperties['storePassword']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
buildTypes {
|
|
|
|
release {
|
|
|
|
signingConfig signingConfigs.release
|
|
|
|
}
|
|
|
|
}
|
2022-04-04 20:22:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
flutter {
|
|
|
|
source '../..'
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
2022-06-08 17:12:44 +02:00
|
|
|
implementation 'com.android.support:multidex:1.0.3'
|
|
|
|
implementation 'androidx.appcompat:appcompat:1.3.1'
|
2022-11-17 12:19:38 +01:00
|
|
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
2022-04-04 20:22:30 +02:00
|
|
|
}
|
2022-12-08 20:30:37 +01:00
|
|
|
|
|
|
|
ext.abiCodes = ["x86_64": 1, "armeabi-v7a": 2, "arm64-v8a": 3]
|
|
|
|
import com.android.build.OutputFile
|
|
|
|
android.applicationVariants.all { variant ->
|
|
|
|
variant.outputs.each { output ->
|
|
|
|
def abiVersionCode = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))
|
|
|
|
if (abiVersionCode != null) {
|
|
|
|
output.versionCodeOverride = variant.versionCode * 10 + abiVersionCode
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|