60 lines
2.0 KiB
Groovy
60 lines
2.0 KiB
Groovy
apply plugin: 'com.android.application'
|
||
|
||
android {
|
||
namespace "com.cunkebao.app"
|
||
compileSdk rootProject.ext.compileSdkVersion
|
||
defaultConfig {
|
||
applicationId "com.cunkebao.app"
|
||
minSdkVersion rootProject.ext.minSdkVersion
|
||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||
versionCode 1
|
||
versionName "1.0"
|
||
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:!*~'
|
||
}
|
||
}
|
||
buildTypes {
|
||
release {
|
||
minifyEnabled false
|
||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||
}
|
||
}
|
||
|
||
// 完全禁用测试
|
||
testOptions {
|
||
unitTests.all {
|
||
enabled = false
|
||
}
|
||
}
|
||
}
|
||
|
||
repositories {
|
||
// 移除 flatDir,使用标准的 maven 仓库
|
||
google()
|
||
mavenCentral()
|
||
maven { url 'https://maven.aliyun.com/repository/public' }
|
||
maven { url 'https://maven.aliyun.com/repository/google' }
|
||
}
|
||
|
||
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')
|
||
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")
|
||
}
|