2023-10-21 13:00:01 +02:00
|
|
|
import io.github.reactivecircus.appversioning.SemVer
|
|
|
|
|
2021-02-21 19:41:45 +01:00
|
|
|
plugins {
|
2023-10-21 13:00:01 +02:00
|
|
|
id("io.github.reactivecircus.app-versioning") version "1.3.1"
|
2021-02-21 19:41:45 +01:00
|
|
|
}
|
2015-10-11 11:56:40 +02:00
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
|
2018-05-16 22:12:42 +02:00
|
|
|
//return a BuildConfigField from a properties file.
|
|
|
|
def static getBuildConfigField(String property){
|
2021-02-21 19:41:45 +01:00
|
|
|
def propFile = new File("keystore.properties")
|
2018-05-16 22:12:42 +02:00
|
|
|
def value
|
|
|
|
|
2021-02-21 19:41:45 +01:00
|
|
|
if(propFile.exists()) {
|
2018-05-16 22:12:42 +02:00
|
|
|
Properties properties = new Properties()
|
2021-02-21 19:41:45 +01:00
|
|
|
properties.load(new FileInputStream(propFile))
|
2018-05-16 22:12:42 +02:00
|
|
|
value = "\"" + properties.getProperty(property) + "\""
|
2021-02-21 19:41:45 +01:00
|
|
|
} else {
|
|
|
|
value = "\"" + System.getenv(property) + "\""
|
2018-05-16 22:12:42 +02:00
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
2023-10-21 13:00:01 +02:00
|
|
|
appVersioning {
|
|
|
|
overrideVersionCode { gitTag, providers, variantInfo ->
|
|
|
|
//SemVer-based version code
|
|
|
|
def semVer = SemVer.fromGitTag(gitTag)
|
|
|
|
semVer.major * 1000000 + semVer.minor * 1000 + semVer.patch
|
|
|
|
|
|
|
|
//Timestamp-based version code
|
|
|
|
//Instant.now().epochSecond.toInt()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-10-11 11:56:40 +02:00
|
|
|
android {
|
2022-09-15 21:57:54 +02:00
|
|
|
namespace 'es.ugr.swad.swadroid'
|
2023-08-05 09:25:55 +02:00
|
|
|
compileSdk 34
|
2022-09-15 21:57:54 +02:00
|
|
|
|
|
|
|
lint {
|
|
|
|
abortOnError false
|
|
|
|
}
|
2016-05-12 22:35:11 +02:00
|
|
|
|
2020-01-08 19:36:25 +01:00
|
|
|
compileOptions {
|
2023-11-26 10:37:19 +01:00
|
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
|
|
targetCompatibility JavaVersion.VERSION_17
|
2020-01-08 19:36:25 +01:00
|
|
|
}
|
|
|
|
|
2015-10-11 11:56:40 +02:00
|
|
|
defaultConfig {
|
|
|
|
applicationId "es.ugr.swad.swadroid"
|
|
|
|
|
2019-10-26 17:47:53 +02:00
|
|
|
minSdkVersion 24
|
2023-06-10 14:44:45 +02:00
|
|
|
targetSdkVersion 34
|
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
|
|
|
|
2023-11-29 18:14:56 +01:00
|
|
|
def RELEASE_STORE_FILE = System.getenv("RELEASE_STORE_FILE")
|
2023-12-02 12:19:36 +01:00
|
|
|
buildFeatures {
|
|
|
|
buildConfig true
|
|
|
|
}
|
2023-11-29 18:14:56 +01:00
|
|
|
|
|
|
|
if (RELEASE_STORE_FILE) {
|
|
|
|
signingConfigs {
|
|
|
|
release {
|
|
|
|
storeFile file(RELEASE_STORE_FILE)
|
|
|
|
storePassword System.getenv("RELEASE_STORE_PASSWORD")
|
|
|
|
keyAlias System.getenv("RELEASE_KEY_ALIAS")
|
|
|
|
keyPassword System.getenv("RELEASE_KEY_PASSWORD")
|
|
|
|
|
|
|
|
v1SigningEnabled true
|
|
|
|
v2SigningEnabled true
|
|
|
|
|
|
|
|
enableV3Signing = true
|
|
|
|
enableV4Signing = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (RELEASE_STORE_FILE) {
|
|
|
|
buildTypes {
|
|
|
|
release {
|
|
|
|
signingConfig signingConfigs.release
|
|
|
|
}
|
2016-09-29 20:33:53 +02:00
|
|
|
}
|
2023-11-29 21:50:03 +01:00
|
|
|
} else {
|
|
|
|
project.logger.warn("RELEASE_STORE_FILE is not defined. Skipping signing step")
|
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'
|
2023-03-02 22:32:18 +01:00
|
|
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
2019-03-31 16:52:39 +02:00
|
|
|
implementation 'com.google.code.ksoap2-android:ksoap2-android:3.6.4'
|
2021-07-14 08:48:15 +02:00
|
|
|
implementation 'commons-io:commons-io:2.11.0'
|
2018-04-03 13:04:42 +02:00
|
|
|
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
|
2021-10-26 19:13:05 +02:00
|
|
|
implementation 'com.journeyapps:zxing-android-embedded:4.3.0@aar'
|
2023-08-05 09:25:55 +02:00
|
|
|
implementation 'com.google.zxing:core:3.5.2'
|
2023-06-02 23:00:10 +02:00
|
|
|
implementation 'com.google.code.gson:gson:2.10.1'
|
2023-10-21 13:00:01 +02:00
|
|
|
implementation 'com.google.android.material:material:1.10.0'
|
2020-10-27 22:43:49 +01:00
|
|
|
}
|