Commit 58b3cb4
committed
Always include Gradle API stubs in GradleParser classpath
When `settingsClasspath` or `buildscriptClasspath` is explicitly set
(even to empty), `GradleParser` previously replaced the default Gradle
API stubs entirely. This caused incorrect type attribution on DSL
methods like `pluginManagement()`, `repositories()`, and
`gradlePluginPortal()`, leading recipes like
`AddSettingsPluginRepository` to fail to detect existing entries.
Introduce `mergeClasspath()` which always includes the default Gradle
API stubs alongside any externally-provided classpath. Add a
reproducer test that sets `settingsClasspath` to empty and verifies
`AddSettingsPluginRepository` correctly detects an existing
`gradlePluginPortal()`.1 parent 5b212d9 commit 58b3cb4
2 files changed
Lines changed: 60 additions & 22 deletions
File tree
- rewrite-gradle/src
- main/java/org/openrewrite/gradle
- test/java/org/openrewrite/gradle/plugins
Lines changed: 20 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
| 30 | + | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| |||
65 | 64 | | |
66 | 65 | | |
67 | 66 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | 67 | | |
73 | | - | |
| 68 | + | |
74 | 69 | | |
75 | 70 | | |
76 | 71 | | |
77 | 72 | | |
78 | 73 | | |
79 | 74 | | |
80 | 75 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | 76 | | |
86 | | - | |
| 77 | + | |
87 | 78 | | |
88 | 79 | | |
89 | 80 | | |
90 | 81 | | |
91 | 82 | | |
92 | 83 | | |
93 | 84 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | 85 | | |
99 | | - | |
| 86 | + | |
100 | 87 | | |
101 | 88 | | |
102 | 89 | | |
103 | 90 | | |
104 | 91 | | |
105 | 92 | | |
106 | 93 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | 94 | | |
112 | | - | |
| 95 | + | |
113 | 96 | | |
114 | 97 | | |
115 | 98 | | |
| |||
210 | 193 | | |
211 | 194 | | |
212 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
213 | 211 | | |
214 | 212 | | |
215 | 213 | | |
| |||
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
20 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
21 | 30 | | |
22 | 31 | | |
23 | 32 | | |
| |||
624 | 633 | | |
625 | 634 | | |
626 | 635 | | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
627 | 667 | | |
0 commit comments