Skip to content

Commit b7e67aa

Browse files
FatmeFatme
Fatme
authored and
Fatme
committed
Merge pull request #259 from NativeScript/fatme/merge-release
Merge release branch
2 parents 32dfc7b + 500c463 commit b7e67aa

File tree

6 files changed

+32
-21
lines changed

6 files changed

+32
-21
lines changed

README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ You can install and run the NativeScript CLI on Windows or OS X.
6767
> On Windows systems, you can develop, build, and deploy NativeScript projects that target Android.
6868
6969
* Windows Vista or later
70-
* [Node.js 0.10.26] or a later stable official [0.10.x] release
70+
* [Node.js 0.10.26] or a later stable official release
7171
* (Optional) [Chocolatey]
7272
* [JDK 6] or a later stable official release
7373
* [Apache Ant 1.8] or a later stable official release
@@ -136,11 +136,12 @@ If you have installed Chocolatey, you can complete these steps to set up JDK, Ap
136136
> On OS X systems, you can develop, build, and deploy NativeScript projects that target iOS and Android.
137137
138138
* OS X Mavericks
139-
* [Node.js 0.10.26] or a later stable official [0.10.x] release
139+
* [Node.js 0.10.26] or a later stable official release
140140
* For iOS development
141141
* [iOS 7.0 SDK][12] or a later stable official release
142142
* [Xcode 5][12] or a later stable official release
143143
* [Xcode command-line tools][12]
144+
* (Optional) [Mono] installed via Homebrew
144145
* For Android development
145146
* [JDK 6] or a later stable official release
146147
* [Apache Ant 1.8] or a later stable official release
@@ -470,4 +471,5 @@ This software is licensed under the Apache 2.0 license, quoted <a href="LICENSE"
470471
[JDK 6]: http://www.oracle.com/technetwork/java/javase/downloads/index.html
471472
[Apache Ant 1.8]: http://ant.apache.org/bindownload.cgi
472473
[Android SDK 19]: http://developer.android.com/sdk/index.html
473-
[Genymotion]: https://www.genymotion.com/#!/
474+
[Genymotion]: https://www.genymotion.com/#!/
475+
[Mono]: http://www.mono-project.com

lib/options.ts

