You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
2.6 KiB
80 lines
2.6 KiB
import kotlin.text.all
|
|
import kotlin.text.find
|
|
import kotlin.text.isNotEmpty
|
|
import kotlin.text.replace
|
|
import java.io.FileInputStream
|
|
import java.util.Properties
|
|
|
|
plugins {
|
|
id("com.android.application")
|
|
id("kotlin-android")
|
|
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
|
id("dev.flutter.flutter-gradle-plugin")
|
|
}
|
|
|
|
def keystoreProperties = new Properties()
|
|
def keystorePropertiesFile = rootProject.file('keystore.properties')
|
|
if (keystorePropertiesFile.exists()) {
|
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
|
}
|
|
|
|
android {
|
|
namespace = "com.example.hadi_hoda_flutter"
|
|
compileSdk = 36
|
|
ndkVersion = flutter.ndkVersion
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_11
|
|
targetCompatibility = JavaVersion.VERSION_11
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = JavaVersion.VERSION_11.toString()
|
|
}
|
|
|
|
defaultConfig {
|
|
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
|
applicationId = "com.example.hadi_hoda_flutter"
|
|
// You can update the following values to match your application needs.
|
|
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
|
minSdk = 24
|
|
targetSdk = 36
|
|
versionCode = flutter.versionCode
|
|
versionName = flutter.versionName
|
|
}
|
|
|
|
signingConfigs {
|
|
create("release") {
|
|
keyAlias = keystoreProperties['keyAlias']
|
|
keyPassword = keystoreProperties['keyPassword']
|
|
storeFile = file(keystoreProperties['storeFile'])
|
|
storePassword = keystoreProperties['storePassword']
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
signingConfig = signingConfigs.getByName("release")
|
|
}
|
|
}
|
|
|
|
applicationVariants.all {
|
|
val variant = this
|
|
variant.outputs.all {
|
|
val output = this
|
|
// Get the architecture (ABI) for the current output. Note: Flutter often uses 'armeabi-v7a', 'arm64-v8a', etc.
|
|
val abi = output.filters.find { it.filterType == "ABI" }?.identifier?.replace("armeabi-", "") ?: ""
|
|
|
|
// Make sure we are dealing with an APK output
|
|
if (output is com.android.build.gradle.internal.api.ApkVariantOutputImpl) {
|
|
// Append the ABI to the filename, with a hyphen if it exists
|
|
val abiSuffix = if (abi.isNotEmpty()) "-$abi" else ""
|
|
output.outputFileName = "Hadi & Hoda v${variant.versionName}+${variant.versionCode}${abiSuffix}.apk"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
flutter {
|
|
source = "../.."
|
|
}
|