didi / didi/booster

booster-transform-r-inline not full delete R&styleable field

Open
#447 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
5.1k
Forks
591
PR merge metrics
No merged PRs in 30d

Description

Please provide the following informations.

- System version
win11
- Java version
java 11
- Gradle version
7.5
- Android Gradle plugin version
7.3
- Booster version
4.16.3
- Stack traces

R&styleable 被内联之后,旧的 R&styleable 的变量声明被删除了,但是变量赋值还在

styleable 类 由:

public static final class styleable {
static {
public static final int[] ActionBar = new int[]{.........};
public static final int[] ActionBarLayout = new int[]{16842931};
public static final int[] ActionMenuItemView = new int[]{16843071};
}
}

变为了:

public static final class styleable {
static {
ActionBar = new int[]{.........};
ActionBarLayout = new int[]{16842931};
ActionMenuItemView = new int[]{16843071};
}
}

缺少了变量名称前的 变量类型声明
例如:public static final int[] ActionBar = new int[]{.........}; 前面的 public static final int[] 不见了

项目组件化之后,如何使用插件检测类的变量是否存在,会报错
因为,class 文件中,对变量的引用和赋值还在,但是,变量的声明不见了

能否将变量的赋值也进行删除

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.