apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' apply plugin: 'realm-android' apply plugin: 'com.huawei.agconnect' ext { //定义变量 signingConfigKeyAlias = "" signingConfigKeyPassword = "" signingConfigStoreFilePath = "" signingConfigStorePassword = "" jpushAppKey = "" baiduSpeechAppId = "" baiduSpeechSecret = "" baiduSpeechAppKey = "" baiduMapAppKey = "" jpushIMPassword = "" xiaomiAppId="" xiaomiAppKey="" oppoAppKey="" oppoAppId="" oppoAppSecret="" vivoAppKey="" vivoAppId="" } def loadProperties() { Properties properties = new Properties() properties.load(project.rootProject.file('local.properties').newDataInputStream()) // 打包apk使用的密钥文件相关信息,请填写到local.properties文件中 project.signingConfigKeyAlias = properties.getProperty("signingConfig.keyAlias") project.signingConfigKeyPassword = properties.getProperty("signingConfig.keyPassword") project.signingConfigStoreFilePath = properties.getProperty("signingConfig.storeFilePath") project.signingConfigStorePassword = properties.getProperty("signingConfig.storePassword") //release key project.jpushAppKey = project.property("JPUSH_APPKEY").toString() project.baiduSpeechAppId = project.property("BAIDU_SPEECH_APPID").toString() project.baiduSpeechSecret = project.property("BAIDU_SPEECH_SECRET").toString() project.baiduSpeechAppKey = project.property("BAIDU_SPEECH_APPKEY").toString() project.baiduMapAppKey = project.property("BAIDU_MAP_APPKEY").toString() project.xiaomiAppId=project.property("XIAOMI_APPID").toString() project.xiaomiAppKey=project.property("XIAOMI_APPKEY").toString() // project.oppoAppKey=project.property("OPPO_APPKEY").toString() // project.oppoAppId=project.property("OPPO_APPID").toString() // project.oppoAppSecret=project.property("OPPO_APPSECRET").toString() // project.vivoAppKey=project.property("VIVO_APPKEY").toString() // project.vivoAppId=project.property("VIVO_APPID").toString() } loadProperties() task printVersionName { def v = project.property("o2.versionName").toString() println("${v}") } android { compileSdkVersion 31 buildToolsVersion "30.0.3" sourceSets { main { jniLibs.srcDir 'libs' assets.srcDirs = ['assets'] res.srcDirs = ['src/main/res', 'src/main/res/raw'] } } signingConfigs { release { v1SigningEnabled true v2SigningEnabled true keyAlias project.signingConfigKeyAlias keyPassword project.signingConfigKeyPassword storeFile file(project.signingConfigStoreFilePath) storePassword project.signingConfigStorePassword } debug { v1SigningEnabled true v2SigningEnabled true keyAlias project.signingConfigKeyAlias keyPassword project.signingConfigKeyPassword storeFile file(project.signingConfigStoreFilePath) storePassword project.signingConfigStorePassword // keyAlias 'androiddebugkey' // storeFile file('debug.keystore') // keyPassword 'android' } } defaultConfig { applicationId "com.dccr.oa" minSdkVersion 21 targetSdkVersion 31 versionCode project.property("o2.versionCode").toInteger() versionName project.property("o2.versionName").toString() multiDexEnabled true ndk { //选择要添加的对应cpu类型的.so库。 // abiFilters 'armeabi', 'armeabi-v7a' // abiFilters 'armeabi-v7a', 'arm64-v8a' abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64' } multiDexKeepProguard file('multidex_keep_file.pro') vectorDrawables.useSupportLibrary = true dataBinding { enabled = true } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } buildTypes { debug { signingConfig signingConfigs.release buildConfigField "Boolean", "InnerServer", "true" buildConfigField "Boolean", "LOG_ENABLE", "true" buildConfigField "Boolean", "NEED_UPDATE", "true" buildConfigField "Boolean", "LOG_FILE", "true" manifestPlaceholders = [JPUSH_PKGNAME : defaultConfig.applicationId, JPUSH_APPKEY : project.jpushAppKey, XIAOMI_APPID : project.xiaomiAppId, XIAOMI_APPKEY : project.xiaomiAppKey, BAIDU_SPEECH_APPID : project.baiduSpeechAppId, BAIDU_SPEECH_SECRET: project.baiduSpeechSecret, BAIDU_SPEECH_APPKEY: project.baiduSpeechAppKey, BAIDU_MAP_APPKEY : project.baiduMapAppKey] zipAlignEnabled true minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } release { signingConfig signingConfigs.release buildConfigField "Boolean", "InnerServer", "true" buildConfigField "Boolean", "LOG_ENABLE", "false" buildConfigField "Boolean", "NEED_UPDATE", "true" buildConfigField "Boolean", "LOG_FILE", "true" manifestPlaceholders = [JPUSH_PKGNAME : defaultConfig.applicationId, JPUSH_APPKEY : project.jpushAppKey, XIAOMI_APPID : project.xiaomiAppId, XIAOMI_APPKEY : project.xiaomiAppKey, BAIDU_SPEECH_APPID : project.baiduSpeechAppId, BAIDU_SPEECH_SECRET: project.baiduSpeechSecret, BAIDU_SPEECH_APPKEY: project.baiduSpeechAppKey, BAIDU_MAP_APPKEY : project.baiduMapAppKey] zipAlignEnabled true minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' //apk包重命名 applicationVariants.all { variant -> variant.outputs.all { outputFileName = "${variant.productFlavors[0].name}-${variant.versionName}.apk" } } } } android { lintOptions { abortOnError false } } lintOptions { checkReleaseBuilds false abortOnError false } flavorDimensions "type" productFlavors { O2PLATFORM { manifestPlaceholders = [JPUSH_CHANNEL: "pgy"] } huawei { manifestPlaceholders = [JPUSH_CHANNEL: "huawei"] } xiaomi { manifestPlaceholders = [JPUSH_CHANNEL: "xiaomi"] } } } buildscript { repositories { mavenCentral() } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version" } } repositories { flatDir { dirs 'libs' } //o2oa maven { url "../o2_flutter/buildAAR/host/outputs/repo" } maven { url 'https://storage.googleapis.com/download.flutter.io' } } dependencies { // 百度地图 implementation files('libs/BaiduLBS_Android.jar') // 扫码 implementation 'com.google.zxing:core:3.4.1' implementation files('libs/pinyin4j-2.5.0.jar') implementation files('libs/universal-image-loader-1.9.5.jar') // implementation(name: 'material-calendarview-fancy-1.1', ext: 'aar') implementation 'com.jakewharton.threetenabp:threetenabp:1.1.1' implementation 'com.github.prolificinteractive:material-calendarview:2.0.0' implementation project(path: ':o2_auth_sdk') // // flutter 相关的aar // flutter模块开发调试用 // implementation project(':flutter') // debugImplementation 'io.flutter.plugins.pathprovider:path_provider_android_debug:1.0' implementation 'io.flutter.plugins.pathprovider:path_provider_android_release:1.0' // debugImplementation 'io.flutter.plugins.sharedpreferences:shared_preferences_android_debug:1.0' implementation 'io.flutter.plugins.sharedpreferences:shared_preferences_android_release:1.0' // debugImplementation 'net.o2oa.app.flutter.o2_flutter:flutter_debug:1.0' implementation 'net.o2oa.app.flutter.o2_flutter:flutter_release:1.0' implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation "org.jetbrains.anko:anko-common:$anko_version" implementation('androidx.legacy:legacy-support-v4:1.0.0') implementation('androidx.recyclerview:recyclerview:1.2.1') { exclude module: 'support-v4' } implementation('androidx.appcompat:appcompat:1.2.0') implementation('androidx.cardview:cardview:1.0.0') implementation('com.google.android.material:material:1.2.0') implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.multidex:multidex:2.0.1' implementation 'com.github.PhilJay:MPAndroidChart:v2.2.4' implementation('com.github.bumptech.glide:glide:4.12.0') implementation 'com.afollestad.material-dialogs:core:0.8.5.9' implementation(name: 'changeskin-1.3.0', ext: 'aar') implementation 'io.o2oa:signatureview:1.0.0' implementation 'com.github.fancylou:CalendarView:v1.2.0' implementation 'com.readystatesoftware.systembartint:systembartint:1.0.3' implementation 'com.facebook.shimmer:shimmer:0.1.0@aar' implementation 'com.borax12.materialdaterangepicker:library:1.9' implementation 'com.yanzhenjie.recyclerview:x:1.3.2' implementation 'com.race604.waveloading:library:1.1.1' implementation 'com.squareup.retrofit2:retrofit:2.4.0' implementation 'com.squareup.retrofit2:converter-gson:2.2.0' implementation 'com.squareup.retrofit2:adapter-rxjava:2.0.2' implementation 'com.squareup.okhttp3:okhttp:3.11.0' implementation 'io.reactivex:rxjava:1.1.6' implementation 'io.reactivex:rxandroid:1.2.1' /////////////////////////////////////////////////推送/////////////////////// implementation project(':jiguang') implementation 'com.contrarywind:Android-PickerView:4.1.9' //滚动选择器 implementation 'com.jzxiang.pickerview:TimePickerDialog:1.0.1' //链式方式获取Activity返回结果 implementation 'com.github.lwugang:ActivityResult:59b23e3682' //google architecture component // ViewModel and LiveData implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' // alternatively - just ViewModel implementation 'androidx.lifecycle:lifecycle-viewmodel:2.2.0' // use -ktx for Kotlin // alternatively - just LiveData implementation 'androidx.lifecycle:lifecycle-livedata:2.2.0' // Support library depends on this lightweight import implementation 'androidx.lifecycle:lifecycle-runtime:2.2.0' //noinspection LifecycleAnnotationProcessorWithJava8 annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.2.0' implementation 'com.google.code.gson:gson:2.8.5' //GSYVideo播放器 implementation('com.shuyu:GSYVideoPlayer:8.0.0') //mp3录音 implementation 'com.github.zhaolewei:ZlwAudioRecorder:v1.07' //gif 播放 implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.24' // 图片放大缩小 implementation 'com.davemorrissey.labs:subsampling-scale-image-view-androidx:3.10.0' implementation 'com.huawei.hms:push:6.12.0.300' testImplementation 'junit:junit:4.12' } tasks.whenTaskAdded { task -> if (task.name == "lint") { task.enabled = false } }