summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGeorge Fraser <george@fivetran.com>2018-12-28 19:52:31 -0800
committerGeorge Fraser <george@fivetran.com>2018-12-28 19:52:31 -0800
commit064aa8a19eae058384ba7d9c2c8d2e4bfde3ed18 (patch)
tree6df41f6f9452a4c6578663e80f2463ab51d4059d /lib
parent9a02922e98d84bb1ea0b19ff8d2259b5cb7b0e9c (diff)
downloadjava-language-server-064aa8a19eae058384ba7d9c2c8d2e4bfde3ed18.zip
Build for windows
Diffstat (limited to 'lib')
-rw-r--r--lib/extension.ts16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/extension.ts b/lib/extension.ts
index dddda06..cf6ff19 100644
--- a/lib/extension.ts
+++ b/lib/extension.ts
@@ -31,7 +31,9 @@ export function activate(context: ExtensionContext) {
revealOutputChannelOn: 4 // never
}
- let launcher = Path.resolve(context.extensionPath, "dist", "bin", "javacs");
+ let launcherRelativePath = platformSpecificLauncher();
+ let launcherPath = [context.extensionPath].concat(launcherRelativePath);
+ let launcher = Path.resolve(...launcherPath);
console.log(launcher);
@@ -199,4 +201,16 @@ function createProgressListeners(client: LanguageClient) {
client.onNotification(new NotificationType('java/endProgress'), () => {
progressListener.endProgress();
});
+}
+
+function platformSpecificLauncher(): string[] {
+ switch (process.platform) {
+ case 'win32':
+ return ['dist', 'windows', 'bin', 'launcher'];
+
+ case 'darwin':
+ return ['dist', 'mac', 'bin', 'launcher'];
+ }
+
+ throw `unsupported platform: ${process.platform}`;
} \ No newline at end of file