-
Notifications
You must be signed in to change notification settings - Fork 581
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
AGP 7.3 compatibility support #392
Conversation
@Suppress("DEPRECATION") | ||
val deredundancy = variant.project.tasks.register("remove${variant.name.capitalize()}RedundantResources", klassRemoveRedundantImages.java) { task -> | ||
val deredundancy = variant.project.tasks.register("remove${variant.name.capitalize()}RedundantResources", RemoveRedundantImages::class.java) { task -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么要改这里?
@@ -28,9 +26,10 @@ class ResourceDeredundancyVariantProcessor : VariantProcessor { | |||
override fun process(variant: BaseVariant) { | |||
val project = variant.project | |||
val results = CompressionResults() | |||
val klassRemoveRedundantImages = if (project.isAapt2Enabled) RemoveRedundantFlatImages::class else RemoveRedundantImages::class | |||
val mapSourceSetPaths = project.tasks.findByName(variant.getTaskName("map", "SourceSetPaths")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
最好用 TaskProvider
的 named
API
import com.didiglobal.booster.gradle.getTaskName | ||
import com.didiglobal.booster.gradle.isAapt2Enabled | ||
import com.didiglobal.booster.gradle.mergeResourcesTaskProvider | ||
import com.didiglobal.booster.gradle.project | ||
import com.didiglobal.booster.gradle.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不必要的修改
private fun BaseVariant.cachedMap(): Map<String, String> { | ||
return this.allArtifacts["SOURCE_SET_PATH_MAP"] | ||
?.flatMap(File::readLines) | ||
?.map { | ||
it.split(" ") | ||
}?.associate { | ||
it[0] to it[1] | ||
} ?: emptyMap() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这段代码有用吗?
) | ||
|
||
@Suppress("RemoveCurlyBracesFromTemplate", "FunctionName") | ||
abstract class V72IntegrationTest(private val isLib: Boolean) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
名字还是 V72
?
projectDir.copyFromResource("src") | ||
projectDir.newFile("gradle.properties").writeText("org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=2g") | ||
assertEquals(7, AGP.revision.major) | ||
assertEquals(2, AGP.revision.minor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor version 应该是 3
# booster-android-gradle-v7_2 | ||
|
||
This module is an implementation of [booster-android-gradle-api](../booster-android-gradle-api) for Android gradle plugin above 7.2 | ||
|
||
本模块是 [booster-android-gradle-api](../booster-android-gradle-api) 针对 Android gradle plugin 7.2 以上版本的实现。 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7.2 -> 7.3
No description provided.