Skip to content

Commit 5ef7d01

Browse files
committed
Reimplement debugger acquisition to use Package Manager
1. Remove all code related to calling dotnet restore/dotnet publish 2. Remove coreclr-debug directory 3. Add debugger runtime packages to package manifest 4. Add an install.Begin file to the package manager so we can detect that it is in progress 5. Rework the debugger proxy so that it understands the package manager 6. Add knowledge of the dotnet cli on the path to the debugger proxy TODO: 1. Lots and lots of testing 2. Offline package creation
1 parent cd7d947 commit 5ef7d01

File tree

12 files changed

+342
-550
lines changed

12 files changed

+342
-550
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ bin
22
node_modules
33
out
44
.omnisharp-*/
5+
.debugger
56

6-
install.lock
7+
install.*
78

89
*.vsix

coreclr-debug/.gitignore

Lines changed: 0 additions & 7 deletions
This file was deleted.

coreclr-debug/NuGet.config

Lines changed: 0 additions & 10 deletions
This file was deleted.

coreclr-debug/dummy.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

gulpfile.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ const PlatformInformation = platform.PlatformInformation;
2929
/// used in offline packaging run so does not clean .vsix
3030
function clean() {
3131
cleanDebugger();
32-
return cleanOmnisharp();
32+
cleanOmnisharp();
3333
}
3434

3535
gulp.task('clean', ['omnisharp:clean', 'debugger:clean', 'package:clean'], () => {
36-
36+
del.sync('install.*');
3737
});
3838

3939
/// Omnisharp Tasks
@@ -48,11 +48,11 @@ function installOmnisharp(platformInfo, packageJSON) {
4848
}
4949

5050
function cleanOmnisharp() {
51-
return del('.omnisharp-*');
51+
del.sync('.omnisharp-*');
5252
}
5353

5454
gulp.task('omnisharp:clean', () => {
55-
return cleanOmnisharp();
55+
cleanOmnisharp();
5656
});
5757

