Skip to content

Commit

Permalink
Merge pull request #440 from OmniSharp/master
Browse files Browse the repository at this point in the history
Merge master to release
  • Loading branch information
gregg-miskelly authored Jun 14, 2016
2 parents ce74d98 + b2e63f2 commit cfd6a86
Show file tree
Hide file tree
Showing 15 changed files with 720 additions and 494 deletions.
7 changes: 1 addition & 6 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,9 @@ src/**
**/*.map

.vscode/**
.omnisharp/**

**/.nyc_output/**
**/coverage/**

coreclr-debug/debugAdapters/**
coreclr-debug/bin/**
coreclr-debug/obj/**
coreclr-debug/project.lock.json
coreclr-debug/install.log
+RuntimeLicenses/dependencies/*
coreclr-debug/install.log
141 changes: 128 additions & 13 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,142 @@

'use strict';

const fs = require('fs');
const path = require('path');
const del = require('del');
const gulp = require('gulp');
const gulpUtil = require('gulp-util');
const tslint = require('gulp-tslint');
const vsce = require('vsce');
//const omnisharpDownload = require('./out/omnisharpDownload');
const debugUtil = require('./out/coreclr-debug/util.js');
const debugInstall = require('./out/coreclr-debug/install.js');
const fs_extra = require('fs-extra-promise');
const omnisharpDownload = require('./out/omnisharpDownload');
const child_process = require('child_process');

const OmniSharpVersion = omnisharpDownload.OmniSharpVersion;

/// used in offline packaging run so does not clean .vsix
function clean() {
cleanDebugger();
return cleanOmnisharp();
}

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

});

/// Omnisharp Tasks
function installOmnisharp(omnisharpAssetName) {
const logFunction = (message) => { console.log(message); };
return omnisharpDownload.downloadOmnisharp(logFunction, omnisharpAssetName);
}

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

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

gulp.task('omnisharp:install', ['omnisharp:clean'], () => {
var asset = gulpUtil.env.asset || omnisharpDownload.getOmnisharpAssetName();
return installOmnisharp(asset);
});

/// Debugger Tasks
function getDebugInstaller() {
return new debugInstall.DebugInstaller(new debugUtil.CoreClrDebugUtil(path.resolve('.')), true);
}

function installDebugger(runtimeId) {
return getDebugInstaller().install(runtimeId);
}

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

gulp.task('debugger:install', ['debugger:clean'], () => {
installDebugger(gulp.env.runtimeId).then(() => {
console.log('Installed Succesfully');
}).catch((error) => {
console.error(error);
});
});

gulp.task('debugger:clean', () => {
cleanDebugger();
});

/// Packaging Tasks
function doPackageSync(packageName) {

var vsceArgs = [];
vsceArgs.push(path.join(__dirname, 'node_modules', 'vsce', 'out', 'vsce'))
vsceArgs.push('package'); // package command

if (packageName !== undefined) {
vsceArgs.push('-o');
vsceArgs.push(packageName);
}

var proc = child_process.spawnSync('node', vsceArgs);
if (proc.error) {
console.error(proc.error.toString());
}
}

function doOfflinePackage(runtimeId, omnisharpAsset, packageName) {
return clean().then(() => {
return installDebugger(runtimeId);
}).then(() => {
return installOmnisharp(omnisharpAsset);
}).then(() => {
doPackageSync(packageName + '-' + runtimeId + '.vsix');
});
}

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

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

//TODO: decouple omnisharpDownload (specifically proxy.ts) from vscode
// gulp.task('omnisharp:fetch', ['omnisharp:clean'], () => {
// return omnisharpDownload.downloadOmnisharp();
// });
gulp.task('package:offline', ['clean'], () => {
var json = JSON.parse(fs.readFileSync('package.json'));
var name = json.name;
var version = json.version;
var packageName = name + '.' + version;

var packages = [];
packages.push({rid: 'win7-x64', omni: `omnisharp-${OmniSharpVersion}-win-x64-net451.zip`});
packages.push({rid: 'osx.10.11-x64', omni: `omnisharp-${OmniSharpVersion}-osx-x64-netcoreapp1.0.tar.gz`});
packages.push({rid: 'centos.7-x64', omni: `omnisharp-${OmniSharpVersion}-centos-x64-netcoreapp1.0.tar.gz`});
packages.push({rid: 'debian.8-x64', omni: `omnisharp-${OmniSharpVersion}-debian-x64-netcoreapp1.0.tar.gz`});
packages.push({rid: 'rhel.7.2-x64', omni: `omnisharp-${OmniSharpVersion}-rhel-x64-netcoreapp1.0.tar.gz`});
packages.push({rid: 'ubuntu.14.04-x64', omni: `omnisharp-${OmniSharpVersion}-ubuntu-x64-netcoreapp1.0.tar.gz`});

var promise = Promise.resolve();

packages.forEach(pair => {
promise = promise.then(() => {
return doOfflinePackage(pair.rid, pair.omni, packageName);
})
});

return promise;
});

/// Misc Tasks
const allTypeScript = [
'src/**/*.ts',
'!**/*.d.ts',
Expand All @@ -29,7 +150,7 @@ const allTypeScript = [
const lintReporter = (output, file, options) => {
//emits: src/helloWorld.c:5:3: warning: implicit declaration of function ‘prinft’
var relativeBase = file.base.substring(file.cwd.length + 1).replace('\\', '/');
output.forEach(function(e) {
output.forEach(e => {
var message = relativeBase + e.name + ':' + (e.startPosition.line + 1) + ':' + (e.startPosition.character + 1) + ': ' + e.failure;
console.log('[tslint] ' + message);
});
Expand All @@ -44,10 +165,4 @@ gulp.task('tslint', () => {
summarizeFailureOutput: false,
emitError: false
}))
});

// gulp.task('omnisharp', ['omnisharp:fetch']);

gulp.task('package', () => {
vsce(['', '', 'package']);
});
62 changes: 60 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "csharp",
"publisher": "ms-vscode",
"version": "1.1.5",
"version": "1.1.6",
"description": "C# for Visual Studio Code (powered by OmniSharp).",
"displayName": "C#",
"author": "Microsoft Corporation",
Expand Down Expand Up @@ -294,14 +294,25 @@
},
"default": []
},
"requireExactSource": {
"type": "boolean",
"description": "Optional flag to require current source code to match the pdb.",
"default": true
},
"pipeTransport": {
"type": "object",
"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).",
"default": {
"pipeCwd": "${workspaceRoot}",
"pipeProgram": "enter the fully qualified path for the pipe program name, for example 'c:\\tools\\plink.exe'",
"pipeArgs": []
},
"properties" : {
"pipeCwd": {
"type": "string",
"description": "The fully qualified path to the working directory for the pipe program.",
"default": "${workspaceRoot}"
},
"pipeProgram": {
"type": "string",
"description": "The fully qualified pipe command to execute.",
Expand All @@ -315,14 +326,26 @@
},
"default": []
},
"pipeEnv": {
"type": "object",
"additionalProperties": { "type": "string" },
"description": "Environment variables passed to the pipe program.",
"default": { }
},
"windows": {
"type": "object",
"description": "Windows-specific pipe launch configuration options",
"default": {
"pipeCwd": "${workspaceRoot}",
"pipeProgram": "enter the fully qualified path for the pipe program name, for example 'c:\\tools\\plink.exe'",
"pipeArgs": []
},
"properties": {
"pipeCwd": {
"type": "string",
"description": "The fully qualified path to the working directory for the pipe program.",
"default": "${workspaceRoot}"
},
"pipeProgram": {
"type": "string",
"description": "The fully qualified pipe command to execute.",
Expand All @@ -335,17 +358,29 @@
"type": "string"
},
"default": []
},
"pipeEnv": {
"type": "object",
"additionalProperties": { "type": "string" },
"description": "Environment variables passed to the pipe program.",
"default": { }
}
}
},
"osx": {
"type": "object",
"description": "OSX-specific pipe launch configuration options",
"default": {
"pipeCwd": "${workspaceRoot}",
"pipeProgram": "enter the fully qualified path for the pipe program name, for example '/usr/bin/ssh'",
"pipeArgs": []
},
"properties": {
"pipeCwd": {
"type": "string",
"description": "The fully qualified path to the working directory for the pipe program.",
"default": "${workspaceRoot}"
},
"pipeProgram": {
"type": "string",
"description": "The fully qualified pipe command to execute.",
Expand All @@ -358,17 +393,29 @@
"type": "string"
},
"default": []
}
},
"pipeEnv": {
"type": "object",
"additionalProperties": { "type": "string" },
"description": "Environment variables passed to the pipe program.",
"default": { }
}
}
},
"linux": {
"type": "object",
"description": "Linux-specific pipe launch configuration options",
"default": {
"pipeCwd": "${workspaceRoot}",
"pipeProgram": "enter the fully qualified path for the pipe program name, for example '/usr/bin/ssh'",
"pipeArgs": []
},
"properties": {
"pipeCwd": {
"type": "string",
"description": "The fully qualified path to the working directory for the pipe program.",
"default": "${workspaceRoot}"
},
"pipeProgram": {
"type": "string",
"description": "The fully qualified pipe command to execute.",
Expand All @@ -381,6 +428,12 @@
"type": "string"
},
"default": []
},
"pipeEnv": {
"type": "object",
"additionalProperties": { "type": "string" },
"description": "Environment variables passed to the pipe program.",
"default": { }
}
}
}
Expand Down Expand Up @@ -419,6 +472,11 @@
"items": {
"type": "string"
},
"requireExactSource": {
"type": "boolean",
"description": "Optional flag to require current source code to match the pdb.",
"default": true
},
"default": []
}
}
Expand Down
Loading

0 comments on commit cfd6a86

Please sign in to comment.