Amab
520b2a044a
All checks were successful
continuous-integration/drone/push Build is passing
# Conflicts: # SWADroid/build.gradle
144 lines
4.4 KiB
Groovy
144 lines
4.4 KiB
Groovy
import io.github.reactivecircus.appversioning.SemVer
|
|
|
|
plugins {
|
|
id("io.github.reactivecircus.app-versioning") version "1.3.1"
|
|
}
|
|
apply plugin: 'com.android.application'
|
|
|
|
//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
|
|
}
|
|
|
|
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()
|
|
}
|
|
}
|
|
|
|
android {
|
|
namespace 'es.ugr.swad.swadroid'
|
|
compileSdk 34
|
|
|
|
lint {
|
|
abortOnError false
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_17
|
|
targetCompatibility JavaVersion.VERSION_17
|
|
}
|
|
|
|
defaultConfig {
|
|
applicationId "es.ugr.swad.swadroid"
|
|
|
|
minSdkVersion 24
|
|
targetSdkVersion 34
|
|
|
|
testApplicationId "es.ugr.swad.swadroid.androidTest"
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
|
|
buildConfigField "String", "SWAD_APP_KEY", getBuildConfigField("SWAD_APP_KEY")
|
|
|
|
javaCompileOptions {
|
|
annotationProcessorOptions {
|
|
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
|
|
}
|
|
}
|
|
}
|
|
|
|
def RELEASE_STORE_FILE = System.getenv("RELEASE_STORE_FILE")
|
|
buildFeatures {
|
|
buildConfig true
|
|
}
|
|
|
|
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
|
|
}
|
|
}
|
|
} else {
|
|
project.logger.warn("RELEASE_STORE_FILE is not defined. Skipping signing step")
|
|
}
|
|
|
|
sourceSets {
|
|
// Adds exported schema location as androidTest app assets.
|
|
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
|
|
}
|
|
lint {
|
|
abortOnError false
|
|
}
|
|
namespace 'es.ugr.swad.swadroid'
|
|
|
|
}
|
|
|
|
dependencies {
|
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
|
implementation 'androidx.appcompat:appcompat:1.6.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.2'
|
|
implementation 'com.google.code.gson:gson:2.10.1'
|
|
implementation 'com.google.android.material:material:1.11.0'
|
|
|
|
//Lombok
|
|
def lombok_version = "1.18.24"
|
|
compileOnly "org.projectlombok:lombok:$lombok_version"
|
|
annotationProcessor "org.projectlombok:lombok:$lombok_version"
|
|
testCompileOnly "org.projectlombok:lombok:$lombok_version"
|
|
testAnnotationProcessor "org.projectlombok:lombok:$lombok_version"
|
|
|
|
//Database dependencies
|
|
def room_version = "2.6.0"
|
|
implementation 'net.zetetic:android-database-sqlcipher:4.5.1@aar'
|
|
implementation "androidx.sqlite:sqlite:2.4.0"
|
|
implementation "androidx.room:room-runtime:$room_version"
|
|
annotationProcessor "androidx.room:room-compiler:$room_version"
|
|
// optional - Test helpers
|
|
testImplementation "androidx.room:room-testing:$room_version"
|
|
|
|
//Tests
|
|
def test_version = "1.5.0"
|
|
testImplementation 'junit:junit:4.13.2'
|
|
androidTestImplementation "androidx.test:core:$test_version"
|
|
androidTestImplementation "androidx.test:rules:$test_version"
|
|
androidTestImplementation "androidx.test:runner:1.5.2"
|
|
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
|
}
|