Skip to content

Commit 5173e27

Browse files
committed
Merge remote-tracking branch 'origin/release'
2 parents aed850e + 3e7da41 commit 5173e27

File tree

8 files changed

+78
-44
lines changed

8 files changed

+78
-44
lines changed

.vscodeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
**/*.ts
22
**/*.map
3+
.vscode/**
34
node_modules/.bin/**
45
src/**
56
out/tests/**

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "nativescript",
3-
"version": "0.2.1",
4-
"minNativescriptCliVersion": "1.6",
3+
"version": "0.3.0",
4+
"minNativescriptCliVersion": "2.1",
55
"icon": "images/icon.png",
66
"displayName": "NativeScript",
77
"description": "NativeScript support for Visual Studio Code",
@@ -46,7 +46,7 @@
4646
"clean": "git clean -fdx",
4747
"build": "tsc -p ./src && cp ./src/services/analytics/EqatecMonitor.min.js ./out/services/analytics/EqatecMonitor.min.js",
4848
"package": "vsce package",
49-
"launch-as-server": "node --nolazy ./out/webkit/webKitDebug.js --server=4712",
49+
"launch-as-server": "node --nolazy ./out/debug-adapter/webKitDebug.js --server=4712",
5050
"test-mac": "mocha --opts ./src/tests/config/mocha.opts --config ../../src/tests/config/mac.json ./out/tests",
5151
"test-win": "mocha --opts ./src/tests/config/mocha.opts --config ../../src/tests/config/win.json ./out/tests",
5252
"test-custom": "mocha --opts ./src/tests/config/mocha.opts --config ../../src/tests/config/custom.json ./out/tests"
@@ -170,7 +170,7 @@
170170
"platform": "android",
171171
"request": "attach",
172172
"appRoot": "${workspaceRoot}",
173-
"sourceMaps": false,
173+
"sourceMaps": true,
174174
"diagnosticLogging": false,
175175
"emulator": false
176176
},
@@ -180,7 +180,7 @@
180180
"platform": "android",
181181
"request": "attach",
182182
"appRoot": "${workspaceRoot}",
183-
"sourceMaps": false,
183+
"sourceMaps": true,
184184
"diagnosticLogging": false,
185185
"emulator": true
186186
}

src/services/NsCliService.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ export abstract class NSProject extends EventEmitter {
9292
public abstract debug(args: IAttachRequestArgs | ILaunchRequestArgs): Promise<any>;
9393

9494
protected spawnProcess(commandPath: string, commandArgs: string[], tnsOutput?: string): ChildProcess {
95-
let child: ChildProcess = spawn(commandPath, commandArgs, { cwd: this.getProjectPath() });
95+
let options = { cwd: this.getProjectPath(), shell: true };
96+
let child: ChildProcess = spawn(commandPath, commandArgs, options);
9697
child.stdout.setEncoding('utf8');
9798
child.stderr.setEncoding('utf8');
9899
return child;

src/services/ipc/ExtensionClient.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import * as path from 'path';
2+
import * as os from 'os';
3+
import * as crypto from 'crypto';
24
import * as extProtocol from './ExtensionProtocol';
35
let ipc = require('node-ipc');
46

@@ -22,6 +24,11 @@ export class ExtensionClient {
2224
return this._appRoot;
2325
}
2426

27+
public static getTempFilePathForDirectory(directoryPath: string) {
28+
let fileName: string = 'vsc-ns-ext-' + crypto.createHash('md5').update(directoryPath).digest("hex") + '.sock';
29+
return path.join(os.tmpdir(), fileName);
30+
}
31+
2532
public static setAppRoot(appRoot: string) {
2633
this._appRoot = appRoot;
2734
}
@@ -40,7 +47,7 @@ export class ExtensionClient {
4047
this._ipcClientInitialized = new Promise((res, rej) => {
4148
ipc.connectTo(
4249
'extHost',
43-
path.join(ExtensionClient.getAppRoot(), 'temp-nativescript-vscode-extension-pipe-handle'),
50+
ExtensionClient.getTempFilePathForDirectory(ExtensionClient.getAppRoot()),
4451
() => {
4552
ipc.of.extHost.on('connect', () => {
4653
res();

src/services/ipc/ExtensionServer.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import * as path from 'path';
2+
import * as os from 'os';
3+
import * as crypto from 'crypto';
24
import * as fs from 'fs';
35
import * as vscode from 'vscode';
46
import * as extProtocol from './ExtensionProtocol';
@@ -17,13 +19,18 @@ export class ExtensionServer {
1719
return this._instance;
1820
}
1921

22+
public static getTempFilePathForDirectory(directoryPath: string) {
23+
let fileName: string = 'vsc-ns-ext-' + crypto.createHash('md5').update(directoryPath).digest("hex") + '.sock';
24+
return path.join(os.tmpdir(), fileName);
25+
}
26+
2027
constructor() {
2128
this._isRunning = false;
2229
}
2330

2431
public getPipeHandlePath(): string {
2532
return vscode.workspace.rootPath ?
26-
path.join(vscode.workspace.rootPath, 'temp-nativescript-vscode-extension-pipe-handle') :
33+
ExtensionServer.getTempFilePathForDirectory(vscode.workspace.rootPath) :
2734
null;
2835
}
2936

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
{
2-
"nativescript": {
3-
"id": "org.nativescript.DebuggerStatement",
4-
"tns-ios": {
5-
"version": "1.7.0"
6-
},
7-
"tns-android": {
8-
"version": "1.7.1"
9-
}
10-
},
11-
"dependencies": {
12-
"tns-core-modules": "1.7.1"
13-
}
2+
"nativescript": {
3+
"id": "org.nativescript.DebuggerStatement",
4+
"tns-ios": {
5+
"version": "2.1.0"
6+
},
7+
"tns-android": {
8+
"version": "2.1.1"
9+
}
10+
},
11+
"dependencies": {
12+
"tns-core-modules": "1.7.1"
13+
},
14+
"devDependencies": {
15+
"babel-traverse": "6.10.4",
16+
"babel-types": "6.11.1",
17+
"babylon": "6.8.2",
18+
"lazy": "1.0.11"
19+
}
1420
}
Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
{
2-
"nativescript": {
3-
"id": "org.nativescript.TestApp1",
4-
"tns-ios": {
5-
"version": "1.7.0"
6-
},
7-
"tns-android": {
8-
"version": "1.7.1"
9-
}
10-
},
11-
"dependencies": {
12-
"tns-core-modules": "1.7.1"
13-
}
2+
"nativescript": {
3+
"id": "org.nativescript.TestApp1",
4+
"tns-ios": {
5+
"version": "2.1.0"
6+
},
7+
"tns-android": {
8+
"version": "2.1.1"
9+
}
10+
},
11+
"dependencies": {
12+
"tns-core-modules": "1.7.1"
13+
},
14+
"devDependencies": {
15+
"babel-traverse": "6.10.4",
16+
"babel-types": "6.11.1",
17+
"babylon": "6.8.2",
18+
"lazy": "1.0.11"
19+
}
1420
}
Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
{
2-
"nativescript": {
3-
"id": "org.nativescript.TestApp2",
4-
"tns-ios": {
5-
"version": "1.7.0"
6-
},
7-
"tns-android": {
8-
"version": "1.7.1"
9-
}
10-
},
11-
"dependencies": {
12-
"tns-core-modules": "1.7.1"
13-
}
2+
"nativescript": {
3+
"id": "org.nativescript.TestApp2",
4+
"tns-ios": {
5+
"version": "2.1.0"
6+
},
7+
"tns-android": {
8+
"version": "2.1.1"
9+
}
10+
},
11+
"dependencies": {
12+
"tns-core-modules": "1.7.1"
13+
},
14+
"devDependencies": {
15+
"babel-traverse": "6.10.4",
16+
"babel-types": "6.11.1",
17+
"babylon": "6.8.2",
18+
"lazy": "1.0.11"
19+
}
1420
}

0 commit comments

Comments
 (0)