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

Remove Gradle 4.x support (implies AGP 3.1 and 3.2 support removed) #377

Merged
merged 6 commits into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 0 additions & 51 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -365,36 +365,6 @@ jobs:
# Potential to run specific test tasks, e.g. :plugin can be run separately.
#test-task: []
include:
# Disabled, fails too many tests, see https://github.com/TWiStErRob/net.twisterrob.gradle/issues/111.
#- name: "AGP 3.0.x on Gradle 4.1+"
# gradle: 4.2.1
# agp: 3.0.1
# build-tools: 26.0.3
# instant-api: 26
- name: "AGP 3.1.x on Gradle 4.4+"
gradle: 4.9
gradle-java: 8
agp: 3.1.4
build-tools: 27.0.3
instant-api: 26
kotlin: 1.4.32
test-task: testReport :quality:tests
- name: "AGP 3.2.x on Gradle 4.6+"
gradle: 4.9
gradle-java: 8
agp: 3.2.1
build-tools: 28.0.3
instant-api: 27
kotlin: 1.4.32
test-task: testReport :quality:tests
- name: "AGP 3.3.x on Gradle 4.10.1+"
gradle: 4.10.3
gradle-java: 8
agp: 3.3.3
build-tools: 28.0.3
instant-api: 27
kotlin: 1.4.32
test-task: testReport :quality:tests
- name: "AGP 3.3.x on Gradle 5.x"
gradle: 5.4.1
gradle-java: 8
Expand Down Expand Up @@ -733,27 +703,6 @@ jobs:
# path: artifacts
# The `if: success() || failure()` is there to publish as much as possible even if some artifacts are missing.

- name: Download 'AGP 3.1.x on Gradle 4.4+ (3.1.4 on 4.9) Test Results XMLs' artifact.
if: success() || failure()
uses: actions/download-artifact@v3
with:
name: AGP 3.1.x on Gradle 4.4+ (3.1.4 on 4.9) Test Results XMLs
path: artifacts/AGP 3.1.x on Gradle 4.4+ (3.1.4 on 4.9) Test Results XMLs

- name: Download 'AGP 3.2.x on Gradle 4.6+ (3.2.1 on 4.9) Test Results XMLs' artifact.
if: success() || failure()
uses: actions/download-artifact@v3
with:
name: AGP 3.2.x on Gradle 4.6+ (3.2.1 on 4.9) Test Results XMLs
path: artifacts/AGP 3.2.x on Gradle 4.6+ (3.2.1 on 4.9) Test Results XMLs

- name: Download 'AGP 3.3.x on Gradle 4.10.1+ (3.3.3 on 4.10.3) Test Results XMLs' artifact.
if: success() || failure()
uses: actions/download-artifact@v3
with:
name: AGP 3.3.x on Gradle 4.10.1+ (3.3.3 on 4.10.3) Test Results XMLs
path: artifacts/AGP 3.3.x on Gradle 4.10.1+ (3.3.3 on 4.10.3) Test Results XMLs

