2015-10-11 11:56:40 +02:00
|
|
|
apply plugin: 'com.android.application'
|
2019-05-02 18:38:45 +02:00
|
|
|
apply plugin: 'com.google.gms.google-services'
|
2015-10-11 11:56:40 +02:00
|
|
|
|
2018-05-16 22:12:42 +02:00
|
|
|
import org.ajoberstar.grgit.Grgit
|
|
|
|
|
2015-10-11 11:56:40 +02:00
|
|
|
ext {
|
2018-05-16 22:12:42 +02:00
|
|
|
git = Grgit.open()
|
2015-10-11 11:56:40 +02:00
|
|
|
gitVersionCode = git.tag.list().size()
|
|
|
|
gitVersionName = "${git.describe()}"
|
2018-05-16 22:12:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//return a BuildConfigField from a properties file.
|
|
|
|
def static getBuildConfigField(String property){
|
|
|
|
def travisBuild = System.getenv("TRAVIS") == "true"
|
|
|
|
def value
|
|
|
|
|
|
|
|
if(travisBuild) {
|
|
|
|
value = "\"" + System.getenv(property) + "\""
|
|
|
|
} else {
|
|
|
|
Properties properties = new Properties()
|
|
|
|
properties.load(new FileInputStream("keystore.properties"))
|
|
|
|
value = "\"" + properties.getProperty(property) + "\""
|
|
|
|
}
|
2016-09-29 20:33:53 +02:00
|
|
|
|
2018-05-16 22:12:42 +02:00
|
|
|
return value
|
2015-10-11 11:56:40 +02:00
|
|
|
}
|
|
|
|
|
2019-06-06 20:54:01 +02:00
|
|
|
def build_param = "${build}"
|
2019-05-02 18:38:45 +02:00
|
|
|
|
|
|
|
if (build_param != "prod") {
|
|
|
|
//exclude development build
|
|
|
|
android.variantFilter { variant ->
|
2019-06-06 20:54:01 +02:00
|
|
|
if (variant.buildType.name == 'prod') {
|
|
|
|
variant.setIgnore(true)
|
2019-05-02 18:38:45 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
//exclude all except development build
|
|
|
|
android.variantFilter { variant ->
|
2019-06-06 20:54:01 +02:00
|
|
|
if (variant.buildType.name != 'prod') {
|
|
|
|
variant.setIgnore(true)
|
2019-05-02 18:38:45 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-10-11 11:56:40 +02:00
|
|
|
android {
|
2020-06-25 18:27:31 +02:00
|
|
|
compileSdkVersion "android-30"
|
2020-08-18 18:34:32 +02:00
|
|
|
buildToolsVersion '30.0.2'
|
2016-05-12 22:35:11 +02:00
|
|
|
|
2020-01-08 19:36:25 +01:00
|
|
|
compileOptions {
|
|
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
|
|
}
|
|
|
|
|
2016-05-12 22:35:11 +02:00
|
|
|
dexOptions {
|
|
|
|
maxProcessCount=2
|
2016-09-30 17:49:50 +02:00
|
|
|
javaMaxHeapSize "2g"
|
2016-05-12 22:35:11 +02:00
|
|
|
}
|
|
|
|
|
2016-09-30 17:34:08 +02:00
|
|
|
lintOptions {
|
|
|
|
abortOnError false
|
|
|
|
}
|
|
|
|
|
2015-10-11 11:56:40 +02:00
|
|
|
defaultConfig {
|
|
|
|
applicationId "es.ugr.swad.swadroid"
|
|
|
|
versionCode gitVersionCode
|
|
|
|
versionName gitVersionName
|
|
|
|
|
2019-10-26 17:47:53 +02:00
|
|
|
minSdkVersion 24
|
2020-05-07 19:26:13 +02:00
|
|
|
targetSdkVersion 30
|
2015-10-11 11:56:40 +02:00
|
|
|
|
|
|
|
testApplicationId "es.ugr.swad.swadroid.test"
|
|
|
|
testInstrumentationRunner "android.test.InstrumentationTestRunner"
|
2019-05-02 18:38:45 +02:00
|
|
|
|
|
|
|
buildConfigField "String", "SWAD_APP_KEY", getBuildConfigField("SWAD_APP_KEY")
|
2015-10-11 11:56:40 +02:00
|
|
|
}
|
2016-01-05 21:36:39 +01:00
|
|
|
|
2015-10-11 11:56:40 +02:00
|
|
|
buildTypes {
|
2019-05-02 18:38:45 +02:00
|
|
|
prod {
|
|
|
|
minifyEnabled true
|
|
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
2016-09-29 20:33:53 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-10-11 11:56:40 +02:00
|
|
|
dependencies {
|
2019-06-06 20:54:01 +02:00
|
|
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
2020-08-06 17:13:19 +02:00
|
|
|
implementation 'androidx.appcompat:appcompat:1.2.0'
|
2019-03-31 16:52:39 +02:00
|
|
|
implementation 'com.google.code.ksoap2-android:ksoap2-android:3.6.4'
|
2020-09-18 16:47:57 +02:00
|
|
|
implementation 'commons-io:commons-io:2.8.0'
|
2018-04-03 13:04:42 +02:00
|
|
|
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
|
2020-01-08 19:36:25 +01:00
|
|
|
implementation 'com.journeyapps:zxing-android-embedded:4.1.0@aar'
|
2020-09-30 07:38:55 +02:00
|
|
|
implementation 'com.google.zxing:core:3.4.1'
|
2019-10-26 17:38:46 +02:00
|
|
|
implementation 'com.google.code.gson:gson:2.8.6'
|
2020-10-07 08:32:55 +02:00
|
|
|
implementation 'com.google.firebase:firebase-core:17.5.1'
|
2020-10-14 19:50:20 +02:00
|
|
|
implementation 'com.google.android.material:material:1.2.1'
|
2020-10-14 21:10:03 +02:00
|
|
|
implementation platform('com.google.firebase:firebase-bom:25.12.0')
|
|
|
|
implementation 'com.google.firebase:firebase-analytics'
|
2015-10-11 11:56:40 +02:00
|
|
|
}
|