apply plugin: 'com.android.application' apply plugin: 'com.jakewharton.butterknife' apply plugin: 'realm-android' //获取系统时间 def releaseTime() { return new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("UTC")) } android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion flavorDimensions "default" defaultConfig { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 304 versionName "3.0.0" multiDexEnabled true vectorDrawables.useSupportLibrary = true ndk { abiFilters 'armeabi-v7a',"arm64-v8a" } sourceSets { main { jniLibs.srcDirs = ['libs'] } } } signingConfigs { release { keyAlias 'zuowuxuxi' keyPassword 'myxiake1q' storeFile file('qpython.key') storePassword 'myxiake1q' v1SigningEnabled true v2SigningEnabled false } debug { storeFile file("../debug.keystore") } } buildTypes { release { minifyEnabled false shrinkResources false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release //修改生成的包名 applicationVariants.all { variant -> variant.outputs.each { output -> def outputFile = output.outputFile if (outputFile != null && outputFile.name.endsWith('.apk')) { def fileName = "qpython_os_${releaseTime()}_${variant.productFlavors[0].name}.apk" output.outputFileName = fileName } } } } debug { signingConfig signingConfigs.release } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } dataBinding { enabled = true } lintOptions { disable 'MissingTranslation' abortOnError false } //为了解决部分第三方库重复打包了META-INF的问题 packagingOptions { exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' } //设置渠道 productFlavors { ol { // resValue "string", "app_name", "Qpython" applicationId "org.qpython.qpy" } os { // resValue "string", "app_name", "Qpython" applicationId "org.qpython.qpy" } od { // resValue "string", "app_name", "Qpython" applicationId "org.qpython.qpy" } op { // resValue "string", "app_name", "QpythonL" applicationId "com.hipipal.qpyplus" } oh { // resValue "string", "app_name", "QpythonL" applicationId "com.hipipal.qpyplus" } } repositories { flatDir { dirs 'libs' } } // dexOptions { // incremental =true // } } configurations { all*.exclude group: 'commons-logging', module: 'commons-logging' } dependencies { //api rootProject.ext.libButterknife //annotationProcessor rootProject.ext.libButterknifeCompiler api fileTree(include: ['*.jar'], dir: 'libs') api fileTree(include: ['*.so'], dir: 'libs') api project(':termemulator') api project(':termexec') api project(':qpypluginman') api project(':qpysdk') api files('libs/markdown4j.jar') //api files('libs/android-async-http-1.4.8.aar') //api 'com.loopj.android:android-async-http:1.4.8' api('com.github.afollestad.material-dialogs:commons:0.8.5.6') { transitive = true } api 'me.zhanghai.android.materialprogressbar:library:1.1.4' api 'org.apmem.tools:layouts:1.9@aar' api 'com.azeesoft.lib.colorpicker:colorpicker:1.0.8@aar' api 'com.googlecode.juniversalchardet:juniversalchardet:1.0.3' api 'com.daimajia.numberprogressbar:library:1.2@aar' api 'org.litepal.android:core:1.3.1' api 'me.dm7.barcodescanner:zxing:1.9' api 'com.android.support:multidex:1.0.1' api rootProject.ext.libOkHttp3 api rootProject.ext.libOkHttp3Log api 'com.squareup.okio:okio:1.9.0' api 'com.google.code.gson:gson:2.7' api 'com.yanzhenjie:recyclerview-swipe:1.1.3' api rootProject.ext.libRxAndroid api rootProject.ext.libRxJava api rootProject.ext.libSupportCardView api rootProject.ext.libSupportPreference osApi rootProject.ext.firebaseCore osApi rootProject.ext.firebaseMsg osApi rootProject.ext.firebaseAuth osApi rootProject.ext.firebaseDatabase osApi rootProject.ext.googlePlayServiceAuth olApi rootProject.ext.firebaseCore olApi rootProject.ext.firebaseMsg olApi rootProject.ext.firebaseAuth olApi rootProject.ext.firebaseDatabase olApi rootProject.ext.googlePlayServiceAuth api rootProject.ext.retrofit api rootProject.ext.retrofitCoverterGson api rootProject.ext.retrofitAdapterRxjava api 'com.android.support.constraint:constraint-layout:1.0.2' // 微信 opApi('com.tencent.mm.opensdk:wechat-sdk-android-with-mta:1.4.0') { exclude group: 'com.android.support:support-v4' } // 友盟统计 opApi('com.umeng.analytics:analytics:6.1.2') { exclude group: 'com.android.support:support-v4' } ohApi('com.tencent.mm.opensdk:wechat-sdk-android-with-mta:1.4.0') { exclude group: 'com.android.support:support-v4' } // 友盟统计 ohApi('com.umeng.analytics:analytics:6.1.2') { exclude group: 'com.android.support:support-v4' } api 'com.youth.banner:banner:1.4.10' } apply plugin: 'com.google.gms.google-services'