Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd10bf81

Browse files
authored
Merge pull request#8797 from wrprice/issue8764
Fix#8764 Gradle 9 ProjectDependency resolution to other project
2 parents332ec88 +3f28822 commitd10bf81

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

‎extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/NbProjectInfoBuilder.java‎

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
importjava.util.Optional;
5050
importjava.util.Set;
5151
importjava.util.function.Consumer;
52+
importjava.util.function.Function;
5253
importjava.util.function.Supplier;
5354
importjava.util.regex.Pattern;
5455
importjava.util.stream.Collectors;
@@ -1562,6 +1563,23 @@ private void detectDependencies(NbProjectInfoModel model) {
15621563
booleanignoreUnresolvable = (project.getPlugins().hasPlugin("java-platform") &&
15631564
Boolean.TRUE.equals(getProperty(project,"javaPlatform","allowDependencies")));
15641565

1566+
// https://github.com/apache/netbeans/issues/8764
1567+
Function<ProjectDependency,Project>projDependencyToProject =
1568+
sinceGradleOrDefault(
1569+
"9.0",
1570+
() -> {
1571+
MethodgetPath =ProjectDependency.class.getMethod("getPath");
1572+
returndep -> {
1573+
try {
1574+
Stringpath = (String)getPath.invoke(dep);
1575+
returnproject.findProject(path);
1576+
}catch (ReflectiveOperationExceptione) {
1577+
thrownewUnsupportedOperationException(e);
1578+
}
1579+
};
1580+
},
1581+
() ->ProjectDependency::getDependencyProject);// removed in Gradle 9
1582+
15651583
visibleConfigurations.forEach(it -> {
15661584
StringpropBase ="configuration_" +it.getName() +"_";
15671585
model.getInfo().put(propBase +"non_resolving", !resolvable(it));
@@ -1660,7 +1678,7 @@ private void detectDependencies(NbProjectInfoModel model) {
16601678
Stringa;
16611679
if (dinstanceofProjectDependency) {
16621680
sb.append("*project:");// NOI18N
1663-
Projectother = ((ProjectDependency)d).getDependencyProject();
1681+
Projectother =projDependencyToProject.apply((ProjectDependency)d);
16641682
g =other.getGroup().toString();
16651683
a =other.getName();
16661684
}else {
@@ -1679,7 +1697,7 @@ private void detectDependencies(NbProjectInfoModel model) {
16791697
longtime_project_deps =System.currentTimeMillis();
16801698
model.registerPerf(depPrefix +"module",time_project_deps -time_inspect_conf);
16811699
it.getDependencies().withType(ProjectDependency.class).forEach(it2 -> {
1682-
Projectprj =it2.getDependencyProject();
1700+
Projectprj =projDependencyToProject.apply(it2);
16831701
projects.put(prj.getPath(),prj.getProjectDir());
16841702
projectNames.add(prj.getPath());
16851703
});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp