Skip to content

Commit

Permalink
兼容两个不同路径main.jar的情况;
Browse files Browse the repository at this point in the history
去掉一些不必要的log

Signed-off-by: hedex <hedexmail@gmail.com>
  • Loading branch information
hedex committed May 4, 2017
1 parent 508f54d commit 0ec7b58
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
Binary file added .DS_Store
Binary file not shown.
6 changes: 3 additions & 3 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
apply plugin: 'robust'
compile 'com.meituan.robust:robust:0.3.4'
compile 'com.meituan.robust:robust:0.3.5'
```
2. 在整个项目的build.gradle加入classpath
Expand All @@ -37,8 +37,8 @@
jcenter()
}
dependencies {
classpath 'com.meituan.robust:gradle-plugin:0.3.4'
classpath 'com.meituan.robust:auto-patch-plugin:0.3.4'
classpath 'com.meituan.robust:gradle-plugin:0.3.5'
classpath 'com.meituan.robust:auto-patch-plugin:0.3.5'
}
}
```
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Robust is an Android HotFix solution with high compatibility and high stability.
//please uncomment fellow line before you build a patch
//apply plugin: 'auto-patch-plugin'
apply plugin: 'robust'
compile 'com.meituan.robust:robust:0.3.4'
compile 'com.meituan.robust:robust:0.3.5'
```
2. Add below codes in the outest project's build.gradle file.

Expand All @@ -34,8 +34,8 @@ Robust is an Android HotFix solution with high compatibility and high stability.
jcenter()
}
dependencies {
classpath 'com.meituan.robust:gradle-plugin:0.3.4'
classpath 'com.meituan.robust:auto-patch-plugin:0.3.4'
classpath 'com.meituan.robust:gradle-plugin:0.3.5'
classpath 'com.meituan.robust:auto-patch-plugin:0.3.5'
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class RobustApkHashZipUtils {
return;
}

zos.putNextEntry(new ZipEntry(buildPath(path, file.getName())));
zos.putNextEntry(new ZipEntry(buildPath(path, file.getAbsolutePath().replace(File.separatorChar,"_"))));

FileInputStream fis = new FileInputStream(file);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class RobustTransform extends Transform implements Plugin<Project> {
//FIXME: assembleRelease下屏蔽Prepare,这里因为还没有执行Task,没法直接通过当前的BuildType来判断,所以直接分析当前的startParameter中的taskname,
//另外这里有一个小坑task的名字不能是缩写必须是全称 例如assembleDebug不能是任何形式的缩写输入
if (taskName.endsWith("Debug") && taskName.contains("Debug")) {
logger.warn " Don't register robust transform for debug model !!! task is:${taskName}"
// logger.warn " Don't register robust transform for debug model !!! task is:${taskName}"
isDebugTask = true
break;
}
Expand Down Expand Up @@ -144,13 +144,13 @@ class RobustTransform extends Transform implements Plugin<Project> {

ClassPool classPool = new ClassPool()
project.android.bootClasspath.each {
logger.debug "android.bootClasspath " + (String) it.absolutePath
// logger.debug "android.bootClasspath " + (String) it.absolutePath
classPool.appendClassPath((String) it.absolutePath)
}

def box = ConvertUtils.toCtClasses(inputs, classPool)
def cost = (System.currentTimeMillis() - startTime) / 1000
logger.quiet "check all class cost $cost second, class count: ${box.size()}"
// logger.quiet "check all class cost $cost second, class count: ${box.size()}"
insertRobustCode(box, jarFile)
writeMap2File(methodMap, Constants.METHOD_MAP_OUT_PATH)
cost = (System.currentTimeMillis() - startTime) / 1000
Expand Down Expand Up @@ -205,7 +205,7 @@ class RobustTransform extends Transform implements Plugin<Project> {
boolean addIncrementalChange = false;
ctClass.declaredBehaviors.findAll {
if (ctClass.isInterface() || ctClass.declaredMethods.length < 1) {
println(" class name "+ctClass.name+" should not be insert code ")
// println(" class name "+ctClass.name+" should not be insert code ")
return false;
}
if (!addIncrementalChange) {
Expand All @@ -215,7 +215,7 @@ class RobustTransform extends Transform implements Plugin<Project> {
CtField ctField = new CtField(type, Constants.INSERT_FIELD_NAME, ctClass);
ctField.setModifiers(AccessFlag.PUBLIC | AccessFlag.STATIC)
ctClass.addField(ctField)
logger.debug "ctClass: " + ctClass.getName();
// logger.debug "ctClass: " + ctClass.getName();
}

if (it.getMethodInfo().isStaticInitializer()) {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
VERSION_NAME=0.3.4
VERSION_NAME=0.3.5
GROUP=com.meituan.robust

0 comments on commit 0ec7b58

Please sign in to comment.