SWADroid/SWADroid/build.gradle
Marown 0f9fa51219 Update Drone CI configuration (#407)
Co-authored-by: Amab <juanmi1982@gmail.com>
Reviewed-on: #407
2022-11-01 11:24:52 +01:00

91 lines
2.6 KiB
Groovy

plugins {
id 'com.gladed.androidgitversion' version '0.4.14'
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
//return a BuildConfigField from a properties file.
def static getBuildConfigField(String property){
def propFile = new File("keystore.properties")
def value
if(propFile.exists()) {
Properties properties = new Properties()
properties.load(new FileInputStream(propFile))
value = "\"" + properties.getProperty(property) + "\""
} else {
value = "\"" + System.getenv(property) + "\""
}
return value
}
def build_param = "${build}"
if (build_param != "prod") {
//exclude development build
android.variantFilter { variant ->
if (variant.buildType.name == 'prod') {
variant.setIgnore(true)
}
}
} else {
//exclude all except development build
android.variantFilter { variant ->
if (variant.buildType.name != 'prod') {
variant.setIgnore(true)
}
}
}
android {
namespace 'es.ugr.swad.swadroid'
compileSdkVersion 33
buildToolsVersion "33.0.0"
lint {
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
defaultConfig {
applicationId "es.ugr.swad.swadroid"
versionName androidGitVersion.name()
versionCode androidGitVersion.code()
minSdkVersion 24
targetSdkVersion 33
testApplicationId "es.ugr.swad.swadroid.test"
testInstrumentationRunner "android.test.InstrumentationTestRunner"
buildConfigField "String", "SWAD_APP_KEY", getBuildConfigField("SWAD_APP_KEY")
}
buildTypes {
prod {
minifyEnabled true
zipAlignEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.code.ksoap2-android:ksoap2-android:3.6.4'
implementation 'commons-io:commons-io:2.11.0'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0@aar'
implementation 'com.google.zxing:core:3.5.0'
implementation 'com.google.code.gson:gson:2.9.1'
implementation 'com.google.android.material:material:1.7.0'
implementation platform('com.google.firebase:firebase-bom:30.3.2')
implementation 'com.google.firebase:firebase-analytics'
}