Skip to content
Snippets Groups Projects

Resolve "Improve build process"

Merged Benoît Harrault requested to merge 72-improve-build-process into master
2 files
+ 27
0
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 50
40
@@ -4,32 +4,6 @@ plugins {
id "dev.flutter.flutter-gradle-plugin"
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def gradleProperties = new Properties()
def gradlePropertiesFile = rootProject.file('gradle.properties')
if (gradlePropertiesFile.exists()) {
gradlePropertiesFile.withReader('UTF-8') { reader ->
gradleProperties.load(reader)
}
}
def appVersionCode = gradleProperties.getProperty('app.versionCode')
if (appVersionCode == null) {
appVersionCode = '1'
}
def appVersionName = gradleProperties.getProperty('app.versionName')
if (appVersionName == null) {
appVersionName = '1.0'
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
@@ -37,33 +11,69 @@ if (keystorePropertiesFile.exists()) {
}
android {
compileSdkVersion 34
namespace "org.benoitharrault.random"
namespace = "org.benoitharrault.random"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "org.benoitharrault.random"
minSdkVersion 21
targetSdkVersion 30
versionCode appVersionCode.toInteger()
versionName appVersionName
archivesBaseName = "$applicationId" + "_" + "$versionCode"
applicationId = "org.benoitharrault.random"
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
keyAlias = keystoreProperties['keyAlias']
keyPassword = keystoreProperties['keyPassword']
storeFile = keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword = keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
signingConfig = signingConfigs.release
}
}
splits {
abi {
reset()
include 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
}
ext.abiCodes = [
'armeabi': 1,
'armeabi-v7a': 2,
'arm64-v8a': 3,
'x86': 4,
'x86_64': 5,
]
import com.android.build.OutputFile
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
def baseAbiVersionCode = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))
if (baseAbiVersionCode != null) {
output.versionCodeOverride = baseAbiVersionCode * 1000 + variant.versionCode
}
}
}
flutter {
source '../..'
source = "../.."
}
Loading