Skip to content

Commit 22329f4

Browse files
authored
Add windows support (#41)
* Add windows support * Improve multi-platform support * Install with network-concurrency 1 * Use file-glob to upload windows binary * Don't install packages in parallel if on windows * Rename vscode-remote to code-server * Add output at intervals so CI doesn't kill build * Update all tasks to provide timed output * Don't perform tasks sync otherwise we can't log
1 parent 0675736 commit 22329f4

27 files changed

+769
-72
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ deploy:
2727
skip_cleanup: true
2828
api_key:
2929
secure: T/yqCIeqLifteriv8D3CnehNFzSBP309GZqeUfyx8Q+xSQEttA9Enxl+Qw9GkdedYTN4J56iucHIac6CwcvKSKIXqk80CeSEW0BNxZs5wIgv4rRMMy/GAX0NBWKNOkoGlH8M6VyQcM7eY2iGAn1EX755PHalk6rWwfsauRANOQyb2DXQBan5C0YUnogq2qcW1xkIwlXH7l0Ekbtego0f6QPv0rSyOcL1LKm6xk0Aq+xLNKJkT6TSL6xYpkPlZLjnql09Nspkqs6NehWlft2n09bHqAtjNnWw9OYCvxp8mdHeTE5uShuEqYPzdYU5LVFoE7wElI8uqS66noaA18ytZYGw2IrY6GZcn+wtR6WyM2+YXl2HclL1/Fs6Vn8+zwq2IBZchBNv3KJSn1dxiqLlD/s6YQyni17x/9FhtFoNUvsbY5zSC1xrnNQBQWFg0TRnoC9rPR+7hQtT1+5+CvRxpvcNWnPuA22919PFE79ejJulPmsnyF+YLs9c6APJgOpOO1f6fKt5Mcb02dubPqGcQ9NbqUUNTl4IUvEtjG0LnFAgEGerxAcsdnUTxzBVf0LJLlhRKW1BigUTbRwfUJL1DN0mWg9cg7fL5VqrogvNq3uRguxOsYr+bcHDbimQSAY3No3fAkTTqQSJh56Dx57/Un18KxuOTiRB9de1RtiudsI=
30-
file: packages/server/cli-$TRAVIS_OS_NAME
30+
file_glob: true
31+
file: packages/server/cli-*
3132
on:
3233
repo: codercom/vscode-online
3334
branch: master

build/tasks.ts

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const buildServerBinaryPackage = register("build:server:binary:package", async (
3333
}
3434
await buildServerBinaryCopy();
3535
await dependencyNexeBinary();
36-
const resp = await runner.execute("npm", ["run", "build:nexe"]);
36+
const resp = await runner.execute(isWin ? "npm.cmd" : "npm", ["run", "build:nexe"]);
3737
if (resp.exitCode !== 0) {
3838
throw new Error(`Failed to package binary: ${resp.stderr}`);
3939
}
@@ -133,7 +133,7 @@ const buildServerBinaryCopy = register("build:server:binary:copy", async (runner
133133
const buildServerBundle = register("build:server:bundle", async (runner) => {
134134
const cliPath = path.join(pkgsPath, "server");
135135
runner.cwd = cliPath;
136-
await runner.execute("npm", ["run", "build"]);
136+
await runner.execute(isWin ? "npm.cmd" : "npm", ["run", "build"]);
137137
});
138138

139139
const buildBootstrapFork = register("build:bootstrap-fork", async (runner) => {
@@ -142,7 +142,7 @@ const buildBootstrapFork = register("build:bootstrap-fork", async (runner) => {
142142

143143
const vscodePkgPath = path.join(pkgsPath, "vscode");
144144
runner.cwd = vscodePkgPath;
145-
await runner.execute("npm", ["run", "build:bootstrap-fork"]);
145+
await runner.execute(isWin ? "npm.cmd" : "npm", ["run", "build:bootstrap-fork"]);
146146
});
147147

148148
const buildAppBrowser = register("build:app:browser", async (runner) => {
@@ -151,7 +151,7 @@ const buildAppBrowser = register("build:app:browser", async (runner) => {
151151
const appPath = path.join(pkgsPath, "app/browser");
152152
runner.cwd = appPath;
153153
fse.removeSync(path.join(appPath, "out"));
154-
await runner.execute("npm", ["run", "build"]);
154+
await runner.execute(isWin ? "npm.cmd" : "npm", ["run", "build"]);
155155
});
156156

157157
const buildWeb = register("build:web", async (runner) => {
@@ -161,24 +161,40 @@ const buildWeb = register("build:web", async (runner) => {
161161
const webPath = path.join(pkgsPath, "web");
162162
runner.cwd = webPath;
163163
fse.removeSync(path.join(webPath, "out"));
164-
await runner.execute("npm", ["run", "build"]);
164+
await runner.execute(isWin ? "npm.cmd" : "npm", ["run", "build"]);
165165
});
166166

167167
const extDirPath = path.join("lib", "vscode-default-extensions");
168168
const copyForDefaultExtensions = register("build:copy-vscode", async (runner) => {
169169
if (!fs.existsSync(defaultExtensionsPath)) {
170170
await ensureClean();
171171
await ensureInstalled();
172-
fse.removeSync(extDirPath);
173-
fse.copySync(vscodePath, extDirPath);
172+
await new Promise((resolve, reject): void => {
173+
fse.remove(extDirPath, (err) => {
174+
if (err) {
175+
return reject(err);
176+
}
177+
178+
resolve();
179+
});
180+
});
181+
await new Promise((resolve, reject): void => {
182+
fse.copy(vscodePath, extDirPath, (err) => {
183+
if (err) {
184+
return reject(err);
185+
}
186+
187+
resolve();
188+
});
189+
});
174190
}
175191
});
176192

177193
const buildDefaultExtensions = register("build:default-extensions", async (runner) => {
178194
if (!fs.existsSync(defaultExtensionsPath)) {
179195
await copyForDefaultExtensions();
180196
runner.cwd = extDirPath;
181-
const resp = await runner.execute("npx", ["gulp", "vscode-linux-x64"]);
197+
const resp = await runner.execute(isWin ? "npx.cmd" : "npx", [isWin ? "gulp.cmd" : "gulp", "vscode-linux-x64"]);
182198
if (resp.exitCode !== 0) {
183199
throw new Error(`Failed to build default extensions: ${resp.stderr}`);
184200
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "@coder/vscode-remote",
3-
"repository": "https://github.com/codercom/vscode-remote",
2+
"name": "@coder/code-server",
3+
"repository": "https://github.com/codercom/code-server",
44
"author": "Coder",
55
"license": "MIT",
66
"description": "Run VS Code remotely.",

packages/app/browser/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "@coder/app",
33
"scripts": {
4-
"start": "../../../node_modules/.bin/webpack-dev-server --config ./webpack.config.js",
5-
"build": "../../../node_modules/.bin/webpack --config ./webpack.config.js"
4+
"start": "node ../../../node_modules/webpack-dev-server/bin/webpack-dev-server.js --config ./webpack.config.js",
5+
"build": "node ../../../node_modules/webpack/bin/webpack.js --config ./webpack.config.js"
66
},
77
"dependencies": {
88
"@material/checkbox": "^0.44.1",

packages/app/browser/src/app.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
<body>
1010
<div class="login">
1111
<div class="back">
12-
<- Back </div> <h4 class="title">AWS Cloud</h4>
12+
<- Back </div>
13+
<!-- <h4 class="title">AWS Cloud</h4> -->
1314
<h2 class="subtitle">
1415
Enter server password
1516
</h2>

packages/ide/src/fill/os.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class OS {
3434
case OperatingSystem.Mac: this._platform = "darwin"; break;
3535
default: this._platform = "linux"; break;
3636
}
37+
process.platform = this._platform;
3738
}
3839

3940
public release(): string {

0 commit comments

Comments
 (0)