Files
healer-man/android/app/build.gradle
T
2026-08-14 15:56:39 -04:00

95 lines
3.6 KiB
Groovy

import groovy.json.JsonSlurper
apply plugin: 'com.android.application'
def packageJson = new JsonSlurper().parse(file('../../package.json'))
def releaseVersionName = System.getenv('ANDROID_VERSION_NAME') ?: packageJson.version
def releaseVersionCode = (System.getenv('ANDROID_VERSION_CODE') ?: '1').toInteger()
def releaseKeystoreFile = System.getenv('ANDROID_KEYSTORE_FILE')
def releaseKeystorePassword = System.getenv('ANDROID_KEYSTORE_PASSWORD')
def releaseKeyAlias = System.getenv('ANDROID_KEY_ALIAS')
def releaseKeyPassword = System.getenv('ANDROID_KEY_PASSWORD')
def releaseSigningReady = releaseKeystoreFile && releaseKeystorePassword && releaseKeyAlias && releaseKeyPassword
android {
namespace = "com.phenomrom.healerman"
compileSdk = rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "com.phenomrom.healerman"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode releaseVersionCode
versionName releaseVersionName
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:!*~'
}
}
signingConfigs {
if (releaseSigningReady) {
release {
storeFile file(releaseKeystoreFile)
storePassword releaseKeystorePassword
keyAlias releaseKeyAlias
keyPassword releaseKeyPassword
}
}
}
buildTypes {
release {
minifyEnabled false
if (releaseSigningReady) signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
android.applicationVariants.all { variant ->
variant.outputs.all { output ->
outputFileName = "healer-man-${variant.versionName}-${variant.buildType.name}.apk"
}
}
def removeInvalidCapacitorResourceCopies = tasks.register('removeInvalidCapacitorResourceCopies') {
doLast {
delete fileTree('src/main/res/xml') {
include 'config *.xml'
}
}
}
tasks.named('preBuild').configure {
dependsOn removeInvalidCapacitorResourceCopies
}
repositories {
flatDir{
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
}
}
dependencies {
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')
}
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.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
}