StableId
Introduction: Android 固定资源 id,适配 aapt,aapt2
Tags:
固定 android 资源 id,适配 aapt 和 aapt2 的资源编译模式。
使用
1.Maven 仓库的 SNAPSHOT 版本,在 buildscript 中加入 maven 快照仓库,并加入 classpath 依赖。
repositories {
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
classpath 'com.github.lauhwong:stableid:1.0.3-SNAPSHOT'
}
2.在 application 插件中引入 stable-id 插件。
apply plugin: 'com.miracles.stableid'
3.配置 public.xml 文件,定义固定资源 id.可以在 build.gradle 中做一下的 extension dsl 配置。
stableXmlConfig{
inXmlPath file("public.xml").absolutePath
}
或者,如果不配置该选项默认选择 resDir/values/public.xml。