浏览代码

升级gradle

zengjiebin 7 年之前
父节点
当前提交
32606e0241

+ 104 - 103
app/build.gradle

@@ -3,12 +3,12 @@ apply plugin: 'com.jakewharton.butterknife'
 apply plugin: 'org.greenrobot.greendao'
 //apply plugin: 'realm-android'//Realm数据库
 android {
-    compileSdkVersion androidConfigs.compileSdkVersion
-    buildToolsVersion androidConfigs.buildToolsVersion
+    compileSdkVersion ANDROID_COMPILE_SDK_VERSION as int
+    buildToolsVersion ANDROID_BUILD_TOOLS_VERSION
     defaultConfig {
         applicationId "com.sheep.jiuyan.samllsheep"
-        minSdkVersion 18
-        targetSdkVersion 27
+        minSdkVersion ANDROID_MIN_SDK_VERSION as int
+        targetSdkVersion ANDORID_TARGET_SDK_VERSION as int
         versionCode VERSION_CODE as int
         versionName VERSION_NAME
         multiDexEnabled true
@@ -20,6 +20,7 @@ android {
 //            enabled true
 //        }
         multiDexEnabled true
+        flavorDimensions "versionCode"
     }
     greendao {
         schemaVersion 11
@@ -132,154 +133,154 @@ repositories {
 
 dependencies {
     //noinspection GradleCompatible
-    compile 'com.android.support:cardview-v7:28.0.0-rc01'
-    compile "com.android.support:design:$supportLibVersion"
-    compile 'com.android.support.constraint:constraint-layout:1.0.2'
-    testCompile 'junit:junit:4.12'
-    compile 'com.google.code.gson:gson:2.8.2'
-    compile('com.jcodecraeer:xrecyclerview:1.5.9') {
-        //    compile 'com.shark:screencapture:1.0.0'
+    implementation 'com.android.support:cardview-v7:28.0.0-rc01'
+    implementation "com.android.support:design:$supportLibVersion"
+    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
+    testImplementation 'junit:junit:4.12'
+    implementation 'com.google.code.gson:gson:2.8.2'
+    implementation('com.jcodecraeer:xrecyclerview:1.5.9') {
+        //    implementation 'com.shark:screencapture:1.0.0'
         exclude group: 'com.android.support', module: 'design'
     }
-    compile 'com.squareup.okhttp3:okhttp:3.10.0'
-    compile 'org.greenrobot:eventbus:3.1.1'
-    compile 'com.zhy:base-adapter:3.0.3'
+    implementation 'com.squareup.okhttp3:okhttp:3.10.0'
+    implementation 'org.greenrobot:eventbus:3.1.1'
+    implementation 'com.zhy:base-adapter:3.0.3'
 
-    //    compile 'com.liulishuo.filedownloader:library:1.6.9'
-    compile 'com.tencent.bugly:crashreport_upgrade:1.3.4'
+    //    implementation 'com.liulishuo.filedownloader:library:1.6.9'
+    implementation 'com.tencent.bugly:crashreport_upgrade:1.3.4'
 
     //其中latest.release指代最新版本号,也可以指定明确的版本号,例如1.2.0
-    compile 'com.tencent.bugly:nativecrashreport:3.3.1'
+    implementation 'com.tencent.bugly:nativecrashreport:3.3.1'
 
     //其中latest.release指代最
 
-    compile 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:5.1.6'
-    debugCompile('com.readystatesoftware.chuck:library:1.1.0') {
+    implementation 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:5.1.6'
+    debugImplementation('com.readystatesoftware.chuck:library:1.1.0') {
         exclude group: 'com.android.support', module: 'design'
     }
 
-    //    compile 'de.hdodenhof:circleimageview:2.2.0'
-    releaseCompile('com.readystatesoftware.chuck:library-no-op:1.1.0') {
+    //    implementation 'de.hdodenhof:circleimageview:2.2.0'
+    releaseImplementation('com.readystatesoftware.chuck:library-no-op:1.1.0') {
         exclude group: 'com.android.support', module: 'design'
     }
-    compile 'org.xutils:xutils:3.5.0'
-    compile 'com.mylhyl:acp:1.1.7'
+    implementation 'org.xutils:xutils:3.5.0'
+    implementation 'com.mylhyl:acp:1.1.7'
 
-    compile 'cn.yipianfengye.android:zxing-library:2.2'
-    compile 'com.github.huburt-Hu:NewbieGuide:v1.2.0'
-    debugCompile 'com.android.support:multidex:1.0.1'
+    implementation 'cn.yipianfengye.android:zxing-library:2.2'
+    implementation 'com.github.huburt-Hu:NewbieGuide:v1.2.0'
+    debugImplementation 'com.android.support:multidex:1.0.1'
 
     //不要修改这里,相信我
-    releaseCompile 'com.android.support:multidex:1.0.3'
-    compile(name: 'com.kfzs.safe-201809211354', ext: 'aar')
+    releaseImplementation 'com.android.support:multidex:1.0.3'
+    implementation(name: 'com.kfzs.safe-201809211354', ext: 'aar')
 
     //butterknife
-    compile 'com.jakewharton:butterknife:8.8.1'
+    implementation 'com.jakewharton:butterknife:8.8.1'
     annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
 
     //dagger2
 
-    //    compile 'com.google.dagger:dagger:+'
+    //    implementation 'com.google.dagger:dagger:+'
 
-    //    compile 'com.google.dagger:dagger-compiler:+'
-    provided 'org.glassfish:javax.annotation:10.0-b28'
-    compile 'com.google.dagger:dagger:2.12'
+    //    implementation 'com.google.dagger:dagger-compiler:+'
+    compileOnly 'org.glassfish:javax.annotation:10.0-b28'
+    implementation 'com.google.dagger:dagger:2.12'
     annotationProcessor 'com.google.dagger:dagger-compiler:2.12'
 
     //retrofit
-    compile 'com.squareup.retrofit2:retrofit:2.4.0'
-    compile 'com.squareup.retrofit2:converter-gson:2.4.0'
-    compile 'com.squareup.okhttp3:logging-interceptor:3.10.0'
+    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
+    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
+    implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
 
-    //    compile 'com.squareup.retrofit2:adapter-rxjava2:+'
-    compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
+    //    implementation 'com.squareup.retrofit2:adapter-rxjava2:+'
+    implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
 
     //rxjava
-    compile 'io.reactivex.rxjava2:rxandroid:2.0.2'
-    compile 'io.reactivex.rxjava2:rxjava:2.1.12'
+    implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
+    implementation 'io.reactivex.rxjava2:rxjava:2.1.12'
 
     //获取动态权限三方库
-    compile 'pub.devrel:easypermissions:1.2.0'
-    compile 'net.danlew:android.joda:2.9.3'
-    compile 'com.orhanobut:logger:1.15'
+    implementation 'pub.devrel:easypermissions:1.2.0'
+    implementation 'net.danlew:android.joda:2.9.3'
+    implementation 'com.orhanobut:logger:1.15'
 
     //友盟
-    compile 'com.umeng.sdk:common:1.5.3'
+    implementation 'com.umeng.sdk:common:1.5.3'
 
-    //compile 'com.umeng.sdk:analytics:latest.integration'
+    //implementation 'com.umeng.sdk:analytics:latest.integration'
 
     //fast json
-    compile 'com.alibaba:fastjson:1.2.47'
+    implementation 'com.alibaba:fastjson:1.2.47'
 
     //添加半袋米相关
-    compile(name: 'appstoreutils-201810101432', ext: 'aar')
-    compile project(':view')
-
-    //    compile(name: 'view-release', ext: 'aar')
-    compile 'com.flipboard:bottomsheet-core:1.5.3'
-    compile 'com.flipboard:bottomsheet-commons:1.5.3'
-
-    compile files('libs/open_sdk_r5923_lite.jar')
-//    compile files('libs/wechat-sdk-android-with-mta-1.1.6.jar')
-    compile files('libs/umeng_social_tool.jar')
-    compile files('libs/umeng_social_shareboard.jar')
-    compile files('libs/umeng_social_net.jar')
-    compile files('libs/umeng_social_api.jar')
-    compile files('libs/umeng_shareboard_widget.jar')
-    compile files('libs/SocialSDK_WeiXin_Full.jar')
-    compile files('libs/SocialSDK_QQ_Full.jar')
-    compile 'com.zhy:okhttputils:2.6.2'
-
-    //    compile 'com.kf.framework:kf-utils:latest.integration@aar'
-    compile 'com.kf.framework:kf-utils:1.4.5@aar'
-
-    //    compile 'com.kf.framework:volleyplus:latest.integration@aar'
-    compile 'com.kf.framework:volleyplus:1.4.5@aar'
-    compile "com.android.support:support-annotations:$supportLibVersion"
-    compile "com.android.support:recyclerview-v7:$supportLibVersion"
-//    compile project(':datashare')
-    compile files('libs/jackson-core-2.2.1.jar')
-    compile files('libs/jackson-dataformat-xml-2.1.2.jar')
-    compile 'io.reactivex:rxandroid:1.2.1'
-    compile 'com.github.ithedan:TextViewDrawable:v1.0'
-//    compile 'com.github.zhangkexpz:LayoutScroll:v1.0'
-//    compile 'me.iwf.photopicker:PhotoPicker:0.9.12@aar'
-    compile(name: 'PhotoPicker-release-201810081154', ext: 'aar')
-    compile 'com.github.bumptech.glide:glide:4.1.1'
-
-    //    compile 'com.github.yalantis:ucrop:2.2.1-native'
-
-    //    compile 'com.google.zxing:core:3.3.0'
-    compile project(':ucrop')
-    compile('com.arialyy.aria:aria-core:3.3.16') {
+    implementation(name: 'appstoreutils-201810101432', ext: 'aar')
+    implementation project(':view')
+
+    //    implementation(name: 'view-release', ext: 'aar')
+    implementation 'com.flipboard:bottomsheet-core:1.5.3'
+    implementation 'com.flipboard:bottomsheet-commons:1.5.3'
+
+    implementation files('libs/open_sdk_r5923_lite.jar')
+//    implementation files('libs/wechat-sdk-android-with-mta-1.1.6.jar')
+    implementation files('libs/umeng_social_tool.jar')
+    implementation files('libs/umeng_social_shareboard.jar')
+    implementation files('libs/umeng_social_net.jar')
+    implementation files('libs/umeng_social_api.jar')
+    implementation files('libs/umeng_shareboard_widget.jar')
+    implementation files('libs/SocialSDK_WeiXin_Full.jar')
+    implementation files('libs/SocialSDK_QQ_Full.jar')
+    implementation 'com.zhy:okhttputils:2.6.2'
+
+    //    implementation 'com.kf.framework:kf-utils:latest.integration@aar'
+    implementation 'com.kf.framework:kf-utils:1.4.5@aar'
+
+    //    implementation 'com.kf.framework:volleyplus:latest.integration@aar'
+    implementation 'com.kf.framework:volleyplus:1.4.5@aar'
+    implementation "com.android.support:support-annotations:$supportLibVersion"
+    implementation "com.android.support:recyclerview-v7:$supportLibVersion"
+//    implementation project(':datashare')
+    implementation files('libs/jackson-core-2.2.1.jar')
+    implementation files('libs/jackson-dataformat-xml-2.1.2.jar')
+    implementation 'io.reactivex:rxandroid:1.2.1'
+    implementation 'com.github.ithedan:TextViewDrawable:v1.0'
+//    implementation 'com.github.zhangkexpz:LayoutScroll:v1.0'
+//    implementation 'me.iwf.photopicker:PhotoPicker:0.9.12@aar'
+    implementation(name: 'PhotoPicker-release-201810081154', ext: 'aar')
+    implementation 'com.github.bumptech.glide:glide:4.1.1'
+
+    //    implementation 'com.github.yalantis:ucrop:2.2.1-native'
+
+    //    implementation 'com.google.zxing:core:3.3.0'
+    implementation project(':ucrop')
+    implementation('com.arialyy.aria:aria-core:3.3.16') {
         exclude group: 'com.android.support'
     }
-//    compile project(':Aria')
+//    implementation project(':Aria')
 
     annotationProcessor 'com.arialyy.aria:aria-compiler:3.3.16'
-    compile 'com.sunfusheng:marqueeview:1.3.3'
-    compile files('libs/alipaySdk-20170922.jar')
+    implementation 'com.sunfusheng:marqueeview:1.3.3'
+    implementation files('libs/alipaySdk-20170922.jar')
     //极光
-    compile files('libs/jcore-android-1.2.0.jar')
-    compile files('libs/jpush-android-3.1.2.jar')
+    implementation files('libs/jcore-android-1.2.0.jar')
+    implementation files('libs/jpush-android-3.1.2.jar')
 
     //定位
-    compile files('libs/BaiduLBS_Android.jar')
+    implementation files('libs/BaiduLBS_Android.jar')
 
     //幂动科技
-    compile files('libs/mdsdk-201810101155.jar')
+    implementation files('libs/mdsdk-201810101155.jar')
     //轮播图
-    compile 'com.youth.banner:banner:1.4.10'  //最新版本
+    implementation 'com.youth.banner:banner:1.4.10'  //最新版本
     //loading
-    compile 'com.github.ybq:Android-SpinKit:1.1.0'
-//    compile 'com.github.nanchen2251:CompressHelper:1.0.5'
-//    compile(name: 'compresshelper-release', ext: 'aar')
-    compile files('libs/compresshelper-release.jar')
-    compile 'com.haibin:calendarview:3.4.4'
+    implementation 'com.github.ybq:Android-SpinKit:1.1.0'
+//    implementation 'com.github.nanchen2251:CompressHelper:1.0.5'
+//    implementation(name: 'compresshelper-release', ext: 'aar')
+    implementation files('libs/compresshelper-release.jar')
+    implementation 'com.haibin:calendarview:3.4.4'
 
-    compile 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-alpha-14'
+    implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-alpha-14'
 
-    compile 'org.greenrobot:greendao:3.2.2'
+    implementation 'org.greenrobot:greendao:3.2.2'
 }
 
 static def releaseTime() {
@@ -288,10 +289,10 @@ static def releaseTime() {
 //在apk文件后边生成版本号信息
 android.applicationVariants.all {
     variant ->
-        variant.outputs.each {
+        variant.outputs.all {
             output ->
                 if (buildType.name == "release") {
-                    output.outputFile = new File(output.outputFile.parent, productFlavors[0].name + "_" + buildType.name + "_v" + android.defaultConfig.versionName + "_" + android.defaultConfig.versionCode + "-${releaseTime()}.apk")
+                    outputFileName = productFlavors[0].name + "_" + buildType.name + "_v" + android.defaultConfig.versionName + "_" + android.defaultConfig.versionCode + "-${releaseTime()}.apk"
                 }
 
         }

+ 0 - 3
app/src/main/AndroidManifest.xml

@@ -86,9 +86,6 @@
         android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"
         tools:ignore="ProtectedPermissions" />
     <!-- 百度定位权限 end -->
-    <permission
-        android:name="android.permission.PACKAGE_USAGE_STATS"
-        tools:ignore="ProtectedPermissions" />
 
     <application
         android:name=".SheepApp"

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/view/adapter/TaskdetailSonListviewAdp.java

@@ -276,7 +276,7 @@ public class TaskdetailSonListviewAdp extends BaseAdapter {
             ar_code_layout.setVisibility(View.GONE);
         }else {
             if(taskReleaseEty.isIs_running()){
-                GlideImageLoader.downloadAndRoundedImage(taskReleaseEty.getTask().getTask_name(), taskReleaseEty.getTask().getQr_code(), (ImageView) qr_code_iv,
+                GlideImageLoader.downloadAndRoundedImage(String.valueOf(taskReleaseEty.getTask().getQr_code().hashCode()), taskReleaseEty.getTask().getQr_code(), (ImageView) qr_code_iv,
                         context.getResources().getDimensionPixelSize(R.dimen.content_padding_150), context.getResources().getDimensionPixelSize(R.dimen.content_padding_8));
                 btn_task_item.setVisibility(View.VISIBLE);
                 qr_code_notice_tv.setVisibility(View.GONE);
@@ -284,7 +284,7 @@ public class TaskdetailSonListviewAdp extends BaseAdapter {
                     @Override
                     public void onClick(View v) {
                         TASK_SAVE_QR.onEvent();
-                        GlideImageLoader.downLoadImage(taskReleaseEty.getTask().getTask_name(), taskReleaseEty.getTask().getQr_code(), new Action1<File>() {
+                        GlideImageLoader.downLoadImage(String.valueOf(taskReleaseEty.getTask().getQr_code().hashCode()), taskReleaseEty.getTask().getQr_code(), new Action1<File>() {
                             @Override
                             public void call(File file) {
                                 G.showToast("保存成功,图片路径:" + file.getAbsolutePath());

+ 2 - 2
build.gradle

@@ -9,7 +9,7 @@ buildscript {
         google()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:2.3.3'
+        classpath 'com.android.tools.build:gradle:3.2.0'
         classpath 'com.jakewharton:butterknife-gradle-plugin:+'
         classpath 'com.neenbedankt.gradle.plugins:android-apt:+'
         classpath 'org.greenrobot:greendao-gradle-plugin:3.1.0'
@@ -53,7 +53,7 @@ ext {
             compileSdkVersion: 27,
             minSdkVersion    : 15,
             targetSdkVersion : 27,
-            buildToolsVersion: '27.0.2',
+            buildToolsVersion: '28.0.2',
             /**
              * app-module
              */

+ 2 - 2
gradle.properties

@@ -19,8 +19,8 @@
 
 VERSION_NAME=3.2.7
 VERSION_CODE=3002007
-ANDROID_COMPILE_SDK_VERSION=27
-ANDROID_BUILD_TOOLS_VERSION=27.0.2
+ANDROID_COMPILE_SDK_VERSION=28
+ANDROID_BUILD_TOOLS_VERSION=28.0.2
 ANDROID_MIN_SDK_VERSION=18
 ANDORID_TARGET_SDK_VERSION=27
 

+ 2 - 2
gradle/wrapper/gradle-wrapper.properties

@@ -1,6 +1,6 @@
-#Sat Jan 27 17:34:14 CST 2018
+#Thu Oct 11 11:30:42 CST 2018
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

+ 4 - 4
ucrop/build.gradle

@@ -2,8 +2,8 @@ apply plugin: 'com.android.library'
 apply from: '../mavenpush.gradle'
 
 android {
-    compileSdkVersion 27
-    buildToolsVersion '27.0.2'
+    compileSdkVersion ANDROID_COMPILE_SDK_VERSION as int
+    buildToolsVersion ANDROID_BUILD_TOOLS_VERSION
 
     defaultConfig {
         minSdkVersion 14
@@ -36,6 +36,6 @@ android {
 }
 
 dependencies {
-    compile 'com.android.support:appcompat-v7:27.0.2'
-    compile 'com.squareup.okhttp3:okhttp:3.8.1'
+    implementation "com.android.support:appcompat-v7:$supportLibVersion"
+    implementation 'com.squareup.okhttp3:okhttp:3.8.1'
 }

+ 6 - 6
view/build.gradle

@@ -28,12 +28,12 @@ android {
 }
 
 dependencies {
-    compile "com.android.support:appcompat-v7:$supportLibVersion"
-    compile "com.android.support:support-v4:$supportLibVersion"
-    compile files('libs/tbs_sdk_thirdapp_v3.6.0.1325.jar')
-//    compile 'com.github.bumptech.glide:glide:3.7.0'
-//    compile ('jp.wasabeef:glide-transformations:2.0.2'){
+    implementation "com.android.support:appcompat-v7:$supportLibVersion"
+    implementation "com.android.support:support-v4:$supportLibVersion"
+    api files('libs/tbs_sdk_thirdapp_v3.6.0.1325.jar')
+//    implementation 'com.github.bumptech.glide:glide:3.7.0'
+//    implementation ('jp.wasabeef:glide-transformations:2.0.2'){
 //        exclude group: 'com.github.bumptech.glide', module: 'glide'
 //    }
-//    compile project(':sheep')
+//    implementation project(':sheep')
 }