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

Fix Gradle 8.1 Compatibility #26

Merged
merged 11 commits into from
Apr 15, 2023

Conversation

mateuszkwiecinski
Copy link
Contributor

After upgrading to Gradle 8.1 the build fails with

> Could not create task ':easylauncher:generateJacocoTestKitProperties'.
   > 'org.gradle.api.file.RegularFileProperty pl.droidsonroids.gradle.jacoco.testkit.GenerateJaCoCoTestKitProperties.getDestinationFile()'

This is an attempt to fix it. I'm not 100% sure it will work in all supported cases, I haven't fully understood the test setup, so you may take these changes with a grain of salt (especially the ones around publishing).
I tested locally and they seem to work 👀

id 'jacoco'
id 'java-gradle-plugin'
id 'pl.droidsonroids.jacoco.testkit' version '1.0.8'
// id 'pl.droidsonroids.jacoco.testkit' version '1.0.8'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can be uncommented after the release

@@ -16,7 +16,7 @@ class JaCoCoTestKitPluginFunctionalTest {

@Before
fun setUp() {
temporaryFolder.newFile("gradle.properties").fillFromResource("testkit-gradle.properties")
temporaryFolder.newFile("gradle.properties")
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 think I now know what this was, it's the "intergration" with jacoco! The file is not generated because I uncommented the plugin in build.gradle

Comment on lines -19 to -20
it.outputFile = File(buildDir, "testkit/${taskProvider.name}/testkit-gradle.properties")
it.destinationFile.set(
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 haven't understood what's the difference between destination and output file, since they point at the same location. I followed my intuition and the JacocoTaskExtension's destinationFile is now used only as org.gradle.jvmargs property value

@mateuszkwiecinski mateuszkwiecinski marked this pull request as ready for review April 15, 2023 07:28
@koral-- koral-- merged commit f4e8d4b into koral--:master Apr 15, 2023
@mateuszkwiecinski mateuszkwiecinski deleted the fix_gradle_8_1_compatibility branch April 16, 2023 06:02
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