Skip to content

Commit 5890a8e

Browse files
blackdragonDimitar Kerezov
blackdragon
authored and
Dimitar Kerezov
committed
Add check for xcodeproj ruby gem in doctor service
This gem is required for creating xcsheme and merging xcconfig files with one another. iOS builds cannot be performed without it. Update system requirements and setup script accordingly.
1 parent db0ea50 commit 5890a8e

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ sudo ruby -e "$(curl -fsSL https://raw.githubusercontent.com/NativeScript/native
153153
* For iOS development
154154
* [Latest Xcode][12]
155155
* [Xcode command-line tools][12]
156+
* [xcodeproj ruby gem][13]
156157
* (Optional) [CocoaPods 0.38.2][CocoaPods 0.38.2]
157158
* For Android development
158159
* [JDK 8][JDK 8] or a later stable official release
@@ -601,6 +602,7 @@ This software is licensed under the Apache 2.0 license, quoted <a href="LICENSE"
601602
[10]: http://developer.telerik.com/featured/nativescript-android/
602603
[11]: http://blogs.telerik.com/valentinstoychev/posts.aspx/14-06-12/announcing-nativescript---cross-platform-framework-for-building-native-mobile-applications
603604
[12]: https://developer.apple.com/xcode/downloads/
605+
[13]: https://rubygems.org/gems/xcodeproj/versions/0.28.2
604606
[Chocolatey]: https://chocolatey.org/
605607
[JDK 8]: http://www.oracle.com/technetwork/java/javase/downloads/index.html
606608
[Android SDK 22]: http://developer.android.com/sdk/index.html

lib/services/doctor-service.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class DoctorService implements IDoctorService {
2020
private $hostInfo: IHostInfo,
2121
private $logger: ILogger,
2222
private $progressIndicator: IProgressIndicator,
23+
private $staticConfig: IStaticConfig,
2324
private $sysInfo: ISysInfo,
2425
private $childProcess: IChildProcess,
2526
private $config: IConfiguration,
@@ -32,7 +33,7 @@ class DoctorService implements IDoctorService {
3233
public printWarnings(configOptions?: { trackResult: boolean }): IFuture<boolean> {
3334
return (() => {
3435
let result = false;
35-
let sysInfo = this.$sysInfo.getSysInfo(path.join(__dirname, "..", "..", "package.json")).wait();
36+
let sysInfo = this.$sysInfo.getSysInfo(this.$staticConfig.pathToPackageJson).wait();
3637

3738
if (!sysInfo.adbVer) {
3839
this.$logger.warn("WARNING: adb from the Android SDK is not installed or is not configured properly.");
@@ -64,6 +65,13 @@ class DoctorService implements IDoctorService {
6465
result = true;
6566
}
6667

68+
if (!sysInfo.xcodeprojGemLocation) {
69+
this.$logger.warn("WARNING: xcodeproj gem is not installed or is not configured properly.");
70+
this.$logger.out("You will not be able to build your projects for iOS." + EOL
71+
+ "To be able to build for iOS and run apps in the native emulator, verify that you have installed xcodeproj." + EOL);
72+
result = true;
73+
}
74+
6775
if (!sysInfo.cocoapodVer) {
6876
this.$logger.warn("WARNING: CocoaPods is not installed or is not configured properly.");
6977
this.$logger.out("You will not be able to build your projects for iOS if they contain plugin with CocoaPod file." + EOL

setup/native-script.rb

+1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def install(program_name, message, script, run_as_root = false, show_all_option
108108

109109
# the -p flag is set in order to ensure zero status code even if the directory exists
110110
execute("mkdir -p ~/.cocoapods", "There was a problem in creating ~/.cocoapods directory")
111+
install("xcodeproj", "Installing xcodeproj... This might take some time, please, be patient.", 'gem install xcodeproj -V', true)
111112
install("CocoaPods", "Installing CocoaPods... This might take some time, please, be patient.", 'gem install cocoapods -V', true)
112113

113114
puts "Configuring your system for Android development... This might take some time, please, be patient."

0 commit comments

Comments
 (0)