+4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ import hostInfo = require("./common/host-info");
99
var knownOpts:any = {
1010
"frameworkPath": String,
1111
"copy-from": String,
12+
"copyFrom": String,
1213
"link-to": String,
14+
"linkTo": String,
1315
"release": Boolean,
1416
"emulator": Boolean,
1517
"symlink": Boolean,
18+
"forDevice": Boolean,
19+
"for-device": Boolean,
1620
"keyStorePath": String,
1721
"keyStorePassword": String,
1822
"keyStoreAlias": String,

lib/services/ios-project-service.ts

+10-9
Original file line numberDiff line numberDiff line change
@@ -132,26 +132,27 @@ class IOSProjectService implements IPlatformProjectService {
132132
];
133133
var args: string[] = [];
134134

135-
if(options.emulator) {
136-
args = basicArgs.concat([
137-
"-sdk", "iphonesimulator",
138-
"-arch", "i386",
139-
"VALID_ARCHS=\"i386\"",
140-
"CONFIGURATION_BUILD_DIR=" + path.join(projectRoot, "build", "emulator")
141-
]);
142-
} else {
135+
if(options.forDevice) {
143136
args = basicArgs.concat([
144137
"-xcconfig", path.join(projectRoot, this.$projectData.projectName, "build.xcconfig"),
145138
"-sdk", "iphoneos",
146139
'ARCHS=armv7 arm64',
147140
'VALID_ARCHS=armv7 arm64',
148141
"CONFIGURATION_BUILD_DIR=" + path.join(projectRoot, "build", "device")
149142
]);
143+
} else {
144+
args = basicArgs.concat([
145+
"-sdk", "iphonesimulator",
146+
"-arch", "i386",
147+
"VALID_ARCHS=\"i386\"",
148+
"CONFIGURATION_BUILD_DIR=" + path.join(projectRoot, "build", "emulator")
149+
]);
150+
150151
}
151152

152153
this.$childProcess.spawnFromEvent("xcodebuild", args, "exit", {cwd: options, stdio: 'inherit'}).wait();
153154

154-
if(!options.emulator) {
155+
if(options.forDevice) {
155156
var buildOutputPath = path.join(projectRoot, "build", "device");
156157

157158
// Produce ipa file

lib/services/platform-service.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export class PlatformService implements IPlatformService {
7474

7575
var downloadedPackagePath = this.$npm.install(packageToInstall, npmOptions).wait();
7676
var frameworkDir = path.join(downloadedPackagePath, constants.PROJECT_FRAMEWORK_FOLDER_NAME);
77+
frameworkDir = path.resolve(frameworkDir);
7778

7879
try {
7980
this.addPlatformCore(platformData, frameworkDir).wait();
@@ -92,7 +93,7 @@ export class PlatformService implements IPlatformService {
9293
platformData.platformProjectService.createProject(platformData.projectRoot, frameworkDir).wait();
9394
var installedVersion = this.$fs.readJson(path.join(frameworkDir, "../", "package.json")).wait().version;
9495

95-
if(options.frameworkPath && !options.symlink) {
96+
if(options.frameworkPath && this.$fs.getFsStats(options.frameworkPath).wait().isFile() && !options.symlink) {
9697
// Need to remove unneeded node_modules folder
9798
// One level up is the runtime module and one above is the node_modules folder.
9899
this.$fs.deleteDirectory(path.join(frameworkDir, "../../")).wait();
@@ -217,7 +218,10 @@ export class PlatformService implements IPlatformService {
217218

218219
var platformData = this.$platformsData.getPlatformData(platform);
219220

221+
var cachedDeviceOption = options.forDevice;
222+
options.forDevice = true;
220223
this.buildPlatform(platform).wait();
224+
options.forDevice = cachedDeviceOption;
221225

222226
packageFile = this.getLatestApplicationPackageForDevice(platformData).wait().packageName;
223227
this.$logger.out("Using ", packageFile);
@@ -261,7 +265,10 @@ export class PlatformService implements IPlatformService {
261265

262266
var platformData = this.$platformsData.getPlatformData(platform);
263267

268+
var cachedDeviceOption = options.forDevice;
269+
options.forDevice = true;
264270
this.buildPlatform(platform).wait();
271+
options.forDevice = cachedDeviceOption;
265272

266273
// Get latest package that is produced from build
267274
var packageFile = this.getLatestApplicationPackageForDevice(platformData).wait().packageName;
@@ -286,10 +293,7 @@ export class PlatformService implements IPlatformService {
286293
emulatorServices.checkDependencies().wait();
287294

288295
if(!options.availableDevices) {
289-
var cachedEmulatorOption = options.emulator;
290-
options.emulator = true;
291296
this.buildPlatform(platform).wait();
292-
options.emulator = cachedEmulatorOption;
293297

294298
var packageFile = this.getLatestApplicationPackageForEmulator(platformData).wait().packageName;
295299
this.$logger.out("Using ", packageFile);

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "nativescript",
33
"preferGlobal": true,
4-
"version": "0.4.2",
4+
"version": "0.9.0",
55
"author": "Telerik <[email protected]>",
66
"description": "Command-line interface for building NativeScript projects",
77
"bin": {
@@ -49,7 +49,7 @@
4949
"prompt": "https://github.com/Icenium/prompt/tarball/master",
5050
"properties-parser": "0.2.3",
5151
"ref": "https://github.com/icenium/ref/tarball/master",
52-
"ref-struct": "0.0.5",
52+
"ref-struct": "https://github.com/telerik/ref-struct/tarball/master",
5353
"rimraf": "2.2.6",
5454
"semver": "3.0.1",
5555
"shelljs": "0.3.0",
@@ -77,6 +77,6 @@
7777
},
7878
"license": "Apache-2.0",
7979
"engines": {
80-
"node": ">=0.10.26 <0.10.34 || >=0.10.35 <0.11.0"
80+
"node": ">=0.10.26 <0.10.34 || >=0.10.35"
8181
}
8282
}

resources/help.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -278,15 +278,15 @@ Options:
278278
--[build|ios]--
279279

280280
Usage:
281-
$ tns build ios [--device] [--release]
281+
$ tns build ios [--forDevice] [--release]
282282

283283
Builds the project for iOS and produces an APP or IPA that you can manually deploy in the iOS Simulator or on device, respectively.
284284

285285
Before building for iOS device, verify that you have configured a valid pair of certificate and provisioning profile on your OS X system.
286286

287287
Options:
288288
--release - If set, produces a release build. Otherwise, produces a debug build.
289-
--device - If set, produces an application package that you can deploy on device.
289+
--forDevice - If set, produces an application package that you can deploy on device.
290290
Otherwise, produces a build that you can run only in the native iOS Simulator.
291291

292292
--[/]--

0 commit comments

Comments
 (0)