diff --git a/.gitignore b/.gitignore index 3cfd146..43d566b 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ proguard/ .idea *.iml *.DS_Store +/*/release/ diff --git a/app/build.gradle b/app/build.gradle index 05ef191..b04e170 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,20 +1,20 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 23 - buildToolsVersion "23.0.2" + compileSdkVersion 28 + buildToolsVersion "28.0.3" defaultConfig { applicationId "com.moko.beacon" minSdkVersion 18 - targetSdkVersion 23 + targetSdkVersion 28 versionCode 5 versionName "1.2.2" - } - sourceSets { - lintOptions { - abortOnError false + javaCompileOptions { + annotationProcessorOptions { + includeCompileClasspath = true + } } } @@ -24,25 +24,47 @@ android { } } + signingConfigs { + debug { + v1SigningEnabled true + v2SigningEnabled true + } + release { + v1SigningEnabled true + v2SigningEnabled true + } + } + applicationVariants.all { variant -> - variant.outputs.each { output -> + variant.outputs.all { output -> def outputFile = output.outputFile if (outputFile != null && outputFile.name.endsWith('.apk')) { - //这里修改apk文件名 - def fileName = "MokoBeacon-${defaultConfig.versionName}.apk" + def formatedDate = new Date().format("yyyyMMddHHmm") + def apkFileName = "MokoBeacon_${defaultConfig.versionName}_${formatedDate}.apk" if (outputFile.name.contains('debug')) { - fileName = "MokoBeacon-${defaultConfig.versionName}-debug.apk" + apkFileName = "MokoBeacon_${defaultConfig.versionName}_${formatedDate}_debug.apk" } - output.outputFile = new File(outputFile.parent, fileName) + outputFileName = apkFileName + } + } + } +} + +configurations.all { + resolutionStrategy.eachDependency { DependencyResolveDetails details -> + def requested = details.requested + if (requested.group == 'com.android.support') { + if (!requested.name.startsWith("multidex")) { + details.useVersion '28.0.0' } } } } dependencies { - compile fileTree(include: '*.jar', dir: 'libs') - compile 'com.jakewharton:butterknife:7.0.0' - compile 'com.android.support:support-v4:23.1.0' - compile project(path: ':mokosupport') + implementation fileTree(include: '*.jar', dir: 'libs') + implementation 'com.jakewharton:butterknife:7.0.0' + implementation 'com.android.support:support-v4:28.0.0' + implementation project(path: ':mokosupport') } diff --git a/build.gradle b/build.gradle index 34e9769..7233ea3 100644 --- a/build.gradle +++ b/build.gradle @@ -1,13 +1,15 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.1.3' + classpath 'com.android.tools.build:gradle:3.2.1' } } allprojects { repositories { jcenter() + google() } } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0537aa2..3c04e2f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip \ No newline at end of file diff --git a/mokosupport/build.gradle b/mokosupport/build.gradle index 5e1800d..77ee52e 100644 --- a/mokosupport/build.gradle +++ b/mokosupport/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 23 - buildToolsVersion "23.0.2" + compileSdkVersion 28 + buildToolsVersion '28.0.3' defaultConfig { minSdkVersion 18 - targetSdkVersion 23 + targetSdkVersion 28 versionCode 1 versionName "1.0" } @@ -18,8 +18,8 @@ android { } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'no.nordicsemi.android.support.v18:scanner:1.0.0' - compile 'com.elvishew:xlog:1.3.0' - compile 'no.nordicsemi.android:dfu:0.6.2' + implementation fileTree(dir: 'libs', include: ['*.jar']) + api 'no.nordicsemi.android.support.v18:scanner:1.0.0' + implementation 'com.elvishew:xlog:1.3.0' + api 'no.nordicsemi.android:dfu:0.6.2' }