Skip to content

Build script fix for windows platform #250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
<copy file="vscode/package.json" todir="${build.dir}/bundles/package" />
<copy file="vscode/package-lock.json" todir="${build.dir}/bundles/package" />

<exec executable="mvn" failonerror="true" dir="${nb_all}/nbbuild/misc/prepare-bundles">
<exec executable="mvn${cmd.suffix}" failonerror="true" dir="${nb_all}/nbbuild/misc/prepare-bundles">
<arg value="package" />
<arg value="exec:java" />
<arg value="-Dexec.mainClass=org.netbeans.prepare.bundles.PrepareBundles" />
Expand Down
18 changes: 16 additions & 2 deletions patches/7271.diff
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
diff --git a/nbbuild/misc/prepare-bundles/src/main/java/org/netbeans/prepare/bundles/PrepareBundles.java b/nbbuild/misc/prepare-bundles/src/main/java/org/netbeans/prepare/bundles/PrepareBundles.java
index 5349a20e091a..d24c6f5ec98a 100644
index 5349a20e09..536df96b0e 100644
--- a/nbbuild/misc/prepare-bundles/src/main/java/org/netbeans/prepare/bundles/PrepareBundles.java
+++ b/nbbuild/misc/prepare-bundles/src/main/java/org/netbeans/prepare/bundles/PrepareBundles.java
@@ -107,18 +107,16 @@ public static void main(String... args) throws IOException, InterruptedException
@@ -69,7 +69,12 @@ public class PrepareBundles {

Path targetDir = Paths.get(args[0]);
Path packagesDir = targetDir.resolve("package");
- new ProcessBuilder("npm", "install").directory(packagesDir.toFile()).inheritIO().start().waitFor();
+ String os = System.getProperty("os.name").toLowerCase();
+ if (os.contains("windows")) {
+ new ProcessBuilder("npm.cmd", "install").directory(packagesDir.toFile()).inheritIO().start().waitFor();
+ } else{
+ new ProcessBuilder("npm", "install").directory(packagesDir.toFile()).inheritIO().start().waitFor();
+ }
Path bundlesDir = targetDir.resolve("bundles");
Files.createDirectories(bundlesDir);
try (DirectoryStream<Path> ds = Files.newDirectoryStream(bundlesDir)) {
@@ -107,18 +112,16 @@ public class PrepareBundles {
if ("@types".equals(module.getFileName().toString())) continue;
if ("@esbuild".equals(module.getFileName().toString())) continue;
if ("@microsoft".equals(module.getFileName().toString())) continue;
Expand Down
4 changes: 2 additions & 2 deletions vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -755,9 +755,9 @@
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./; node ./esbuild.js",
"compile": "tsc -p ./ && node ./esbuild.js",
"watch": "tsc -watch -p ./ | node ./esbuild.js --watch",
"test": "node ./out/test/runTest.js",
"test": "npm run compile && node ./out/test/runTest.js",
"nbcode": "node ./out/nbcode.js",
"nbjavac": "node ./out/nbcode.js -J-Dnetbeans.close=true --modules --install .*nbjavac.*",
"apisupport": "node ./out/nbcode.js -J-Dnetbeans.close=true --modules --install '(org.netbeans.libs.xerces|org.netbeans.modules.editor.structure|org.netbeans.modules.xml|org.netbeans.modules.xml.axi|org.netbeans.modules.xml.retriever|org.netbeans.modules.xml.schema.model|org.netbeans.modules.xml.tax|org.netbeans.modules.xml.text|org.netbeans.modules.ant.browsetask|.*apisupport.*|org.netbeans.modules.debugger.jpda.ant)' && node ./out/nbcode.js -J-Dnetbeans.close=true --modules --enable .*apisupport.ant",
Expand Down