| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- apply plugin: 'com.android.application'
- def fmodeJpushEnabled = providers.gradleProperty('fmodeJpushEnabled').getOrElse('false').toBoolean()
- def fmodeJpushAppKey = providers.environmentVariable('JPUSH_APPKEY').getOrElse('')
- android {
- namespace = "cn.fmode.app"
- compileSdk = rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "cn.fmode.app"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
- buildConfigField 'boolean', 'JPUSH_ENABLED', fmodeJpushEnabled.toString()
- manifestPlaceholders += [JPUSH_APPKEY: fmodeJpushAppKey, JPUSH_CHANNEL: 'fmode', JPUSH_ENABLED: fmodeJpushEnabled.toString()]
- 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:!*~'
- }
- }
- buildFeatures {
- buildConfig = true
- }
- if (!fmodeJpushEnabled) {
- sourceSets.main.java {
- exclude '**/JPushSdk.java', '**/JPushReceiver.java', '**/JPushService.java', '**/JPushClickActivity.java'
- }
- }
- if (fmodeJpushEnabled && file('src/jpush/AndroidManifest.xml').exists()) {
- sourceSets.debug.manifest.srcFile 'src/jpush/AndroidManifest.xml'
- sourceSets.release.manifest.srcFile 'src/jpush/AndroidManifest.xml'
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- }
- repositories {
- if (fmodeJpushEnabled) {
- maven {
- url 'https://maven.jiguang.cn/nexus/content/repositories/releases/'
- content { includeGroup 'cn.jiguang.sdk' }
- }
- }
- flatDir{
- dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
- }
- }
- dependencies {
- if (fmodeJpushEnabled) {
- implementation('cn.jiguang.sdk:jpush:6.3.1') {
- exclude group: 'cn.jiguang.sdk', module: 'jcore'
- }
- implementation 'cn.jiguang.sdk:jcore:5.6.0'
- }
- 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")
- }
|