You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by sd...@apache.org on 2021/04/17 05:44:49 UTC
[netbeans] branch master updated: Print dependency path for modules
excluded from platform.
This is an automated email from the ASF dual-hosted git repository.
sdedic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new 0e021bc Print dependency path for modules excluded from platform.
new e1f9b82 Merge pull request #2884 from sdedic/sdedic/failure-dependency-path
0e021bc is described below
commit 0e021bc27b9c8dec40cda94d131a99f6851d233c
Author: Svata Dedic <sv...@oracle.com>
AuthorDate: Wed Apr 14 15:24:35 2021 +0200
Print dependency path for modules excluded from platform.
---
.../org/netbeans/nbbuild/ParseProjectXml.java | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/ParseProjectXml.java b/nbbuild/antsrc/org/netbeans/nbbuild/ParseProjectXml.java
index d680d04..82f5856 100644
--- a/nbbuild/antsrc/org/netbeans/nbbuild/ParseProjectXml.java
+++ b/nbbuild/antsrc/org/netbeans/nbbuild/ParseProjectXml.java
@@ -35,6 +35,7 @@ import java.lang.reflect.Method;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
@@ -689,7 +690,7 @@ public final class ParseProjectXml extends Task {
}
private String implementationVersionOf(ModuleListParser modules, String cnb) throws BuildException {
- File jar = computeClasspathModuleLocation(modules, cnb, null, null, false);
+ File jar = computeClasspathModuleLocation(modules, cnb, null, null, false, Collections.emptyList());
try {
try (JarFile jarFile = new JarFile(jar, false)) {
return jarFile.getManifest().getMainAttributes().getValue("OpenIDE-Module-Implementation-Version");
@@ -970,12 +971,14 @@ public final class ParseProjectXml extends Task {
continue;
}
String cnb = dep.codenamebase;
- File depJar = computeClasspathModuleLocation(modules, cnb, clusterPath, excludedModules, runtime);
+ List<String> path = new ArrayList<>();
+ path.add(myCNB);
+ File depJar = computeClasspathModuleLocation(modules, cnb, clusterPath, excludedModules, runtime, path);
List<File> additions = new ArrayList<>();
additions.add(depJar);
if (recursive) {
- addRecursiveDeps(additions, modules, cnb, clusterPath, excludedModules, new HashSet<>(), runtime);
+ addRecursiveDeps(additions, modules, cnb, clusterPath, excludedModules, new HashSet<>(), runtime, path);
}
// #52354: look for <class-path-extension>s in dependent modules.
@@ -1041,7 +1044,7 @@ public final class ParseProjectXml extends Task {
}
private void addRecursiveDeps(List<File> additions, ModuleListParser modules, String cnb,
- Set<File> clusterPath, Set<String> excludedModules, Set<String> skipCnb, boolean runtime) {
+ Set<File> clusterPath, Set<String> excludedModules, Set<String> skipCnb, boolean runtime, List<String> path) {
if (!skipCnb.add(cnb)) {
return;
}
@@ -1067,19 +1070,21 @@ public final class ParseProjectXml extends Task {
additions.add(f);
}
}
+ List<String> inPath = new ArrayList<>(path);
+ inPath.add(cnb);
for (String nextModule : deps) {
log(" Added dep " + nextModule + " due to " + cnb, Project.MSG_DEBUG);
- File depJar = computeClasspathModuleLocation(modules, nextModule, clusterPath, excludedModules, true);
+ File depJar = computeClasspathModuleLocation(modules, nextModule, clusterPath, excludedModules, true, inPath);
if (!additions.contains(depJar)) {
additions.add(depJar);
}
- addRecursiveDeps(additions, modules, nextModule, clusterPath, excludedModules, skipCnb, runtime);
+ addRecursiveDeps(additions, modules, nextModule, clusterPath, excludedModules, skipCnb, runtime, inPath);
}
}
static final String DO_NOT_RECURSE = "do.not.recurse";
private File computeClasspathModuleLocation(ModuleListParser modules, String cnb,
- Set<File> clusterPath, Set<String> excludedModules, boolean runtime) throws BuildException {
+ Set<File> clusterPath, Set<String> excludedModules, boolean runtime, List<String> path) throws BuildException {
ModuleListParser.Entry module = modules.findByCodeNameBase(cnb);
if (module == null && cnb.contains("-")) {
final String alternativeCnb = cnb.replace('-', '_');
@@ -1109,7 +1114,7 @@ public final class ParseProjectXml extends Task {
throw new BuildException(msg, getLocation());
}
if (excludedModules != null && excludedModules.contains(cnb)) { // again #68716
- throw new BuildException("Module " + cnb + " excluded from the target platform", getLocation());
+ throw new BuildException("Module " + cnb + " excluded from the target platform; the path is: " + path.toString(), getLocation());
}
if (!jar.isFile()) {
File srcdir = module.getSourceLocation();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists