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 2023/02/16 13:44:22 UTC

[netbeans] branch master updated: Temporary fix: Support extra cluster directories.

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 884f022f9d Temporary fix: Support extra cluster directories.
     new 5600b7c7e2 Merge pull request #5503 from sdedic/platform/extra-clusters
884f022f9d is described below

commit 884f022f9d084f626d174bdfd201bc789adb0d7b
Author: Svata Dedic <sv...@oracle.com>
AuthorDate: Mon Jan 23 13:42:26 2023 +0100

    Temporary fix: Support extra cluster directories.
---
 java/java.lsp.server/vscode/src/nbcode.ts             |  4 +---
 platform/o.n.bootstrap/src/org/netbeans/MainImpl.java | 13 +++++++++++++
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/java/java.lsp.server/vscode/src/nbcode.ts b/java/java.lsp.server/vscode/src/nbcode.ts
index 1130c67d8d..6df035717f 100644
--- a/java/java.lsp.server/vscode/src/nbcode.ts
+++ b/java/java.lsp.server/vscode/src/nbcode.ts
@@ -69,6 +69,7 @@ export function launch(
     if (info.verbose) {
         ideArgs.push('-J-Dnetbeans.logger.console=true');
     }
+    ideArgs.push(`-J-Dnetbeans.extra.dirs="${clusterPath}"`)
     if (env['netbeans.extra.options']) {
         ideArgs.push(env['netbeans.extra.options']);
     }
@@ -81,9 +82,6 @@ export function launch(
     let process: ChildProcessByStdio<any, Readable, Readable> = spawn(nbcodePath, ideArgs, {
         cwd : userDir,
         stdio : ["ignore", "pipe", "pipe"],
-        env : Object.assign({
-            'extra_clusters' : clusterPath
-        }, global.process.env)
     });
     return process;
 }
diff --git a/platform/o.n.bootstrap/src/org/netbeans/MainImpl.java b/platform/o.n.bootstrap/src/org/netbeans/MainImpl.java
index b812f970b2..2dc5ba137b 100644
--- a/platform/o.n.bootstrap/src/org/netbeans/MainImpl.java
+++ b/platform/o.n.bootstrap/src/org/netbeans/MainImpl.java
@@ -119,6 +119,19 @@ final class MainImpl extends Object {
         }
         // #34069: need to do the same for nbdirs.
         String nbdirs = System.getProperty("netbeans.dirs"); // NOI18N
+        String extNbDirs = System.getProperty("netbeans.extra.dirs"); // NOI18N
+        if (extNbDirs != null) {
+            // support for potential spaces in the cluster path:
+            if (extNbDirs.startsWith("\"")) {
+                extNbDirs = extNbDirs.substring(1, extNbDirs.lastIndexOf('"'));
+            }
+            if (nbdirs == null) {
+                nbdirs = extNbDirs;
+            } else {
+                nbdirs = nbdirs + File.pathSeparator + extNbDirs;
+            }
+            System.setProperty("netbeans.dirs", nbdirs); // NOI18N
+        }
         if (nbdirs != null) {
             StringTokenizer tok = new StringTokenizer(nbdirs, File.pathSeparator);
             while (tok.hasMoreTokens()) {


---------------------------------------------------------------------
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