5858
gulp.task('omnisharp:install', ['omnisharp:clean'], () => {
@@ -72,12 +72,7 @@ function installDebugger(runtimeId) {
7272
}
7373

7474
function cleanDebugger() {
75-
try {
76-
getDebugInstaller().clean();
77-
console.log('Cleaned Succesfully');
78-
} catch (error) {
79-
console.error(error);
80-
}
75+
del.sync('.debugger');
8176
}
8277

8378
gulp.task('debugger:install', ['debugger:clean'], () => {
@@ -130,7 +125,7 @@ function getPackageJSON() {
130125
}
131126

132127
gulp.task('package:clean', () => {
133-
return del('*.vsix');
128+
del.sync('*.vsix');
134129
});
135130

136131
gulp.task('package:online', ['clean'], () => {

package.json

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,110 @@
190190
"darwin",
191191
"linux"
192192
]
193+
},
194+
{
195+
"description": ".NET Core Debugger (Windows / x64)",
196+
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-win7-x64.zip",
197+
"installPath": ".debugger",
198+
"runtimeIds": [
199+
"win7-x64"
200+
]
201+
},
202+
{
203+
"description": ".NET Core Debugger (OSX / x64)",
204+
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-osx.10.11-x64.zip",
205+
"installPath": ".debugger",
206+
"runtimeIds": [
207+
"osx.10.11-x64"
208+
],
209+
"binaries": [
210+
"./OpenDebugAD7",
211+
"./clrdbg"
212+
]
213+
},
214+
{
215+
"description": ".NET Core Debugger (CentOS / x64)",
216+
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-centos.7-x64.zip",
217+
"installPath": ".debugger",
218+
"runtimeIds": [
219+
"centos.7-x64"
220+
],
221+
"binaries": [
222+
"./OpenDebugAD7",
223+
"./clrdbg"
224+
]
225+
},
226+
{
227+
"description": ".NET Core Debugger (Debian / x64)",
228+
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-debian.8-x64.zip",
229+
"installPath": ".debugger",
230+
"runtimeIds": [
231+
"debian.8-x64"
232+
],
233+
"binaries": [
234+
"./OpenDebugAD7",
235+
"./clrdbg"
236+
]
237+
},
238+
{
239+
"description": ".NET Core Debugger (Fedora / x64)",
240+
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-fedora.23-x64.zip",
241+
"installPath": ".debugger",
242+
"runtimeIds": [
243+
"fedora.23-x64"
244+
],
245+
"binaries": [
246+
"./OpenDebugAD7",
247+
"./clrdbg"
248+
]
249+
},
250+
{
251+
"description": ".NET Core Debugger (OpenSUSE / x64)",
252+
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-opensuse.13.2-x64.zip",
253+
"installPath": ".debugger",
254+
"runtimeIds": [
255+
"opensuse.13.2-x64"
256+
],
257+
"binaries": [
258+
"./OpenDebugAD7",
259+
"./clrdbg"
260+
]
261+
},
262+
{
263+
"description": ".NET Core Debugger (RHEL / x64)",
264+
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-rhel.7.2-x64.zip",
265+
"installPath": ".debugger",
266+
"runtimeIds": [
267+
"rhel.7-x64"
268+
],
269+
"binaries": [
270+
"./OpenDebugAD7",
271+
"./clrdbg"
272+
]
273+
},
274+
{
275+
"description": ".NET Core Debugger (Ubuntu 14 / x64)",
276+
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-ubuntu.14.04-x64.zip",
277+
"installPath": ".debugger",
278+
"runtimeIds": [
279+
"ubuntu.14.04-x64"
280+
],
281+
"binaries": [
282+
"./OpenDebugAD7",
283+
"./clrdbg"
284+
]
285+
},
286+
{
287+
"description": ".NET Core Debugger (Ubuntu 16 / x64)",
288+
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-ubuntu.16.04-x64.zip",
289+
"installPath": ".debugger",
290+
"runtimeIds": [
291+
"ubuntu.16.04-x64"
292+
],
293+
"binaries": [
294+
"./OpenDebugAD7",
295+
"./clrdbg"
296+
]
193297
}
194298
],
195299
"engines": {

src/common.ts

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ export function getExtensionPath() {
2121
return extensionPath;
2222
}
2323

24-
export function getBinPath() {
25-
return path.resolve(getExtensionPath(), "bin");
26-
}
27-
2824
export function buildPromiseChain<T, TResult>(array: T[], builder: (item: T) => Promise<TResult>): Promise<TResult> {
2925
return array.reduce(
3026
(promise, n) => promise.then(() => builder(n)),
@@ -60,19 +56,37 @@ export function fileExists(filePath: string): Promise<boolean> {
6056
});
6157
}
6258

63-
function getInstallLockFilePath(): string {
64-
return path.resolve(getExtensionPath(), 'install.lock');
59+
export enum InstallFileType {
60+
Begin,
61+
Lock
62+
}
63+
64+
function getInstallFilePath(type: InstallFileType): string {
65+
let installFile = 'install.' + InstallFileType[type];
66+
return path.resolve(getExtensionPath(), installFile);
6567
}
6668

67-
export function lockFileExists(): Promise<boolean> {
68-
return fileExists(getInstallLockFilePath());
69+
export function installFileExists(type: InstallFileType): Promise<boolean> {
70+
return fileExists(getInstallFilePath(type));
71+
}
72+
73+
export function touchInstallFile(type: InstallFileType): Promise<void> {
74+
return new Promise<void>((resolve, reject) => {
75+
fs.writeFile(getInstallFilePath(type), '', err => {
76+
if (err) {
77+
reject(err);
78+
}
79+
80+
resolve();
81+
});
82+
});
6983
}
7084

71-
export function touchLockFile(): Promise<void> {
85+
export function deleteInstallFile(type: InstallFileType): Promise<void> {
7286
return new Promise<void>((resolve, reject) => {
73-
fs.writeFile(getInstallLockFilePath(), '', err => {
87+
fs.unlink(getInstallFilePath(type), err => {
7488
if (err) {
75-
return reject(err);
89+
reject(err);
7690
}
7791

7892
resolve();

0 commit comments

Comments
 (0)