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

Upgrade AGP to 7 #4133

Merged
merged 5 commits into from Jan 15, 2022
Merged

Upgrade AGP to 7 #4133

merged 5 commits into from Jan 15, 2022

Conversation

chao2zhang
Copy link
Member

@chao2zhang chao2zhang commented Sep 28, 2021

Used https://github.com/cortinico/kotlin-android-template for local testing. It appears to work fine.

EDIT: Now that AGP 7 drops support for Java 8, at some point I think we also need to move towards Java 11.

@codecov
Copy link

codecov bot commented Sep 28, 2021

Codecov Report

Merging #4133 (0543130) into main (d111fe4) will decrease coverage by 0.20%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #4133      +/-   ##
============================================
- Coverage     84.28%   84.08%   -0.21%     
- Complexity     3282     3305      +23     
============================================
  Files           474      473       -1     
  Lines         10429    10787     +358     
  Branches       1861     1992     +131     
============================================
+ Hits           8790     9070     +280     
- Misses          670      688      +18     
- Partials        969     1029      +60     
Impacted Files Coverage Δ
...lab/arturbosch/detekt/rules/style/VarCouldBeVal.kt 84.37% <0.00%> (-5.21%) ⬇️
...b/arturbosch/detekt/core/tooling/AnalysisFacade.kt 62.85% <0.00%> (-3.81%) ⬇️
...h/detekt/rules/style/MultilineLambdaItParameter.kt 88.88% <0.00%> (-3.71%) ⬇️
...osch/detekt/core/baseline/BaselineResultMapping.kt 78.57% <0.00%> (-2.68%) ⬇️
.../arturbosch/detekt/rules/style/CanBeNonNullable.kt 71.60% <0.00%> (-1.54%) ⬇️
...osch/detekt/rules/bugs/UselessPostfixExpression.kt 71.73% <0.00%> (-0.99%) ⬇️
...urbosch/detekt/rules/performance/ArrayPrimitive.kt 74.19% <0.00%> (-0.81%) ⬇️
...sch/detekt/rules/style/UnnecessaryAbstractClass.kt 86.66% <0.00%> (-0.29%) ⬇️
...etekt/generator/printer/defaultconfig/Exclusion.kt 96.66% <0.00%> (-0.11%) ⬇️
...gitlab/arturbosch/detekt/core/tooling/Lifecycle.kt 100.00% <0.00%> (ø)
... and 37 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d111fe4...0543130. Read the comment docs.

@chao2zhang chao2zhang marked this pull request as draft September 28, 2021 05:54
@cortinico cortinico added dependencies Pull requests that update a dependency file notable changes Marker for notable changes in the changelog labels Sep 30, 2021
@cortinico cortinico added this to the 1.19.0 milestone Sep 30, 2021
@chao2zhang chao2zhang removed this from the 1.19.0 milestone Oct 3, 2021
@chao2zhang
Copy link
Member Author

This PR is pending on the outcome of #4130

@chao2zhang chao2zhang changed the title Upgrade AGP to 7.0.2 Upgrade AGP to 7 Dec 28, 2021
@3flex
Copy link
Member

3flex commented Jan 8, 2022

To unblock this can we not just restrict the tests to running on JDK 11? We already limit which JDKs can be used to run the Android tests by blocking JDK 16+ due to GSON incompatibility (used by AGP - I haven't tested if that imcompatibility is fixed in AGP 7):

internal fun skipIfAndroidEnvironmentRequirementsUnmet() = when {
    !isAndroidSdkInstalled() -> Skip.Yes("No android SDK.")
    getJdkVersion() >= 16 -> Skip.Yes("Android 4.1.3 & 4.2.1 don't run on JDK 16 or higher")
    else -> Skip.No
}

@chao2zhang
Copy link
Member Author

I agree with you, contingent on the assumption that users are building at least JDK 11 for Android Projects. Maybe we should announce that we can guarantee compatibility with the latest AGP release?

@cortinico
Copy link
Member

Maybe we should announce that we can guarantee compatibility with the latest AGP release?

It's essentially already described on this page:
https://detekt.github.io/detekt/compatibility.html

Once we bump AGP to 7.x, we're implicitly dropping support for AGP 4.x
That means that is safe to assume that, if you're using Detekt 1.20.x (or whichever version this PR will land into), you're on AGP 7.x and JDK 11.
If you're not, you're on your own essentially ¯_(ツ)_/¯

@BraisGabin
Copy link
Member

6 months since agp 7.0 was launched. I'm ok dropping support for agp 4.

@3flex 3flex marked this pull request as ready for review January 15, 2022 02:47
@3flex 3flex removed the blocked label Jan 15, 2022
Copy link
Member Author

@chao2zhang chao2zhang left a comment

Choose a reason for hiding this comment

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

👍

@3flex 3flex added this to the 1.20.0 milestone Jan 15, 2022
@3flex 3flex merged commit 08eac68 into detekt:main Jan 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file notable changes Marker for notable changes in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants