Commit 9422d1b
authored
Test and fix example-gradle-task against latest code (#459)
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-L31 parent 6e2605f commit 9422d1b
File tree
15 files changed
+103
-33
lines changed- build-logic/src/main/kotlin/com/gabrielfeo
- examples/example-gradle-task
- build-logic
- buildSrc
- src/main/kotlin/build/logic
- gradle
- library
- src/examplesTest
- kotlin/com/gabrielfeo/develocity/api/example
- gradle
- notebook
- resources
15 files changed
+103
-33
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | 1 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
104 | 111 | | |
105 | 112 | | |
106 | 113 | | |
| |||
0 commit comments