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

Missing sourceSets for Kotlin in Project Descriptor #43329

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

cdsap
Copy link
Contributor

@cdsap cdsap commented Sep 17, 2024

SourceSets for the Kotlin tasks were not included in the ProjectDescriptorBuilder (my mistake).

This PR adds a new integrating test to verify that the Kotlin classes have been included in the jar.

Additional tests:
Comparing 3.13.1 vs 314.3, diff in the Kotlin classes:
Screenshot 2024-09-16 at 8 04 45 PM

Comparing 3.13.1 vs This PR, no diff in the Kotlin classes:
Screenshot 2024-09-16 at 8 05 29 PM

@quarkus-bot quarkus-bot bot added area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/gradle Gradle labels Sep 17, 2024

import org.junit.jupiter.api.Test;

public class KotlinIsIncludedInQuarkusJarTest extends QuarkusGradleWrapperTestBase {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

in my fork, I created another branch to validate the purpose of this test by removing the included changes in ProjectDescriptorBuilder, the result is:

2024-09-17T02:32:37.0846761Z org.opentest4j.AssertionFailedError: Expected entry basic-kotlin-application-project/src/main/kotlin/org/acme/MyMainClass.class not found in JAR file. ==> expected: <true> but was: <false>
2024-09-17T02:32:37.0849523Z 	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
2024-09-17T02:32:37.0851336Z 	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
2024-09-17T02:32:37.0853003Z 	at org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63)
2024-09-17T02:32:37.0854351Z 	at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36)
2024-09-17T02:32:37.0855760Z 	at org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:214)
2024-09-17T02:32:37.0857660Z 	at io.quarkus.gradle.KotlinIsIncludedInQuarkusJarTest.assertJarContainsEntry(KotlinIsIncludedInQuarkusJarTest.java:45)
2024-09-17T02:32:37.0860012Z 	at io.quarkus.gradle.KotlinIsIncludedInQuarkusJarTest.testFastJarFormatWorks(KotlinIsIncludedInQuarkusJarTest.java:28)
2024-09-17T02:32:37.0861883Z 	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
2024-09-17T02:32:37.0863187Z 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
2024-09-17T02:32:37.0864658Z 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
2024-09-17T02:32:37.0866574Z 

Log file

@geoand geoand requested a review from aloubyansky September 17, 2024 05:23
Copy link

quarkus-bot bot commented Sep 17, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit a61b9e8.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@geoand
Copy link
Contributor

geoand commented Sep 17, 2024

Thanks a lot for this!

Slightly unrelated, what tool are you using to compare the jars from which you have captured the screenshots? Never mind, I saw that IntelliJ does this with Ctrl + D - I learned something new today!

@mschorsch
Copy link
Contributor

This could also fix #43264.

Copy link
Member

@aloubyansky aloubyansky left a comment

Choose a reason for hiding this comment

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

Thanks a lot @cdsap !

@aloubyansky aloubyansky merged commit 2a72e8b into quarkusio:main Sep 17, 2024
21 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.16 - main milestone Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/gradle Gradle kind/bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gradle - kotlin classes missing from the jar
4 participants