From 4cfd9bdbc05819cade4e6589677e556932a64575 Mon Sep 17 00:00:00 2001 From: Abbie Petchtes Date: Thu, 22 Mar 2018 11:08:27 -0700 Subject: [PATCH] clean up scripts in extensionSamples (#946) --- samples/extensionSamples/package.json | 4 +- samples/extensionSamples/tasks/config.js | 8 -- .../extensionSamples/tasks/packagetasks.js | 112 ------------------ 3 files changed, 1 insertion(+), 123 deletions(-) diff --git a/samples/extensionSamples/package.json b/samples/extensionSamples/package.json index 575043851f5b..83ed00a625c5 100644 --- a/samples/extensionSamples/package.json +++ b/samples/extensionSamples/package.json @@ -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" } } diff --git a/samples/extensionSamples/tasks/config.js b/samples/extensionSamples/tasks/config.js index df94d9f6e1ae..ed04a81727d2 100644 --- a/samples/extensionSamples/tasks/config.js +++ b/samples/extensionSamples/tasks/config.js @@ -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 = { @@ -16,10 +12,6 @@ var config = { }, extension: { root: srcRoot - }, - html: { - root: htmlcontentRoot, - out: htmloutroot } } }; diff --git a/samples/extensionSamples/tasks/packagetasks.js b/samples/extensionSamples/tasks/packagetasks.js index dda03fb708cb..4fa77aaa8530 100644 --- a/samples/extensionSamples/tasks/packagetasks.js +++ b/samples/extensionSamples/tasks/packagetasks.js @@ -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(); -}) -