mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 21:09:21 +00:00
127 lines
3.4 KiB
Groovy
127 lines
3.4 KiB
Groovy
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"
|
|
|
|
|
|
// To sign packages
|
|
def keystoreProperties = new Properties()
|
|
def keystorePropertiesFile = rootProject.file('key.properties')
|
|
if (keystorePropertiesFile.exists()) {
|
|
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
|
}
|
|
|
|
android {
|
|
compileSdkVersion 31
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = '1.8'
|
|
}
|
|
|
|
sourceSets {
|
|
main.java.srcDirs += 'src/main/java'
|
|
}
|
|
|
|
|
|
lintOptions {
|
|
disable 'InvalidPackage'
|
|
|
|
// TODO remove this fix to use Gradle plugin 4 ASAP
|
|
checkReleaseBuilds false
|
|
}
|
|
|
|
defaultConfig {
|
|
applicationId "org.communiquons.comunic"
|
|
minSdkVersion 21
|
|
targetSdkVersion 31
|
|
versionCode flutterVersionCode.toInteger()
|
|
versionName flutterVersionName
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
}
|
|
|
|
|
|
signingConfigs {
|
|
release {
|
|
keyAlias keystoreProperties['keyAlias']
|
|
keyPassword keystoreProperties['keyPassword']
|
|
storeFile file(keystoreProperties['storeFile'])
|
|
storePassword keystoreProperties['storePassword']
|
|
}
|
|
|
|
forezRelease {
|
|
keyAlias keystoreProperties['forezKeyAlias']
|
|
keyPassword keystoreProperties['forezKeyPassword']
|
|
storeFile file(keystoreProperties['storeFile'])
|
|
storePassword keystoreProperties['storePassword']
|
|
}
|
|
}
|
|
|
|
|
|
buildTypes {
|
|
release {
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
|
|
flavorDimensions "version"
|
|
productFlavors {
|
|
stable {
|
|
signingConfig signingConfigs.release
|
|
}
|
|
|
|
beta {
|
|
signingConfig signingConfigs.release
|
|
applicationId "org.communiquons.beta"
|
|
}
|
|
|
|
forez {
|
|
signingConfig signingConfigs.forezRelease
|
|
applicationId "org.communiquons.forez"
|
|
}
|
|
}
|
|
|
|
packagingOptions {
|
|
exclude 'META-INF/proguard/androidx-annotations.pro'
|
|
}
|
|
}
|
|
|
|
flutter {
|
|
source '../..'
|
|
}
|
|
|
|
dependencies {
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
implementation 'com.neovisionaries:nv-websocket-client:2.14'
|
|
testImplementation 'junit:junit:4.13.1'
|
|
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
|
}
|
|
|
|
apply plugin: 'com.google.gms.google-services' |