Skip to content

Commit

Permalink
Remove some AGP 3.1 and 3.2 related hacks.
Browse files Browse the repository at this point in the history
  • Loading branch information
TWiStErRob committed Jan 24, 2023
1 parent 61170d1 commit 464d7b5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ private val LintBaseTask.isFatalOnly
* Due to Kotlin limitations, cannot polyfill `variantName` (extension methods are compile time bound),
* so introducing a separate property is a good compromise.
* This only calls [LintPerVariantTask.variantName] when it actually exists.
* 3.1.4, 3.2.1:
* * [AndroidVariantTask.variantName] : [DefaultTask]
* * [LintPerVariantTask] : [LintBaseTask]
* * [LintGlobalTask] : [LintBaseTask]
* * [LintFixTask] (new in 3.2.0) : [LintBaseTask]
* * [LintBaseTask] : `com.android.build.gradle.internal.tasks.AndroidBuilderTask`
* * `AndroidBuilderTask` : [AndroidVariantTask]
* 3.3.3, 3.6.4, 4.0.0, 4.1.0:
* * [AndroidVariantTask] : [DefaultTask], [VariantAwareTask.variantName]
* * [LintPerVariantTask] : [LintBaseTask], [VariantAwareTask.variantName]
Expand All @@ -55,11 +48,6 @@ val LintBaseTask.androidVariantName: String?
// because before 4.2.0 LintGlobalTask/LintFixTask didn't implement the interface.
// Force compile time binding to the interface, because a super of LintBaseTask may override the property.
(this as VariantAwareTask).variantName
@Suppress("KotlinConstantConditions")
(AGPVersions.CLASSPATH < AGPVersions.v33x && @Suppress("USELESS_IS_CHECK") (this is AndroidVariantTask)) ->
// USELESS_IS_CHECK: Historical binding to inherited property.
@Suppress("CAST_NEVER_SUCCEEDS")
(this as AndroidVariantTask).variantName
this is LintGlobalTask -> null
AGPVersions.v32x < AGPVersions.CLASSPATH && this is LintFixTask -> null
else -> null
Expand Down
2 changes: 0 additions & 2 deletions gradle/agp.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
[libraries]
android-gradle-v31x = { module = "com.android.tools.build:gradle", version = "3.1.4" }
android-gradle-v32x = { module = "com.android.tools.build:gradle", version = "3.2.1" }
android-gradle-v33x = { module = "com.android.tools.build:gradle", version = "3.3.3" }
android-gradle-v34x = { module = "com.android.tools.build:gradle", version = "3.4.3" }
android-gradle-v35x = { module = "com.android.tools.build:gradle", version = "3.5.4" }
Expand Down

0 comments on commit 464d7b5

Please sign in to comment.