Skip to content

Commit

Permalink
clean up scripts in extensionSamples (#946)
Browse files Browse the repository at this point in the history
  • Loading branch information
AbbiePetcht committed Mar 22, 2018
1 parent f76e8ae commit 4cfd9bd
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 123 deletions.
4 changes: 1 addition & 3 deletions samples/extensionSamples/package.json
Expand Up @@ -186,14 +186,12 @@
"gulp-sourcemaps": "^2.6.4",
"gulp-tslint": "^6.0.2",
"gulp-typescript": "^3.2.4",
"pm-mocha-jenkins-reporter": "^0.2.6",
"should": "^13.2.1",
"temp-write": "^3.4.0",
"tslint": "^3.14.0",
"typemoq": "^2.1.0",
"typescript": "^2.6.1",
"vscode": "^1.1.6",
"vsce": "1.36.2",
"vso-node-api": "6.1.2-preview"
"vsce": "1.36.2"
}
}
8 changes: 0 additions & 8 deletions samples/extensionSamples/tasks/config.js
Expand Up @@ -2,10 +2,6 @@ var path = require('path');

var projectRoot = path.resolve(path.dirname(__dirname));
var srcRoot = path.resolve(projectRoot, 'src');
var viewsRoot = path.resolve(srcRoot, 'views');
var htmlcontentRoot = path.resolve(viewsRoot, 'htmlcontent');
var outRoot = path.resolve(projectRoot, 'out');
var htmloutroot = path.resolve(outRoot, 'src/views/htmlcontent');
var localization = path.resolve(projectRoot, 'localization');

var config = {
Expand All @@ -16,10 +12,6 @@ var config = {
},
extension: {
root: srcRoot
},
html: {
root: htmlcontentRoot,
out: htmloutroot
}
}
};
Expand Down
112 changes: 0 additions & 112 deletions samples/extensionSamples/tasks/packagetasks.js
Expand Up @@ -34,115 +34,3 @@ let buildPackage = function(packageName) {
console.log(command);
return exec(command);
};


// function getServiceInstaller() {
// let Constants = require('../out/src/models/constants').Constants;
// let ServiceInstaller = require('../out/src/languageservice/serviceInstallerUtil').ServiceInstaller;
// return new ServiceInstaller(new Constants())
// }
//
// function installToolsService(platform) {
// let installer = getServiceInstaller();
// return installer.installService(platform);
// }

// function cleanServiceInstallFolder() {
// let installer = getServiceInstaller();
// return new Promise(function(resolve, reject) {
// installer.getServiceInstallDirectoryRoot().then(function (serviceInstallFolder) {
// console.log('Deleting Service Install folder: ' + serviceInstallFolder);
// del(serviceInstallFolder + '/*').then(function () {
// resolve();
// }).catch(function (error) {
// reject(error)
// });
// });
// });
// }

// function doOfflinePackage(runtimeId, platform, packageName) {
// return installSqlToolsService(platform).then(function() {
// return doPackageSync(packageName + '-' + runtimeId + '.vsix');
// });
// }

// ORIGINAL GULP TASKS /////////////////////////////////////////////////////
// TODO: Reinstate when we have code for loading a tools service

// gulp.task('ext:install-service', function() {
// return installSqlToolsService();
// });

// Install vsce to be able to run this task: npm install -g vsce
// gulp.task('package:online', function() {
// return cleanServiceInstallFolder()
// .then(function() { return doPackageSync(); });
// });

// Install vsce to be able to run this task: npm install -g vsce
// gulp.task('package:offline', function() {
// const platform = require('../out/src/models/platform');
// const Runtime = platform.Runtime;
// let json = JSON.parse(fs.readFileSync('package.json').toString());
// let name = json.name;
// let version = json.version;
// let packageName = name + '-' + version;
//
// let packages = [];
// packages.push({rid: 'win-x64', runtime: Runtime.Windows_64});
// packages.push({rid: 'win-x86', runtime: Runtime.Windows_86});
// packages.push({rid: 'osx', runtime: Runtime.OSX});
// packages.push({rid: 'linux-x64', runtime: Runtime.Linux_64});
//
// let promise = Promise.resolve();
// cleanServiceInstallFolder().then(function () {
// packages.forEach(function (data) {
// promise = promise.then(function () {
// return doOfflinePackage(data.rid, data.runtime, packageName).then(function () {
// return cleanServiceInstallFolder();
// });
// });
// });
// });
//
// return promise;
// });

function getOnlinePackageName() {
return packageVals.name + "-" + packageVals.version + ".vsix";
}

function getOnlinePackagePath() {
return './' + getOnlinePackageName();
}

// TEMPORARY GULP TASKS ////////////////////////////////////////////////////
gulp.task('package:online', gulp.series("build", function() {
return buildPackage(getOnlinePackageName());
}));

gulp.task('package:offline', gulp.series("build", function(done) {
// TODO: Get list of platforms
// TODO: For each platform: clean the package service folder, download the service, build the package
console.error("This mode is not yet supported");
done("This mode is not yet supported");
}));

gulp.task('install:sqlops', gulp.series("package:online", function() {
let command = 'sqlops --install-extension ' + getOnlinePackagePath();
console.log(command);
return exec(command);
}));

gulp.task("help:debug", function(done) {
let command = '$SQLOPS_DEV/scripts/sql.sh --extensionDevelopmentPath='+process.cwd();
console.log('Launch sqlops + your extension (from a sqlops dev enlistment after setting $SQLOPS_DEV to your enlistment root):\n')
console.log(color(command, 'GREEN'));

command = 'sqlops --extensionDevelopmentPath='+process.cwd();
console.log('\nLaunch sqlops + your extension (full SQLOPS - requires setting PATH variable)\n');
console.log(color(command, 'GREEN'));
done();
})

0 comments on commit 4cfd9bd

Please sign in to comment.