diff --git a/package.json b/package.json index dab7608..58fcc54 100644 --- a/package.json +++ b/package.json @@ -26,25 +26,25 @@ "license": "SEE LICENSE IN LICENSE.txt", "dependencies": { "vscode-chrome-debug-core": "3.9.1", - "node-ipc": "^8.9.2", - "source-map": "^0.5.3", + "node-ipc": "8.10.3", + "source-map": "0.5.6", "xmlhttprequest": "https://github.com/telerik/node-XMLHttpRequest/tarball/master", - "universal-analytics": "^0.4.6", - "vscode-debugadapter": "^1.14.0", - "vscode-debugprotocol": "^1.14.0" + "universal-analytics": "0.4.13", + "vscode-debugadapter": "1.19.0", + "vscode-debugprotocol": "1.19.0" }, "devDependencies": { - "@types/es6-collections": "^0.5.29", - "@types/es6-promise": "^0.0.32", - "@types/mocha": "^2.2.32", - "@types/node": "^6.0.46", - "@types/source-map": "^0.1.29", + "@types/es6-collections": "0.5.30", + "@types/es6-promise": "0.0.32", + "@types/mocha": "2.2.41", + "@types/node": "6.0.46", + "@types/source-map": "~0.1.0", "chrome-remote-debug-protocol": "git://github.com/roblourens/chrome-remote-debug-protocol.git", - "mocha": "^2.4.5", - "typescript": "^2.4.0", - "vsce": "^1.18.0", - "vscode": "^1.0.3", - "vscode-debugadapter-testsupport": "^1.7.0" + "mocha": "2.5.3", + "typescript": "~2.4.0", + "vsce": "1.22.0", + "vscode": "1.1.0", + "vscode-debugadapter-testsupport": "1.19.0" }, "scripts": { "clean": "git clean -fdx", @@ -75,6 +75,10 @@ "type": "string", "default": "tns", "description": "Path to the NativeScript CLI executable." + }, + "nativescript.iosTeamId": { + "type": "string", + "description": "The iOS development Team ID." } } }, diff --git a/src/debug-adapter/webKitDebugAdapter.ts b/src/debug-adapter/webKitDebugAdapter.ts index b9fb189..aed6d1f 100644 --- a/src/debug-adapter/webKitDebugAdapter.ts +++ b/src/debug-adapter/webKitDebugAdapter.ts @@ -158,6 +158,7 @@ export class WebKitDebugAdapter implements DebugProtocol.IDebugAdapter { if(selectedTeam) { // add the selected by the user Team Id tnsArgs = (tnsArgs || []).concat(['--teamId', selectedTeam.id]); + Services.logger().log(`[NSDebugAdapter] Using iOS Team ID '${selectedTeam.id}', you can change this in the workspace settings.\n`, Tags.FrontendMessage); } } } diff --git a/src/ipc/extensionServer.ts b/src/ipc/extensionServer.ts index 7ee5251..9482ca3 100644 --- a/src/ipc/extensionServer.ts +++ b/src/ipc/extensionServer.ts @@ -5,6 +5,7 @@ import * as crypto from 'crypto'; import * as vscode from 'vscode'; import * as extProtocol from './extensionProtocol'; import {Services} from '../services/extensionHostServices'; +import {QuickPickItem} from "vscode"; let ipc = require('node-ipc'); export class ExtensionServer { @@ -70,21 +71,37 @@ export class ExtensionServer { return Services.analyticsService().runRunCommand(args.platform); } - public selectTeam() : Promise<{ id: string, name: string }> { + public selectTeam(): Promise<{ id: string, name: string }> { return new Promise((resolve, reject) => { + const workspaceTeamId = vscode.workspace.getConfiguration().get("nativescript.iosTeamId"); + + if (workspaceTeamId) { + resolve({ + id: workspaceTeamId, + name: undefined // irrelevant + }); + return; + } + let developmentTeams = this.getDevelopmentTeams(); - if(developmentTeams.length > 1) { - let quickPickItems = developmentTeams.map((team) => { + if (developmentTeams.length > 1) { + let quickPickItems: Array = developmentTeams.map((team) => { return { label: team.name, description: team.id }; }); - vscode.window.showQuickPick(quickPickItems) - .then(val => resolve({ + vscode.window.showQuickPick( + quickPickItems, { + placeHolder: "Select your development team" + }) + .then((val: QuickPickItem) => { + vscode.workspace.getConfiguration().update("nativescript.iosTeamId", val.description); + resolve({ id: val.description, name: val.label - })); + }) + }); } else { resolve(); }