Skip to content
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

Reimplement debugger acquisition to use Package Manager #873

Merged
merged 4 commits into from
Nov 7, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ bin
node_modules
out
.omnisharp-*/
.debugger

install.lock
install.*

*.vsix
7 changes: 0 additions & 7 deletions coreclr-debug/.gitignore

This file was deleted.

10 changes: 0 additions & 10 deletions coreclr-debug/NuGet.config

This file was deleted.

13 changes: 0 additions & 13 deletions coreclr-debug/dummy.cs

This file was deleted.

17 changes: 6 additions & 11 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ const PlatformInformation = platform.PlatformInformation;
/// used in offline packaging run so does not clean .vsix
function clean() {
cleanDebugger();
return cleanOmnisharp();
cleanOmnisharp();
}

gulp.task('clean', ['omnisharp:clean', 'debugger:clean', 'package:clean'], () => {

del.sync('install.*');
});

/// Omnisharp Tasks
Expand All @@ -48,11 +48,11 @@ function installOmnisharp(platformInfo, packageJSON) {
}

function cleanOmnisharp() {
return del('.omnisharp-*');
del.sync('.omnisharp-*');
}

gulp.task('omnisharp:clean', () => {
return cleanOmnisharp();
cleanOmnisharp();
});

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

function cleanDebugger() {
try {
getDebugInstaller().clean();
console.log('Cleaned Succesfully');
} catch (error) {
console.error(error);
}
del.sync('.debugger');
}

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

gulp.task('package:clean', () => {
return del('*.vsix');
del.sync('*.vsix');
});

gulp.task('package:online', ['clean'], () => {
Expand Down
104 changes: 104 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,110 @@
"darwin",
"linux"
]
},
{
"description": ".NET Core Debugger (Windows / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-win7-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"win7-x64"
]
},
{
"description": ".NET Core Debugger (OSX / x64)",
Copy link
Member

@DustinCampbell DustinCampbell Nov 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"macOS"? #Pending

Copy link
Contributor Author

@chuckries chuckries Nov 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was basing it off omnisharp: "description": "OmniSharp (.NET Core - OSX / x64)",
I'll change it in both places. #Closed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fine be me. I was just working on my own local branch when I wrote "macOS". I don't much care. 😄

"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-osx.10.11-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"osx.10.11-x64"
],
"binaries": [
"./OpenDebugAD7",
"./clrdbg"
]
},
{
"description": ".NET Core Debugger (CentOS / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-centos.7-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"centos.7-x64"
],
"binaries": [
"./OpenDebugAD7",
"./clrdbg"
]
},
{
"description": ".NET Core Debugger (Debian / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-debian.8-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"debian.8-x64"
],
"binaries": [
"./OpenDebugAD7",
"./clrdbg"
]
},
{
"description": ".NET Core Debugger (Fedora / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-fedora.23-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"fedora.23-x64"
],
"binaries": [
"./OpenDebugAD7",
"./clrdbg"
]
},
{
"description": ".NET Core Debugger (OpenSUSE / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-opensuse.13.2-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"opensuse.13.2-x64"
],
"binaries": [
"./OpenDebugAD7",
"./clrdbg"
]
},
{
"description": ".NET Core Debugger (RHEL / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-rhel.7.2-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"rhel.7-x64"
],
"binaries": [
"./OpenDebugAD7",
"./clrdbg"
]
},
{
"description": ".NET Core Debugger (Ubuntu 14 / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-ubuntu.14.04-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"ubuntu.14.04-x64"
],
"binaries": [
"./OpenDebugAD7",
"./clrdbg"
]
},
{
"description": ".NET Core Debugger (Ubuntu 16 / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-ubuntu.16.04-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"ubuntu.16.04-x64"
],
"binaries": [
"./OpenDebugAD7",
"./clrdbg"
]
}
],
"engines": {
Expand Down
36 changes: 25 additions & 11 deletions src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ export function getExtensionPath() {
return extensionPath;
}

export function getBinPath() {
return path.resolve(getExtensionPath(), "bin");
}

export function buildPromiseChain<T, TResult>(array: T[], builder: (item: T) => Promise<TResult>): Promise<TResult> {
return array.reduce(
(promise, n) => promise.then(() => builder(n)),
Expand Down Expand Up @@ -60,19 +56,37 @@ export function fileExists(filePath: string): Promise<boolean> {
});
}

function getInstallLockFilePath(): string {
return path.resolve(getExtensionPath(), 'install.lock');
export enum InstallFileType {
Begin,
Lock
}

function getInstallFilePath(type: InstallFileType): string {
let installFile = 'install.' + InstallFileType[type];
return path.resolve(getExtensionPath(), installFile);
}

export function lockFileExists(): Promise<boolean> {
return fileExists(getInstallLockFilePath());
export function installFileExists(type: InstallFileType): Promise<boolean> {
return fileExists(getInstallFilePath(type));
}

export function touchInstallFile(type: InstallFileType): Promise<void> {
return new Promise<void>((resolve, reject) => {
fs.writeFile(getInstallFilePath(type), '', err => {
if (err) {
reject(err);
Copy link
Member

@DustinCampbell DustinCampbell Nov 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd return here so that it doesn't carry on to the resolve below. #Pending

}

resolve();
});
});
}

export function touchLockFile(): Promise<void> {
export function deleteInstallFile(type: InstallFileType): Promise<void> {
return new Promise<void>((resolve, reject) => {
fs.writeFile(getInstallLockFilePath(), '', err => {
fs.unlink(getInstallFilePath(type), err => {
if (err) {
return reject(err);
reject(err);
}

resolve();
Expand Down
Loading