Skip to content

Commit dce4d48

Browse files
Fix gulp tasks for packaging online and offline VSIXs
1 parent 34128c1 commit dce4d48

File tree

1 file changed

+26
-23
lines changed

1 file changed

+26
-23
lines changed

gulpfile.js

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,16 @@ const platform = require('./out/src/platform');
2323
const child_process = require('child_process');
2424

2525
const Flavor = omnisharp.Flavor;
26-
const Platform = platform.Platform;
26+
const CoreClrFlavor = platform.CoreClrFlavor;
27+
const PlatformInformation = platform.PlatformInformation;
2728

2829
/// used in offline packaging run so does not clean .vsix
2930
function clean() {
3031
cleanDebugger();
3132
return cleanOmnisharp();
3233
}
3334

34-
gulp.task('clean', ['omnisharp:clean', 'debugger:clean', 'package:clean'], () => {
35+
gulp.task('clean', ['omnisharp:clean', 'debugger:clean', 'package:clean'], () => {
3536

3637
});
3738

@@ -40,7 +41,7 @@ function installOmnisharp(omnisharps) {
4041
const promises = omnisharps.map((omni, index) => {
4142
const log = new logger.Logger(message => process.stdout.write(message), index.toString());
4243

43-
return download.go(omni.flavor, omni.platform, log);
44+
return download.go(omni.flavor, omni.coreClrFlavor, log);
4445
});
4546

4647
return Promise.all(promises);
@@ -56,9 +57,11 @@ gulp.task('omnisharp:clean', () => {
5657

5758
gulp.task('omnisharp:install', ['omnisharp:clean'], () => {
5859
const flavor = gulpUtil.env.flavor || Flavor.CoreCLR;
59-
const platform = gulpUtil.env.platform || platform.getCurrentPlatform();
6060

61-
return installOmnisharp([{flavor, platform}]);
61+
return PlatformInformation.GetCurrent().then(info => {
62+
const coreClrFlavor = gulpUtil.env.coreClrFlavor || info.getCoreClrFlavor();
63+
return installOmnisharp([{ flavor, coreClrFlavor }]);
64+
});
6265
});
6366

6467
/// Debugger Tasks
@@ -134,15 +137,15 @@ gulp.task('package:offline', ['clean'], () => {
134137
var packageName = name + '.' + version;
135138

136139
var packages = [];
137-
packages.push({rid: 'win7-x64', omnisharps: [{flavor: Flavor.CoreCLR, platform: Platform.Windows}, {flavor: Flavor.Desktop, platform: Platform.Windows}]});
138-
packages.push({rid: 'osx.10.11-x64', omnisharps: [{flavor: Flavor.CoreCLR, platform: Platform.OSX}]});
139-
packages.push({rid: 'centos.7-x64', omnisharps: [{flavor: Flavor.CoreCLR, platform: Platform.CentOS}]});
140-
packages.push({rid: 'debian.8-x64', omnisharps: [{flavor: Flavor.CoreCLR, platform: Platform.Debian}]});
141-
packages.push({rid: 'fedora.23-x64', omnisharps: [{flavor: Flavor.CoreCLR, platform: Platform.Fedora}]});
142-
packages.push({rid: 'opensuse.13.2-x64', omnisharps: [{flavor: Flavor.CoreCLR, platform: Platform.OpenSUSE}]});
143-
packages.push({rid: 'rhel.7.2-x64', omnisharps: [{flavor: Flavor.CoreCLR, platform: Platform.RHEL}]});
144-
packages.push({rid: 'ubuntu.14.04-x64', omnisharps: [{flavor: Flavor.CoreCLR, platform: Platform.Ubuntu14}]});
145-
packages.push({rid: 'ubuntu.16.04-x64', omnisharps: [{flavor: Flavor.CoreCLR, platform: Platform.Ubuntu16}]});
140+
packages.push({ rid: 'win7-x64', omnisharps: [{ flavor: Flavor.CoreCLR, coreClrFlavor: CoreClrFlavor.Windows }, { flavor: Flavor.Desktop, coreClrFlavor: CoreClrFlavor.Windows }] });
141+
packages.push({ rid: 'osx.10.11-x64', omnisharps: [{ flavor: Flavor.CoreCLR, coreClrFlavor: CoreClrFlavor.OSX }] });
142+
packages.push({ rid: 'centos.7-x64', omnisharps: [{ flavor: Flavor.CoreCLR, coreClrFlavor: CoreClrFlavor.CentOS }] });
143+
packages.push({ rid: 'debian.8-x64', omnisharps: [{ flavor: Flavor.CoreCLR, coreClrFlavor: CoreClrFlavor.Debian }] });
144+
packages.push({ rid: 'fedora.23-x64', omnisharps: [{ flavor: Flavor.CoreCLR, coreClrFlavor: CoreClrFlavor.Fedora }] });
145+
packages.push({ rid: 'opensuse.13.2-x64', omnisharps: [{ flavor: Flavor.CoreCLR, coreClrFlavor: CoreClrFlavor.OpenSUSE }] });
146+
packages.push({ rid: 'rhel.7.2-x64', omnisharps: [{ flavor: Flavor.CoreCLR, coreClrFlavor: CoreClrFlavor.RHEL }] });
147+
packages.push({ rid: 'ubuntu.14.04-x64', omnisharps: [{ flavor: Flavor.CoreCLR, coreClrFlavor: CoreClrFlavor.Ubuntu14 }] });
148+
packages.push({ rid: 'ubuntu.16.04-x64', omnisharps: [{ flavor: Flavor.CoreCLR, coreClrFlavor: CoreClrFlavor.Ubuntu16 }] });
146149

147150
var promise = Promise.resolve();
148151

@@ -158,7 +161,7 @@ gulp.task('package:offline', ['clean'], () => {
158161
/// Test Task
159162
gulp.task('test', () => {
160163
gulp.src('out/test/**/*.tests.js')
161-
.pipe(mocha({ui: "tdd"}))
164+
.pipe(mocha({ ui: "tdd" }))
162165
.once('error', () => {
163166
process.exit(1);
164167
})
@@ -175,17 +178,17 @@ const allTypeScript = [
175178
];
176179

177180
const lintReporter = (output, file, options) => {
178-
//emits: src/helloWorld.c:5:3: warning: implicit declaration of function ‘prinft’
179-
var relativeBase = file.base.substring(file.cwd.length + 1).replace('\\', '/');
180-
output.forEach(e => {
181-
var message = relativeBase + e.name + ':' + (e.startPosition.line + 1) + ':' + (e.startPosition.character + 1) + ': ' + e.failure;
182-
console.log('[tslint] ' + message);
183-
});
181+
//emits: src/helloWorld.c:5:3: warning: implicit declaration of function ‘prinft’
182+
var relativeBase = file.base.substring(file.cwd.length + 1).replace('\\', '/');
183+
output.forEach(e => {
184+
var message = relativeBase + e.name + ':' + (e.startPosition.line + 1) + ':' + (e.startPosition.character + 1) + ': ' + e.failure;
185+
console.log('[tslint] ' + message);
186+
});
184187
};
185188

186189
gulp.task('tslint', () => {
187-
gulp.src(allTypeScript)
188-
.pipe(tslint({
190+
gulp.src(allTypeScript)
191+
.pipe(tslint({
189192
rulesDirectory: "node_modules/tslint-microsoft-contrib"
190193
}))
191194
.pipe(tslint.report(lintReporter, {

0 commit comments

Comments
 (0)