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

Update dependency com.android.tools.build:gradle to v7.4.0 #5693

Merged
merged 5 commits into from Jan 15, 2023
Merged

Conversation

3flex
Copy link
Member

@3flex 3flex commented Jan 12, 2023

No description provided.

@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label Jan 12, 2023
@3flex
Copy link
Member Author

3flex commented Jan 13, 2023

Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8

Now we could possibly jump to Java 11 minimum to execute the Gradle plugin, but AGP 8.0 bumps again to Java 17 which will be too aggressive, so we should probably solve for this now and maintain compatibility with Java 8. Hopefully that's feasible because this is a compile only dependency, so we can compile with Java 11 dependencies but produce Java 8 bytecode.

This is used so detekt's Gradle plugin can still compile while targeting
JVM 8, as AGP 7 only requires JVM 8 compatibility while compiling. detekt's
Gradle plugin would have to target JVM 11 or above if compiling against
AGP 7.4.
@codecov
Copy link

codecov bot commented Jan 14, 2023

Codecov Report

Merging #5693 (605c4bd) into main (0245b0f) will increase coverage by 84.46%.
The diff coverage is n/a.

❗ Current head 605c4bd differs from pull request most recent head 3b174e7. Consider uploading reports for the commit 3b174e7 to get more accurate results

@@             Coverage Diff             @@
##             main    #5693       +/-   ##
===========================================
+ Coverage        0   84.46%   +84.46%     
- Complexity      0     3734     +3734     
===========================================
  Files           0      543      +543     
  Lines           0    12704    +12704     
  Branches        0     2222     +2222     
===========================================
+ Hits            0    10730    +10730     
- Misses          0      865      +865     
- Partials        0     1109     +1109     
Impacted Files Coverage Δ
...o/github/detekt/tooling/internal/EmptyContainer.kt 42.85% <0.00%> (ø)
...b/arturbosch/detekt/core/suppressors/Suppressor.kt 71.42% <0.00%> (ø)
...n/kotlin/io/gitlab/arturbosch/detekt/api/Entity.kt 75.00% <0.00%> (ø)
...t/metrics/processors/ProjectComplexityProcessor.kt 100.00% <0.00%> (ø)
...rturbosch/detekt/rules/style/OptionalWhenBraces.kt 94.11% <0.00%> (ø)
...sch/detekt/formatting/wrappers/ModifierOrdering.kt 100.00% <0.00%> (ø)
...osch/detekt/rules/empty/EmptyDefaultConstructor.kt 81.25% <0.00%> (ø)
...turbosch/detekt/rules/style/UseEmptyCounterpart.kt 90.47% <0.00%> (ø)
.../io/github/detekt/tooling/dsl/ConfigSpecBuilder.kt 100.00% <0.00%> (ø)
...tekt/formatting/wrappers/SpacingAroundOperators.kt 100.00% <0.00%> (ø)
... and 533 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@chao2zhang
Copy link
Member

We probably need to validate if Android projects can still apply detekt-gradle-plugin if there is internal checks inside AGP. I am referring to https://developer.android.com/studio/releases/gradle-plugin#jvm-11-bytecode

This means that if you compile against AGP, or write custom Lint checks, you need to start targeting JVM 11 bytecode

@BraisGabin
Copy link
Member

I don't get how this work. You are not adding the agp to the jdk8 run. Shouldn't those tests fail with class not found or something similar?

@3flex
Copy link
Member Author

3flex commented Jan 15, 2023

This means that if you compile against AGP, or write custom Lint checks, you need to start targeting JVM 11 bytecode

We shouldn't have any problems here, since we're still compiling against AGP 7.0 which doesn't have that limitation, and we're not writing custom lint checks.

@3flex
Copy link
Member Author

3flex commented Jan 15, 2023

Shouldn't those tests fail with class not found or something similar?

Android tests are already skipped if JVM is lower than 11.

@EnabledForJreRange(min = JRE.JAVA_11, disabledReason = "Android Gradle Plugin 7.0+ requires JDK 11 or newer")
@EnabledIf("io.gitlab.arturbosch.detekt.DetektAndroidSpecKt#isAndroidSdkInstalled")
class DetektAndroidSpec {

Copy link
Member

@BraisGabin BraisGabin left a comment

Choose a reason for hiding this comment

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

I really like this addition to compile against min versión but tests against last know version :)

Comment on lines +25 to +31
# This represents the the oldest AGP version that is supported by detekt.
# This should only be updated when updating the minimum version supported by detekt's Gradle plugin.
android-gradle-minSupported = "com.android.tools.build:gradle:7.0.0"

# This version of AGP is used for testing and should be updated when new AGP versions are released to ensure detekt's
# Gradle plugin remains compatible.
android-gradle-maxSupported = "com.android.tools.build:gradle:7.4.0"
Copy link
Member

Choose a reason for hiding this comment

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

<3

Copy link
Member

Choose a reason for hiding this comment

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

❤️

@chao2zhang chao2zhang merged commit cbe24ef into main Jan 15, 2023
@chao2zhang chao2zhang deleted the agp-7.4.0 branch January 15, 2023 18:00
@cortinico cortinico added this to the 1.23.0 milestone Jan 25, 2023
@cortinico cortinico added the notable changes Marker for notable changes in the changelog label Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build 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