-
Notifications
You must be signed in to change notification settings - Fork 0
Add example of library usage in a Gradle build #452
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
See #451. Was reproducible with ``` ./gradlew --stop; for i in 1 2; ./g radlew -p examples/example-build-logic/ buildPerformanceMetrics --stacktrace; end ```
gabrielfeo
added a commit
that referenced
this pull request
Aug 24, 2025
Updates the test case that verifies running the example Kotlin **plugin project** (a Gradle task which uses the API, added in #452) against the current library code, i.e. a SNAPSHOT artifact compiled just before the tests and published to Maven local. To fix #404, language version had been downgraded to 1.8. To fully restore compatibility of the latest code, which has since been updated to use Kotlin plugin 2.2.x (with 1.8 language version, but 2.2.x stdlib), stdlib and okhttp are downgraded. This restores compatibility with Gradle 8.11 <= v < 9.0.0. This [build scan][1] demonstrates the compiler version (not language version) incompatibility that is now fixed: ``` e: file:///Users/gfeo/.gradle/caches/modules-2/files-2.1/com.squareup.okhttp3/okhttp-jvm/5.1.0/c17340f19b33c1d28a47b8dc4ae15018aff6dc10/okhttp-jvm-5.1.0.jar!/META-INF/okhttp.kotlin_module Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.2.0, expected version is 2.0.0. e: file:///Users/gfeo/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/2.2.10/30de6faa127a4a012db8e71bf1b9c0a99b1402b2/kotlin-stdlib-2.2.10.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.2.0, expected version is 2.0.0. e: file:///Users/gfeo/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/2.2.10/30de6faa127a4a012db8e71bf1b9c0a99b1402b2/kotlin-stdlib-2.2.10.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.2.0, expected version is 2.0.0. e: file:///Users/gfeo/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/2.2.10/30de6faa127a4a012db8e71bf1b9c0a99b1402b2/kotlin-stdlib-2.2.10.jar!/META-INF/kotlin-stdlib.kotlin_module Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.2.0, expected version is 2.0.0. ``` Prevents regressions like #404. Follow-up to #432, #456 and #458 for example-gradle-task. ExampleProjectTest is also refactored to use the init script introduced here. A smoke test verifying that the example is properly forced to use the published `SNAPSHOT` is added to both tests. `buildSrc` is used in `example-gradle-task` because `pluginManagement.repositories.exclusiveContent` set via init script rules don't seem to apply to build dependencies resolved from included builds. [1]: https://scans.gradle.com/s/hxgfny2ssyugo/tests/task/:library:examplesTest/details/com.gabrielfeo.develocity.api.example.gradle.ExampleGradleTaskTest/smokeTest()?focused-execution=1&top-execution=1#L0-L3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a tested example to support the use case of a Gradle build. Related to #404 aiming to prevent regressions around this use case.