Skip to content

Commit 7b4902e

Browse files
Fix up gulp package:offline task
1 parent a7b5619 commit 7b4902e

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

gulpfile.js

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const child_process = require('child_process');
2323

2424
const Logger = logger.Logger;
2525
const PackageManager = packages.PackageManager;
26+
const LinuxDistribution = platform.LinuxDistribution;
2627
const PlatformInformation = platform.PlatformInformation;
2728

2829
/// used in offline packaging run so does not clean .vsix
@@ -36,8 +37,8 @@ gulp.task('clean', ['omnisharp:clean', 'debugger:clean', 'package:clean'], () =>
3637
});
3738

3839
/// Omnisharp Tasks
39-
function installOmnisharp(platform, packageJSON) {
40-
const packageManager = new PackageManager(platform, packageJSON);
40+
function installOmnisharp(platformInfo, packageJSON) {
41+
const packageManager = new PackageManager(platformInfo, packageJSON);
4142
const logger = new Logger(message => process.stdout.write(message));
4243

4344
return packageManager.DownloadPackages(logger)
@@ -47,7 +48,7 @@ function installOmnisharp(platform, packageJSON) {
4748
}
4849

4950
function cleanOmnisharp() {
50-
return del('bin');
51+
return del('.omnisharp-*');
5152
}
5253

5354
gulp.task('omnisharp:clean', () => {
@@ -111,16 +112,16 @@ function doPackageSync(packageName) {
111112
}
112113
}
113114

114-
function doOfflinePackage(runtimeId, platform, packageName, packageJSON) {
115+
function doOfflinePackage(platformInfo, packageName, packageJSON) {
115116
return clean()
116117
.then(() => {
117-
return installDebugger(runtimeId);
118+
return installDebugger(platformInfo.runtimeId);
118119
})
119120
.then(() => {
120-
return installOmnisharp(platform, packageJSON);
121+
return installOmnisharp(platformInfo, packageJSON);
121122
})
122123
.then(() => {
123-
doPackageSync(packageName + '-' + runtimeId + '.vsix');
124+
doPackageSync(packageName + '-' + platformInfo.runtimeId + '.vsix');
124125
});
125126
}
126127

@@ -145,22 +146,22 @@ gulp.task('package:offline', ['clean'], () => {
145146
var packageName = name + '.' + version;
146147

147148
var packages = [];
148-
packages.push({ rid: 'win7-x64', platform: new PlatformInformation('win32') });
149-
packages.push({ rid: 'osx.10.11-x64', platform: new PlatformInformation('darwin', 'x86_64') });
150-
packages.push({ rid: 'centos.7-x64', platform: new PlatformInformation('linux', 'x86_64') });
151-
packages.push({ rid: 'debian.8-x64', platform: new PlatformInformation('linux', 'x86_64') });
152-
packages.push({ rid: 'fedora.23-x64', platform: new PlatformInformation('linux', 'x86_64') });
153-
packages.push({ rid: 'opensuse.13.2-x64', platform: new PlatformInformation('linux', 'x86_64') });
154-
packages.push({ rid: 'rhel.7.2-x64', platform: new PlatformInformation('linux', 'x86_64') });
155-
packages.push({ rid: 'ubuntu.14.04-x64', platform: new PlatformInformation('linux', 'x86_64') });
156-
packages.push({ rid: 'ubuntu.16.04-x64', platform: new PlatformInformation('linux', 'x86_64') });
149+
packages.push(new PlatformInformation('win32', '64-bit'));
150+
packages.push(new PlatformInformation('darwin', 'x86_64'));
151+
packages.push(new PlatformInformation('linux', 'x86_64', new LinuxDistribution('centos', '7')));
152+
packages.push(new PlatformInformation('linux', 'x86_64', new LinuxDistribution('debian', '8')));
153+
packages.push(new PlatformInformation('linux', 'x86_64', new LinuxDistribution('fedora', '23')));
154+
packages.push(new PlatformInformation('linux', 'x86_64', new LinuxDistribution('opensuse', '13.2')));
155+
packages.push(new PlatformInformation('linux', 'x86_64', new LinuxDistribution('rhel', '7.2')));
156+
packages.push(new PlatformInformation('linux', 'x86_64', new LinuxDistribution('ubuntu', '14.04')));
157+
packages.push(new PlatformInformation('linux', 'x86_64', new LinuxDistribution('ubuntu', '16.04')));
157158

158159
var promise = Promise.resolve();
159160

160-
packages.forEach(data => {
161+
packages.forEach(platformInfo => {
161162
promise = promise
162163
.then(() => {
163-
return doOfflinePackage(data.rid, data.platform, packageName, packageJSON);
164+
return doOfflinePackage(platformInfo, packageName, packageJSON);
164165
});
165166
});
166167

0 commit comments

Comments
 (0)