Skip to content
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

Merged
merged 2 commits into from
Nov 12, 2022
Merged

AGP 7.3 compatibility support #392

merged 2 commits into from
Nov 12, 2022

Conversation

neighbWang
Copy link
Collaborator

No description provided.

@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 ->
Copy link
Collaborator

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"))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最好用 TaskProvidernamed 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.*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不必要的修改

Comment on lines 65 to 73
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()
}
Copy link
Collaborator

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) {
Copy link
Collaborator

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor version 应该是 3

Comment on lines 1 to 6
# 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 以上版本的实现。

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7.2 -> 7.3

@johnsonlee johnsonlee merged commit 41d7282 into didi:master Nov 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants