File tree Expand file tree Collapse file tree
gradle-plugin/src/main/groovy/robust/gradle/plugin Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77手机系统版本:如: Android 5.0 (如是编译异常,则可以不填)
88
9- Robust版本:如:0.4.80
9+ Robust版本:如:0.4.81
1010
1111Gradle版本:如:2.10
1212
Original file line number Diff line number Diff line change 11
22# Robust
3- [ ![ Download] ( https://api.bintray.com/packages/meituan/maven/com.meituan.robust%3Apatch/images/download.svg?version=0.4.80 ) ] ( https://bintray.com/meituan/maven/com.meituan.robust%3Apatch/0.4.80 /link )
3+ [ ![ Download] ( https://api.bintray.com/packages/meituan/maven/com.meituan.robust%3Apatch/images/download.svg?version=0.4.81 ) ] ( https://bintray.com/meituan/maven/com.meituan.robust%3Apatch/0.4.81 /link )
44 [ ![ PRs Welcome] ( https://img.shields.io/badge/PRs-welcome-brightgreen.svg )] ( https://github.com/Meituan-Dianping/Robust/pulls )
55 [ ![ License] ( https://img.shields.io/badge/License-Apache%202.0-blue.svg )] ( https://raw.githubusercontent.com/Meituan-Dianping/Robust/master/LICENSE )
66
2828 apply plugin: 'robust'
2929
3030
31- compile 'com.meituan.robust:robust:0.4.80 '
31+ compile 'com.meituan.robust:robust:0.4.81 '
3232
3333 ```
3434 2 . 在整个项目的build.gradle加入classpath
3939 jcenter()
4040 }
4141 dependencies {
42- classpath 'com.meituan.robust:gradle-plugin:0.4.80 '
43- classpath 'com.meituan.robust:auto-patch-plugin:0.4.80 '
42+ classpath 'com.meituan.robust:gradle-plugin:0.4.81 '
43+ classpath 'com.meituan.robust:auto-patch-plugin:0.4.81 '
4444 }
4545 }
4646 ```
Original file line number Diff line number Diff line change 11
22# Robust
33
4- [ ![ Download] ( https://api.bintray.com/packages/meituan/maven/com.meituan.robust%3Apatch/images/download.svg?version=0.4.80 ) ] ( https://bintray.com/meituan/maven/com.meituan.robust%3Apatch/0.4.80 /link )
4+ [ ![ Download] ( https://api.bintray.com/packages/meituan/maven/com.meituan.robust%3Apatch/images/download.svg?version=0.4.81 ) ] ( https://bintray.com/meituan/maven/com.meituan.robust%3Apatch/0.4.81 /link )
55[ ![ PRs Welcome] ( https://img.shields.io/badge/PRs-welcome-brightgreen.svg )] ( https://github.com/Meituan-Dianping/Robust/pulls )
66[ ![ License] ( https://img.shields.io/badge/License-Apache%202.0-blue.svg )] ( https://raw.githubusercontent.com/Meituan-Dianping/Robust/master/LICENSE )
77
@@ -26,7 +26,7 @@ Robust is an Android HotFix solution with high compatibility and high stability.
2626 //please uncomment fellow line before you build a patch
2727 //apply plugin: 'auto-patch-plugin'
2828 apply plugin: 'robust'
29- compile 'com.meituan.robust:robust:0.4.80 '
29+ compile 'com.meituan.robust:robust:0.4.81 '
3030 ```
31312 . Add below codes in the outest project's build.gradle file.
3232
@@ -36,8 +36,8 @@ Robust is an Android HotFix solution with high compatibility and high stability.
3636 jcenter()
3737 }
3838 dependencies {
39- classpath 'com.meituan.robust:gradle-plugin:0.4.80 '
40- classpath 'com.meituan.robust:auto-patch-plugin:0.4.80 '
39+ classpath 'com.meituan.robust:gradle-plugin:0.4.81 '
40+ classpath 'com.meituan.robust:auto-patch-plugin:0.4.81 '
4141 }
4242 }
4343 ```
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ buildscript {
99 classpath ' com.android.tools.build:gradle:2.1.0'
1010 // NOTE: Do not place your application dependencies here; they belong
1111 // in the individual module build.gradle files
12- classpath ' com.meituan.robust:gradle-plugin:0.4.80 '
13- classpath ' com.meituan.robust:auto-patch-plugin:0.4.80 '
12+ classpath ' com.meituan.robust:gradle-plugin:0.4.81 '
13+ classpath ' com.meituan.robust:auto-patch-plugin:0.4.81 '
1414 classpath ' me.tatarka:gradle-retrolambda:3.2.0'
1515 classpath ' com.github.dcendents:android-maven-gradle-plugin:1.3'
1616 classpath ' com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
Original file line number Diff line number Diff line change @@ -204,11 +204,32 @@ class RobustApkHashAction implements Action<Project> {
204204
205205 public static boolean isGradlePlugin300orAbove () {
206206 try {
207- String gradlePluginVersion = com.android.builder.Version . ANDROID_GRADLE_PLUGIN_VERSION
207+ String gradlePluginVersion = getGradlePluginVersion()
208208 return gradlePluginVersion. compareTo(" 3.0.0" ) >= 0 ;
209209 } catch (Throwable throwable) {
210210
211211 }
212212 return false ;
213213 }
214+
215+ static String getGradlePluginVersion () {
216+ String version = null
217+ try {
218+ def clazz = Class . forName(" com.android.builder.Version" )
219+ def field = clazz. getDeclaredField(" ANDROID_GRADLE_PLUGIN_VERSION" )
220+ field. setAccessible(true )
221+ version = field. get(null )
222+ } catch (Exception ignore) {
223+ }
224+ if (version == null ) {
225+ try {
226+ def clazz = Class . forName(" com.android.builder.model.Version" )
227+ def field = clazz. getDeclaredField(" ANDROID_GRADLE_PLUGIN_VERSION" )
228+ field. setAccessible(true )
229+ version = field. get(null )
230+ } catch (Exception ignore) {
231+ }
232+ }
233+ return version
234+ }
214235}
Original file line number Diff line number Diff line change 1616# This option should only be used with decoupled projects. More details, visit
1717# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1818# org.gradle.parallel=true
19- VERSION_NAME =0.4.80
19+ VERSION_NAME =0.4.81
2020GROUP =com.meituan.robust
2121
You can’t perform that action at this time.
0 commit comments