Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin gradle 注入代码失败的 #166

Closed
zzz40500 opened this issue Jul 9, 2017 · 6 comments
Closed

plugin gradle 注入代码失败的 #166

zzz40500 opened this issue Jul 9, 2017 · 6 comments

Comments

@zzz40500
Copy link
Contributor

zzz40500 commented Jul 9, 2017

在replugin-plugin-gradle 处理需要注入的jar 中
在方法 com.qihoo360.replugin.gradle.plugin.inner. Util. getProjectClassPath(xx)

// 不处理 Project 之外的文件
  | if (!jarPath.contains(projectDir)) {
  | classPath << jarPath
  | println ">>> Skip ${jarPath}"
  | } 

 这里的逻辑是你的jar不在项目的目录结构下, 不被处理.
存在的情况如下

  1. 当你的引用的android gradle 版本较高的是时候,.你的aar依赖包不会放置在项目中的exploded-aar 中,而是有一个全局的Cache目录下.
  2. 你依赖的是一个jar 而不是aar 的时候.
  3. 你依赖的是一个project lib .当这个project lib 不在目录下的时候.

上面3种情况都会导致你的 jar 不在项目目录结构下. 导致你的代码注入失败.或者有别的问题.

@jiongxuan
Copy link
Contributor

您好,非常感谢您发现的问题。

还请问下,您上述提到的这几点,是否已经试过,发现确实有问题呢?
@erhu 兄,一起关注下吧)

@zzz40500
Copy link
Contributor Author

zzz40500 commented Jul 9, 2017

验证过的

@lizhangqu
Copy link
Contributor

确实存在这种情况,尤其是高版本的gradle存在build cache,dim威武

@jiongxuan
Copy link
Contributor

感谢 @zzz40500 的给力提交哈!

@lizhangqu 方便的话Review下改动哈。确保没问题后麻烦回复一声,我就直接Merge了。辛苦!

@lizhangqu
Copy link
Contributor

@jiongxuan 没问题

@jiongxuan
Copy link
Contributor

@zzz40500 您的代码已合入Master。非常感谢!在下一版(2.1.5)中将体现。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants