Gradle的transform API定义了许多范围。但是,关于每个范围的含义的文档很少。有谁知道吗?
/**
* The scope of the content.
*
* <p/>
* This indicates what the content represents, so that Transforms can apply to only part(s)
* of the classes or resources that the build manipulates.
*/
enum Scope {
/** Only the project content */
PROJECT(0x01),
/** Only the project's local dependencies (local jars) */
PROJECT_LOCAL_DEPS(0x02),
/** Only the sub-projects. */
SUB_PROJECTS(0x04),
/** Only the sub-projects's local dependencies (local jars). */
SUB_PROJECTS_LOCAL_DEPS(0x08),
/** Only the external libraries */
EXTERNAL_LIBRARIES(0x10),
/** Code that is being tested by the current variant, including dependencies */
TESTED_CODE(0x20),
/** Local or remote dependencies that are provided-only */
PROVIDED_ONLY(0x40);
private final int value;
Scope(int value) {
this.value = value;
}
public int getValue() {
return value;
}
}
鉴于Android N源代码尚未发布,没有很多好的例子可供阅读。到目前为止,我发现的最好的是realm-java,其中包含一对变换器。
答案 0 :(得分:1)
尝试了许多不同的范围组合。并确定了以下内容;