Skip to content

Merge release branch #259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Feb 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ You can install and run the NativeScript CLI on Windows or OS X.
> On Windows systems, you can develop, build, and deploy NativeScript projects that target Android.

* Windows Vista or later
* [Node.js 0.10.26] or a later stable official [0.10.x] release
* [Node.js 0.10.26] or a later stable official release
* (Optional) [Chocolatey]
* [JDK 6] or a later stable official release
* [Apache Ant 1.8] or a later stable official release
Expand Down Expand Up @@ -136,11 +136,12 @@ If you have installed Chocolatey, you can complete these steps to set up JDK, Ap
> On OS X systems, you can develop, build, and deploy NativeScript projects that target iOS and Android.

* OS X Mavericks
* [Node.js 0.10.26] or a later stable official [0.10.x] release
* [Node.js 0.10.26] or a later stable official release
* For iOS development
* [iOS 7.0 SDK][12] or a later stable official release
* [Xcode 5][12] or a later stable official release
* [Xcode command-line tools][12]
* (Optional) [Mono] installed via Homebrew
* For Android development
* [JDK 6] or a later stable official release
* [Apache Ant 1.8] or a later stable official release
Expand Down Expand Up @@ -470,4 +471,5 @@ This software is licensed under the Apache 2.0 license, quoted <a href="LICENSE"
[JDK 6]: http://www.oracle.com/technetwork/java/javase/downloads/index.html
[Apache Ant 1.8]: http://ant.apache.org/bindownload.cgi
[Android SDK 19]: http://developer.android.com/sdk/index.html
[Genymotion]: https://www.genymotion.com/#!/
[Genymotion]: https://www.genymotion.com/#!/
[Mono]: http://www.mono-project.com
4 changes: 4 additions & 0 deletions lib/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ import hostInfo = require("./common/host-info");
var knownOpts:any = {
"frameworkPath": String,
"copy-from": String,
"copyFrom": String,
"link-to": String,
"linkTo": String,
"release": Boolean,
"emulator": Boolean,
"symlink": Boolean,
"forDevice": Boolean,
"for-device": Boolean,
"keyStorePath": String,
"keyStorePassword": String,
"keyStoreAlias": String,
Expand Down
19 changes: 10 additions & 9 deletions lib/services/ios-project-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,26 +132,27 @@ class IOSProjectService implements IPlatformProjectService {
];
var args: string[] = [];

if(options.emulator) {
args = basicArgs.concat([
"-sdk", "iphonesimulator",
"-arch", "i386",
"VALID_ARCHS=\"i386\"",
"CONFIGURATION_BUILD_DIR=" + path.join(projectRoot, "build", "emulator")
]);
} else {
if(options.forDevice) {
args = basicArgs.concat([
"-xcconfig", path.join(projectRoot, this.$projectData.projectName, "build.xcconfig"),
"-sdk", "iphoneos",
'ARCHS=armv7 arm64',
'VALID_ARCHS=armv7 arm64',
"CONFIGURATION_BUILD_DIR=" + path.join(projectRoot, "build", "device")
]);
} else {
args = basicArgs.concat([
"-sdk", "iphonesimulator",
"-arch", "i386",
"VALID_ARCHS=\"i386\"",
"CONFIGURATION_BUILD_DIR=" + path.join(projectRoot, "build", "emulator")
]);

}

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

if(!options.emulator) {
if(options.forDevice) {
var buildOutputPath = path.join(projectRoot, "build", "device");

// Produce ipa file
Expand Down
12 changes: 8 additions & 4 deletions lib/services/platform-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export class PlatformService implements IPlatformService {

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

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

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

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

var cachedDeviceOption = options.forDevice;
options.forDevice = true;
this.buildPlatform(platform).wait();
options.forDevice = cachedDeviceOption;

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

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

var cachedDeviceOption = options.forDevice;
options.forDevice = true;
this.buildPlatform(platform).wait();
options.forDevice = cachedDeviceOption;

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

if(!options.availableDevices) {
var cachedEmulatorOption = options.emulator;
options.emulator = true;
this.buildPlatform(platform).wait();
options.emulator = cachedEmulatorOption;

var packageFile = this.getLatestApplicationPackageForEmulator(platformData).wait().packageName;
this.$logger.out("Using ", packageFile);
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nativescript",
"preferGlobal": true,
"version": "0.4.2",
"version": "0.9.0",
"author": "Telerik <support@telerik.com>",
"description": "Command-line interface for building NativeScript projects",
"bin": {
Expand Down Expand Up @@ -49,7 +49,7 @@
"prompt": "https://github.com/Icenium/prompt/tarball/master",
"properties-parser": "0.2.3",
"ref": "https://github.com/icenium/ref/tarball/master",
"ref-struct": "0.0.5",
"ref-struct": "https://github.com/telerik/ref-struct/tarball/master",
"rimraf": "2.2.6",
"semver": "3.0.1",
"shelljs": "0.3.0",
Expand Down Expand Up @@ -77,6 +77,6 @@
},
"license": "Apache-2.0",
"engines": {
"node": ">=0.10.26 <0.10.34 || >=0.10.35 <0.11.0"
"node": ">=0.10.26 <0.10.34 || >=0.10.35"
}
}
4 changes: 2 additions & 2 deletions resources/help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -278,15 +278,15 @@ Options:
--[build|ios]--

Usage:
$ tns build ios [--device] [--release]
$ tns build ios [--forDevice] [--release]

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

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

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

--[/]--
Expand Down