dynamicbible/src/android/app/build.gradle

117 lines
4.2 KiB
Groovy
Raw Normal View History

2024-02-29 15:21:26 +00:00
import java.time.LocalDateTime
import java.time.temporal.ChronoUnit
2020-08-18 08:45:04 -04:00
apply plugin: 'com.android.application'
apply plugin: "com.github.triplet.play"
2020-08-18 08:45:04 -04:00
2021-01-01 21:50:52 +00:00
// Create a variable called keystorePropertiesFile, and initialize it to your
// keystore.properties file, in the rootProject folder.
def keystorePropertiesFile = rootProject.file("signing.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
2020-08-18 08:45:04 -04:00
android {
2024-02-29 15:21:26 +00:00
namespace "walljm.dynamicbible"
def versionPropsFile = rootProject.file('version.properties')
def mVersionName = ""
def mVersionCode = ""
if (versionPropsFile.canRead()) {
def versionProps = new Properties()
versionProps.load(new FileInputStream(versionPropsFile))
mVersionName = "v${versionProps['VERSION_MAJOR']}.${versionProps['VERSION_MINOR']}.${versionProps['VERSION_PATCH']}-${getPrettyDate()}"
mVersionCode = "${getDate()}"
defaultConfig {
applicationId "walljm.dynamicbible"
compileSdk rootProject.ext.compileSdkVersion
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode mVersionCode.toInteger()
versionName "${mVersionName}"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
2021-01-01 21:50:52 +00:00
}
2024-02-29 15:21:26 +00:00
multiDexEnabled = true
}
} else {
throw new FileNotFoundException("Could not read version.properties!")
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['password'].replaceAll('JASON', "\\\$")
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['password'].replaceAll('JASON', "\\\$")
2021-01-01 21:50:52 +00:00
}
2024-02-29 15:21:26 +00:00
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
2020-08-18 08:45:04 -04:00
}
2024-02-29 15:21:26 +00:00
}
2020-08-18 08:45:04 -04:00
}
repositories {
2024-02-29 15:21:26 +00:00
flatDir {
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
}
2020-08-18 08:45:04 -04:00
}
dependencies {
2024-02-29 15:21:26 +00:00
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
implementation project(':capacitor-android')
testImplementation "junit:junit:$junitVersion"
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
implementation project(':capacitor-cordova-android-plugins')
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:26.5.0')
// Declare the dependency for the Firebase Authentication library
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-auth'
// Also declare the dependency for the Google Play services library and specify its version
2024-07-09 18:03:33 -05:00
implementation 'com.google.android.gms:play-services-auth:21.2.0'
2024-02-29 15:21:26 +00:00
2020-08-18 08:45:04 -04:00
}
apply from: 'capacitor.build.gradle'
try {
2024-02-29 15:21:26 +00:00
def servicesJSON = file('google-services.json')
if (servicesJSON.text) {
apply plugin: 'com.google.gms.google-services'
}
} catch(ignored) {
logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
2021-01-01 21:50:52 +00:00
}
play {
2024-02-29 15:21:26 +00:00
defaultToAppBundles.set(true)
serviceAccountCredentials = file("../play-store.json")
track.set("beta")
}
2024-02-29 15:21:26 +00:00
static def getPrettyDate() {
return new Date().format('yyyy-MM-dd-HH-mm-ss')
}
2024-02-29 15:21:26 +00:00
static def getDate() {
def startTime = LocalDateTime.of(2020, 1, 1, 0, 0) // this is the time all the versions are based from.
def seconds = startTime.until(LocalDateTime.now(), ChronoUnit.SECONDS) // seconds since the start time
2024-02-29 15:21:26 +00:00
return "${seconds}"
}