- name: Download 'AGP 3.3.x on Gradle 5.x (3.3.3 on 5.4.1) Test Results XMLs' artifact.
if: success() || failure()
uses: actions/download-artifact@v3
Expand Down
46 changes: 25 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,37 @@ For details on what was changed in different versions, see [CHANGELOG](CHANGELOG

## Compatibility

Android Gradle Plugin 3.1.4 — 7.4.x on Gradle 4.9 — 7.5.x as listed in [AGP's compatibility guide](https://developer.android.com/studio/releases/gradle-plugin#updating-gradle).

| AGP →<br/>Gradle ↓ | 3.1.x | 3.2.x | 3.3.x | 3.4.x | 3.5.x | 3.6.x | 4.0.x | 4.1.x | 4.2.x | 7.0.x | 7.1.x | 7.2.x | 7.3.0-b1 | 7.4.0-a9 |
|:-------------------|:---------:|:-------:|:-------:|:-------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|
| 4.4 - 4.8.1 | 0.5 - 0.7 | ^1 | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 4.9 - 4.10 | 0.8 - ∞ | 0.7 - ∞ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 4.10.1 - 5.1 | ❓ | 0.8 - ∞ | 0.8 - ∞ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 5.1.1 - 5.4 | ❓ | ❓ | 0.9 - ∞ | 0.9 - ∞ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 5.4.1 - 5.6.3 | ❓ | ❓ | ❓ | 0.9 - ∞ | sup. | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 5.6.4 | ❓ | ❓ | ❓ | ❓ | 0.10 - ∞ | 0.10 - ∞ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 6.0 - 6.1 | ❓ | ❓ | ❓ | ❓ | 0.11 - ∞ | 0.11 - ∞ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 6.1.1 - 6.4.1 | ❓ | ❓ | ❓ | ❓ | 0.11 - ∞ | 0.11 - ∞ | 0.11 - ∞ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 6.5 - 6.7 | ❓ | ❓ | ❓ | ❓ | 0.11 - ∞ | 0.11 - ∞ | 0.11 - ∞ | 0.11 - ∞ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 6.7.1 - 6.9.2 | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | 0.11 - ∞ | 0.11 - ∞ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 7.0 - 7.1.2 | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | 0.13 - ∞ | 0.13 - ∞ | ❌ | ❌ | ❌ | ❌ |
| 7.2 | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | 0.13 - ∞ | 0.13 - ∞ | 0.14 - ∞ | ❌ | ❌ | ❌ |
| 7.3 - 7.3.3 | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | 0.13 - ∞ | 0.13 - ∞ | 0.14 - ∞ | 0.14 - ∞ | ❌ | ❌ |
| 7.4 - 7.4.2 | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | 0.14 - ∞ | 0.14 - ∞ | 0.14 - ∞ | 0.14 - ∞ | 0.15 - ∞ | ❌ |
| 7.5 - 7.5.1 | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | 0.14 - ∞ | 0.14 - ∞ | 0.14 - ∞ | 0.14 - ∞ | 0.15 - ∞ | 0.15 - ∞ |
Android Gradle Plugin 3.1.4 — 7.4.x on Gradle 4.9 — 7.5.x
as listed in [AGP's compatibility guide](https://developer.android.com/studio/releases/gradle-plugin#updating-gradle)
are covered by different plugin versions.

Currently supported version are Android Gradle Plugin 3.3.3 — 7.4.x on Gradle 5.4.1 — 7.6.x where compatible.

| AGP →<br/>Gradle ↓ | 3.1.x | 3.2.x | 3.3.x | 3.4.x | 3.5.x | 3.6.x | 4.0.x | 4.1.x | 4.2.x | 7.0.x | 7.1.x | 7.2.x | 7.3.0-b1 | 7.4.0-a9 |
|:-------------------|:----------:|:----------:|:----------:|:-------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|
| 4.4 - 4.8.1 | 0.5 - 0.7 | ^1 | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 4.9 - 4.10 | 0.8 - 0.14 | 0.7 - 0.14 | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 4.10.1 - 5.1 | ❓ | 0.8 - 0.14 | 0.8 - 0.14 | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 5.1.1 - 5.4 | ❓ | ❓ | 0.9 - 0.14 | 0.9 - ∞ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 5.4.1 - 5.6.3 | ❓ | ❓ | 0.9 - ∞ | 0.9 - ∞ | sup. | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 5.6.4 | ❓ | ❓ | ❓ | ❓ | 0.10 - ∞ | 0.10 - ∞ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 6.0 - 6.1 | ❓ | ❓ | ❓ | ❓ | 0.11 - ∞ | 0.11 - ∞ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 6.1.1 - 6.4.1 | ❓ | ❓ | ❓ | ❓ | 0.11 - ∞ | 0.11 - ∞ | 0.11 - ∞ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 6.5 - 6.7 | ❓ | ❓ | ❓ | ❓ | 0.11 - ∞ | 0.11 - ∞ | 0.11 - ∞ | 0.11 - ∞ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 6.7.1 - 6.9.2 | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | 0.11 - ∞ | 0.11 - ∞ | ❌ | ❌ | ❌ | ❌ | ❌ |
| 7.0 - 7.1.2 | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | 0.13 - ∞ | 0.13 - ∞ | ❌ | ❌ | ❌ | ❌ |
| 7.2 | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | 0.13 - ∞ | 0.13 - ∞ | 0.14 - ∞ | ❌ | ❌ | ❌ |
| 7.3 - 7.3.3 | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | 0.13 - ∞ | 0.13 - ∞ | 0.14 - ∞ | 0.14 - ∞ | ❌ | ❌ |
| 7.4 - 7.4.2 | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | 0.14 - ∞ | 0.14 - ∞ | 0.14 - ∞ | 0.14 - ∞ | 0.15 - ∞ | ❌ |
| 7.5 - 7.5.1 | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | ❓ | 0.14 - ∞ | 0.14 - ∞ | 0.14 - ∞ | 0.14 - ∞ | 0.15 - ∞ | 0.15 - ∞ |

* ❓ = not sure if it's supported by AGP, never tested.
* ❌ = incompatible based on AGP compatibility.
* sup. = supported based on AGP compatibility, but not tested.
* N/A = full support not available yet, only preliminary support based on alpha/beta builds of AGP.
* ∞ = latest version
* ^1 = Gradle 4.4 — 4.9 is not supported, because it's hard to backport the lazy task configuration APIs.
* ^2 = Convention plugins only support Android Gradle Plugin 4.0.0 — 4.2.2 on Gradle 6.1.1+, because it's really hard to backport all the features to 3.x with no need for this.
* ^1 = Gradle 4.4 — 4.9 for AGP 3.2 was never supported, because it's hard to backport the lazy task configuration APIs.
* ^2 = Convention plugins only support AGP 4.0.0 — 4.2.2 on Gradle 6.1.1+, because it's really hard to backport all the features to 3.x with no need for this.

## Quick setup
There are different ways to use a Gradle plugin, choose your poison below.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ class TaskCreationConfigurationTest {
verifyNoMoreInteractions(mockConfiguration)
}

internal open class TestTask : DefaultTask()
@Suppress("UnnecessaryAbstractClass") // Gradle convention.
internal abstract class TestTask : DefaultTask()
}

private fun Project.collectCreatedTasks(): Map<String, Task> {
Expand Down
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

This file was deleted.

10 changes: 0 additions & 10 deletions docs/debug/agp333-gradle4103/build.gradle

This file was deleted.

8 changes: 0 additions & 8 deletions docs/debug/agp333-gradle4103/buildSrc/build.gradle

This file was deleted.

Empty file.
Binary file not shown.

This file was deleted.

172 changes: 0 additions & 172 deletions docs/debug/agp333-gradle4103/gradlew

This file was deleted.

Loading