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

Support AGP's built-in Kotlin compilation #2122

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

scott-pollom
Copy link
Contributor

Previously, the sourceSet-specific KSP configurations (e.g., kspTest) weren't being created when AGP's built-in Kotlin compilation was enabled.

This change also increases the AGP version to 8.7.0-beta01 in order to test against a version of AGP with the built-in Kotlin support.

Bug: b/362279380
Test: GradleCompilationTest

@Rule
@JvmField
val project: TemporaryTestProject = TemporaryTestProject("playground-android-multi", "playground", useKSP2)

@Test
fun testDependencyResolutionCheck() {
val gradleRunner = GradleRunner.create().withProjectDir(project.root).withGradleVersion("7.6.3")

File(project.root, "gradle.properties").appendText("\nagpVersion=7.4.1")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we keep this? We need to cover users of older Gradle and AGP versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I only changed this because the CI test was failing with the following error:

Could not determine the dependencies of task ':workload:compileDebugKotlin'.
    > Failed to install the following SDK components:
          tools Android SDK Tools

It was passing for me locally, so I wasn't sure how to troubleshoot.

This test isn't really specific to AGP 7.4.1... it will fail similarly with AGP 8.7.0 if resolving dependencies early.

FWIW, there is still AGP731IT which is a similar test using AGP 7.3.1 and the same Gradle version.

But the bottom line is that I'm happy to leave this test as-is, but I don't know how to troubleshoot the test failure :)

@scott-pollom scott-pollom force-pushed the built_in_kotlin branch 3 times, most recently from a1a7678 to 3331de1 Compare October 7, 2024 21:41
Previously, the sourceSet-specific KSP configurations (e.g., kspTest)
weren't being created when AGP's built-in Kotlin compilation was
enabled.

This change also increases the AGP version to 8.7.0 in order to test
against a version of AGP with the built-in Kotlin support.

This change also configures the AGP compatibility tests (AGP731IT and
AGP741IT) to run one test at a time to avoid race conditions seen when
the old AGP versions were trying to download SDKs simultaneously.

Bug: b/362279380
Test: GradleCompilationTest
@ting-yuan ting-yuan merged commit 6bbbed3 into google:main Oct 8, 2024
3 checks passed
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