Skip to content

Commit cfd6a86

Browse files
Merge pull request #440 from OmniSharp/master
Merge master to release
2 parents ce74d98 + b2e63f2 commit cfd6a86

File tree

15 files changed

+720
-494
lines changed

15 files changed

+720
-494
lines changed

.vscodeignore

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,9 @@ src/**
55
**/*.map
66

77
.vscode/**
8-
.omnisharp/**
98

109
**/.nyc_output/**
1110
**/coverage/**
1211

13-
coreclr-debug/debugAdapters/**
14-
coreclr-debug/bin/**
15-
coreclr-debug/obj/**
16-
coreclr-debug/project.lock.json
17-
coreclr-debug/install.log
1812
+RuntimeLicenses/dependencies/*
13+
coreclr-debug/install.log

gulpfile.js

Lines changed: 128 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,142 @@
55

66
'use strict';
77

8+
const fs = require('fs');
9+
const path = require('path');
810
const del = require('del');
911
const gulp = require('gulp');
12+
const gulpUtil = require('gulp-util');
1013
const tslint = require('gulp-tslint');
1114
const vsce = require('vsce');
12-
//const omnisharpDownload = require('./out/omnisharpDownload');
15+
const debugUtil = require('./out/coreclr-debug/util.js');
16+
const debugInstall = require('./out/coreclr-debug/install.js');
17+
const fs_extra = require('fs-extra-promise');
18+
const omnisharpDownload = require('./out/omnisharpDownload');
19+
const child_process = require('child_process');
20+
21+
const OmniSharpVersion = omnisharpDownload.OmniSharpVersion;
22+
23+
/// used in offline packaging run so does not clean .vsix
24+
function clean() {
25+
cleanDebugger();
26+
return cleanOmnisharp();
27+
}
28+
29+
gulp.task('clean', ['omnisharp:clean', 'debugger:clean', 'package:clean'], () => {
30+
31+
});
32+
33+
/// Omnisharp Tasks
34+
function installOmnisharp(omnisharpAssetName) {
35+
const logFunction = (message) => { console.log(message); };
36+
return omnisharpDownload.downloadOmnisharp(logFunction, omnisharpAssetName);
37+
}
38+
39+
function cleanOmnisharp() {
40+
return del('.omnisharp');
41+
}
1342

1443
gulp.task('omnisharp:clean', () => {
15-
return del('.omnisharp');
44+
return cleanOmnisharp();
45+
});
46+
47+
gulp.task('omnisharp:install', ['omnisharp:clean'], () => {
48+
var asset = gulpUtil.env.asset || omnisharpDownload.getOmnisharpAssetName();
49+
return installOmnisharp(asset);
50+
});
51+
52+
/// Debugger Tasks
53+
function getDebugInstaller() {
54+
return new debugInstall.DebugInstaller(new debugUtil.CoreClrDebugUtil(path.resolve('.')), true);
55+
}
56+
57+
function installDebugger(runtimeId) {
58+
return getDebugInstaller().install(runtimeId);
59+
}
60+
61+
function cleanDebugger() {
62+
try {
63+
getDebugInstaller().clean();
64+
console.log('Cleaned Succesfully');
65+
} catch (error) {
66+
console.error(error);
67+
}
68+
}
69+
70+
gulp.task('debugger:install', ['debugger:clean'], () => {
71+
installDebugger(gulp.env.runtimeId).then(() => {
72+
console.log('Installed Succesfully');
73+
}).catch((error) => {
74+
console.error(error);
75+
});
76+
});
77+
78+
gulp.task('debugger:clean', () => {
79+
cleanDebugger();
80+
});
81+
82+
/// Packaging Tasks
83+
function doPackageSync(packageName) {
84+
85+
var vsceArgs = [];
86+
vsceArgs.push(path.join(__dirname, 'node_modules', 'vsce', 'out', 'vsce'))
87+
vsceArgs.push('package'); // package command
88+
89+
if (packageName !== undefined) {
90+
vsceArgs.push('-o');
91+
vsceArgs.push(packageName);
92+
}
93+
94+
var proc = child_process.spawnSync('node', vsceArgs);
95+
if (proc.error) {
96+
console.error(proc.error.toString());
97+
}
98+
}
99+
100+
function doOfflinePackage(runtimeId, omnisharpAsset, packageName) {
101+
return clean().then(() => {
102+
return installDebugger(runtimeId);
103+
}).then(() => {
104+
return installOmnisharp(omnisharpAsset);
105+
}).then(() => {
106+
doPackageSync(packageName + '-' + runtimeId + '.vsix');
107+
});
108+
}
109+
110+
gulp.task('package:clean', () => {
111+
return del('*.vsix');
112+
});
113+
114+
gulp.task('package:online', ['clean'], () => {
115+
doPackageSync();
16116
});
17117

18-
//TODO: decouple omnisharpDownload (specifically proxy.ts) from vscode
19-
// gulp.task('omnisharp:fetch', ['omnisharp:clean'], () => {
20-
// return omnisharpDownload.downloadOmnisharp();
21-
// });
118+
gulp.task('package:offline', ['clean'], () => {
119+
var json = JSON.parse(fs.readFileSync('package.json'));
120+
var name = json.name;
121+
var version = json.version;
122+
var packageName = name + '.' + version;
22123

124+
var packages = [];
125+
packages.push({rid: 'win7-x64', omni: `omnisharp-${OmniSharpVersion}-win-x64-net451.zip`});
126+
packages.push({rid: 'osx.10.11-x64', omni: `omnisharp-${OmniSharpVersion}-osx-x64-netcoreapp1.0.tar.gz`});
127+
packages.push({rid: 'centos.7-x64', omni: `omnisharp-${OmniSharpVersion}-centos-x64-netcoreapp1.0.tar.gz`});
128+
packages.push({rid: 'debian.8-x64', omni: `omnisharp-${OmniSharpVersion}-debian-x64-netcoreapp1.0.tar.gz`});
129+
packages.push({rid: 'rhel.7.2-x64', omni: `omnisharp-${OmniSharpVersion}-rhel-x64-netcoreapp1.0.tar.gz`});
130+
packages.push({rid: 'ubuntu.14.04-x64', omni: `omnisharp-${OmniSharpVersion}-ubuntu-x64-netcoreapp1.0.tar.gz`});
131+
132+
var promise = Promise.resolve();
133+
134+
packages.forEach(pair => {
135+
promise = promise.then(() => {
136+
return doOfflinePackage(pair.rid, pair.omni, packageName);
137+
})
138+
});
139+
140+
return promise;
141+
});
142+
143+
/// Misc Tasks
23144
const allTypeScript = [
24145
'src/**/*.ts',
25146
'!**/*.d.ts',
@@ -29,7 +150,7 @@ const allTypeScript = [
29150
const lintReporter = (output, file, options) => {
30151
//emits: src/helloWorld.c:5:3: warning: implicit declaration of function ‘prinft’
31152
var relativeBase = file.base.substring(file.cwd.length + 1).replace('\\', '/');
32-
output.forEach(function(e) {
153+
output.forEach(e => {
33154
var message = relativeBase + e.name + ':' + (e.startPosition.line + 1) + ':' + (e.startPosition.character + 1) + ': ' + e.failure;
34155
console.log('[tslint] ' + message);
35156
});
@@ -44,10 +165,4 @@ gulp.task('tslint', () => {
44165
summarizeFailureOutput: false,
45166
emitError: false
46167
}))
47-
});
48-
49-
// gulp.task('omnisharp', ['omnisharp:fetch']);
50-
51-
gulp.task('package', () => {
52-
vsce(['', '', 'package']);
53168
});

package.json

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "csharp",
33
"publisher": "ms-vscode",
4-
"version": "1.1.5",
4+
"version": "1.1.6",
55
"description": "C# for Visual Studio Code (powered by OmniSharp).",
66
"displayName": "C#",
77
"author": "Microsoft Corporation",
@@ -294,14 +294,25 @@
294294
},
295295
"default": []
296296
},
297+
"requireExactSource": {
298+
"type": "boolean",
299+
"description": "Optional flag to require current source code to match the pdb.",
300+
"default": true
301+
},
297302
"pipeTransport": {
298303
"type": "object",
299304
"description": "When present, this tells the debugger to connect to a remote computer using another executable as a pipe that will relay standard input/output between VS Code and the .NET Core debugger backend executable (clrdbg).",
300305
"default": {
306+
"pipeCwd": "${workspaceRoot}",
301307
"pipeProgram": "enter the fully qualified path for the pipe program name, for example 'c:\\tools\\plink.exe'",
302308
"pipeArgs": []
303309
},
304310
"properties" : {
311+
"pipeCwd": {
312+
"type": "string",
313+
"description": "The fully qualified path to the working directory for the pipe program.",
314+
"default": "${workspaceRoot}"
315+
},
305316
"pipeProgram": {
306317
"type": "string",
307318
"description": "The fully qualified pipe command to execute.",
@@ -315,14 +326,26 @@
315326
},
316327
"default": []
317328
},
329+
"pipeEnv": {
330+
"type": "object",
331+
"additionalProperties": { "type": "string" },
332+
"description": "Environment variables passed to the pipe program.",
333+
"default": { }
334+
},
318335
"windows": {
319336
"type": "object",
320337
"description": "Windows-specific pipe launch configuration options",
321338
"default": {
339+
"pipeCwd": "${workspaceRoot}",
322340
"pipeProgram": "enter the fully qualified path for the pipe program name, for example 'c:\\tools\\plink.exe'",
323341
"pipeArgs": []
324342
},
325343
"properties": {
344+
"pipeCwd": {
345+
"type": "string",
346+
"description": "The fully qualified path to the working directory for the pipe program.",
347+
"default": "${workspaceRoot}"
348+
},
326349
"pipeProgram": {
327350
"type": "string",
328351
"description": "The fully qualified pipe command to execute.",
@@ -335,17 +358,29 @@
335358
"type": "string"
336359
},
337360
"default": []
361+
},
362+
"pipeEnv": {
363+
"type": "object",
364+
"additionalProperties": { "type": "string" },
365+
"description": "Environment variables passed to the pipe program.",
366+
"default": { }
338367
}
339368
}
340369
},
341370
"osx": {
342371
"type": "object",
343372
"description": "OSX-specific pipe launch configuration options",
344373
"default": {
374+
"pipeCwd": "${workspaceRoot}",
345375
"pipeProgram": "enter the fully qualified path for the pipe program name, for example '/usr/bin/ssh'",
346376
"pipeArgs": []
347377
},
348378
"properties": {
379+
"pipeCwd": {
380+
"type": "string",
381+
"description": "The fully qualified path to the working directory for the pipe program.",
382+
"default": "${workspaceRoot}"
383+
},
349384
"pipeProgram": {
350385
"type": "string",
351386
"description": "The fully qualified pipe command to execute.",
@@ -358,17 +393,29 @@
358393
"type": "string"
359394
},
360395
"default": []
361-
}
396+
},
397+
"pipeEnv": {
398+
"type": "object",
399+
"additionalProperties": { "type": "string" },
400+
"description": "Environment variables passed to the pipe program.",
401+
"default": { }
402+
}
362403
}
363404
},
364405
"linux": {
365406
"type": "object",
366407
"description": "Linux-specific pipe launch configuration options",
367408
"default": {
409+
"pipeCwd": "${workspaceRoot}",
368410
"pipeProgram": "enter the fully qualified path for the pipe program name, for example '/usr/bin/ssh'",
369411
"pipeArgs": []
370412
},
371413
"properties": {
414+
"pipeCwd": {
415+
"type": "string",
416+
"description": "The fully qualified path to the working directory for the pipe program.",
417+
"default": "${workspaceRoot}"
418+
},
372419
"pipeProgram": {
373420
"type": "string",
374421
"description": "The fully qualified pipe command to execute.",
@@ -381,6 +428,12 @@
381428
"type": "string"
382429
},
383430
"default": []
431+
},
432+
"pipeEnv": {
433+
"type": "object",
434+
"additionalProperties": { "type": "string" },
435+
"description": "Environment variables passed to the pipe program.",
436+
"default": { }
384437
}
385438
}
386439
}
@@ -419,6 +472,11 @@
419472
"items": {
420473
"type": "string"
421474
},
475+
"requireExactSource": {
476+
"type": "boolean",
477+
"description": "Optional flag to require current source code to match the pdb.",
478+
"default": true
479+
},
422480
"default": []
423481
}
424482
}

0 commit comments

Comments
 (0)