在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):2BAB/Seal开源软件地址(OpenSource Url):https://github.com/2BAB/Seal开源编程语言(OpenSource Language):Kotlin 99.4%开源软件介绍(OpenSource Introduction):English | 中文说明 Seal is a Gradle Plugin to resolve AndroidManifest.xml merge conflicts, powered by New Variant/Artifact API & Polyfill. To be noticed, except the tag removing, any other delete/update features should always consider the "tools:replace", "tools:remove", and other official features that ManifestMerger provided as higher priority. Functionality that Seal provided is more like the first aid to save an urgent publish that is blocked by ManifestMerger, including pre/post processors to intercept the merge flow of AndroidManifest.xml. Developers should take responsibility to report bugs to library authors(who introduced problematic Manifest), ManifestMerger(Google), AAPT2(Google), which is the true way to solve the merge issues. Quick Start
// root project's build.gradle.kts
buildscript {
repositories {
mavenCentral()
google()
}
dependencies {
classpath("com.android.tools.build:gradle:7.1.2")
classpath("me.2bab:seal:3.2.0")
}
}
plugins {
id("com.android.application")
kotlin("android")
// Apply this plugin
id("me.2bab.seal")
}
seal {
// 0. Two cases for before merge.
beforeMerge("Remove description attr for library input Manifest.")
.tag("application")
.attr("android:description")
.deleteAttr()
beforeMerge("Remove problematic replace attr for library input Manifest.")
.tag("application")
.attr("tools:replace")
.deleteAttr()
// Full covered cases for after merge (1-5).
// 1. The target of this operation is too broad, please specify the attr and value if possible.
afterMerge("Remove all uses-feature tags.")
.tag("uses-feature")
.deleteTag()
// 2. The target of this operation is too broad, please specify the value if possible.
afterMerge("Remove all custom permission tags.")
.tag("permission")
.attr("android:protectionLevel")
.deleteTag()
// 3. This is the way we recommend to delete the tag(s).
afterMerge("Remove invalid service tag.")
.tag("service")
.attr("android:name")
.value("me.xx2bab.seal.sample.library.LegacyService")
.deleteTag()
// You should try to use "tools:remove" or "tools:replace" instead of "deleteAttr" if possible
// 4. To delete an attr and its value.
afterMerge("Remove application's allowBackup attr.")
.tag("application")
.attr("android:allowBackup")
.deleteAttr()
// You should try to use "tools:remove" or "tools:replace" instead of "deleteAttr" if possible
// 5. Also u can specify the value as part of finding params.
// afterMerge("Remove application's allowBackup attr.")
// .tag("application")
// .attr("android:allowBackup")
// .value("true")
// .deleteAttr()
} The configuration is separated by 3 parts:
Common issues:
That's because some out-of-date libraries set
There is a library which defined
Please check this link for more info.
Please check this link for more info. Compatible SpecificationPolyfill is only supported & tested on latest 2 Minor versions of Android Gradle Plugin. Since
(The project currently compiles with the latest version of AGP 7.0, and compiles and tests against the both AGP 7.0 and 7.1 on CI.) Why Seal use DOM parser APIOracle Docs: Comparing StAX to Other JAXP APIs Since we need to support "delete tag" feature, and export outputs simply, from the link above we can know DOM is easiest one to process that. Though it consumes more CPU and memory resources, luckily most of License
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论