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

关于toTransform的使用 #216

Open
5peak2me opened this issue Nov 26, 2024 · 2 comments
Open

关于toTransform的使用 #216

5peak2me opened this issue Nov 26, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@5peak2me
Copy link

5peak2me commented Nov 26, 2024

其实toTransform是有提供jarsdirs输出的方法的,只是是internal的。
image

此时想要调用该方法,有两种方法:

  1. 使用反射
  2. 直接调用,使用@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")注解即可调用。
@kymjs kymjs added the enhancement New feature or request label Nov 26, 2024
@kymjs
Copy link
Collaborator

kymjs commented Nov 26, 2024

特意去看了一下7.X还没有,从8.0开始有这个实现的,看起来应该是还没确定怎么对外提供,所以被修饰成internal,这也是我一直疑惑的点,参考这篇文章 https://kymjs.com/code/2024/10/31/01/,没想到在这里找到了答案。

等后续这个方法开放以后再做支持吧,翻了一下8.11的源码,这个方法也还是internal,不过对应的公开方法入参类型已经换成了泛型,希望能尽快吧,留个链接后续观察 https://android.googlesource.com/platform/tools/base/+/89fdfaa8e028b64caa132e8c20e47cfd4f34e7e1/build-system/gradle-core/src/main/java/com/android/build/api/artifact/impl/ScopedArtifactsImpl.kt

@5peak2me
Copy link
Author

5peak2me commented Nov 26, 2024

大概率是不会公开这个API的,toTransformtoGet是接口方法,此方法是内部实现。经历了七八个版本了,而且AsmClassVisitorFactory的实现就是基于该方法。已经稳定很久了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants