75 lines
2.7 KiB
Groovy
75 lines
2.7 KiB
Groovy
apply plugin: 'com.android.application'
|
|
|
|
def releaseSigningProps = new Properties()
|
|
def releaseSigningPropsFile = rootProject.file('signing/release-signing.properties')
|
|
def hasReleaseSigning = releaseSigningPropsFile.exists()
|
|
if (hasReleaseSigning) {
|
|
releaseSigningProps.load(new FileInputStream(releaseSigningPropsFile))
|
|
}
|
|
|
|
android {
|
|
namespace = "com.hyzq.boss"
|
|
compileSdk = rootProject.ext.compileSdkVersion
|
|
buildFeatures {
|
|
buildConfig true
|
|
}
|
|
testOptions {
|
|
unitTests.includeAndroidResources = true
|
|
}
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_21
|
|
targetCompatibility JavaVersion.VERSION_21
|
|
}
|
|
signingConfigs {
|
|
if (hasReleaseSigning) {
|
|
release {
|
|
storeFile file(releaseSigningProps['storeFile'])
|
|
storePassword releaseSigningProps['storePassword']
|
|
keyAlias releaseSigningProps['keyAlias']
|
|
keyPassword releaseSigningProps['keyPassword']
|
|
enableV1Signing true
|
|
enableV2Signing true
|
|
}
|
|
}
|
|
}
|
|
defaultConfig {
|
|
applicationId "com.hyzq.boss"
|
|
minSdkVersion rootProject.ext.minSdkVersion
|
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
versionCode 23
|
|
versionName "2.5.10"
|
|
buildConfigField "String", "BOSS_API_BASE_URL", "\"https://boss.hyzq.net\""
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
}
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
if (hasReleaseSigning) {
|
|
signingConfig signingConfigs.release
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
|
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
|
|
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
|
|
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
|
|
testImplementation "junit:junit:$junitVersion"
|
|
testImplementation "org.robolectric:robolectric:4.14.1"
|
|
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
|
}
|
|
|
|
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")
|
|
}
|