apply plugin: 'com.android.application' apply plugin: "com.github.triplet.play" // 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)) android { compileSdkVersion rootProject.ext.compileSdkVersion 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" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" versionCode mVersionCode.toInteger() versionName "${mVersionName}" } } 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', "\\\$") } } buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release } } } repositories { flatDir{ dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs' } } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion" 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 implementation 'com.google.android.gms:play-services-auth:19.0.0' } apply from: 'capacitor.build.gradle' try { def servicesJSON = file('google-services.json') if (servicesJSON.text) { apply plugin: 'com.google.gms.google-services' } } catch(Exception e) { logger.warn("google-services.json not found, google-services plugin not applied. Push Notifications won't work") } play { defaultToAppBundles.set(true) serviceAccountCredentials = file("../play-store.json") track.set("beta") } def getPrettyDate() { return new Date().format('yyyy-MM-dd-HH-mm-ss') } def getDate() { def dt1 = new Date(); def dt2 = new Date('01/01/2020'); def seconds = Math.round((dt1.getTime() - dt2.getTime()) / 1000) return "${seconds}" }