Skip to content

Add check for xcodeproj ruby gem in doctor service #1691

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 1 commit into from
Apr 18, 2016
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ sudo ruby -e "$(curl -fsSL https://raw.githubusercontent.com/NativeScript/native
* For iOS development
* [Latest Xcode][12]
* [Xcode command-line tools][12]
* [xcodeproj ruby gem][13]
* (Optional) [CocoaPods 0.38.2][CocoaPods 0.38.2]
* For Android development
* [JDK 8][JDK 8] or a later stable official release
Expand Down Expand Up @@ -601,6 +602,7 @@ This software is licensed under the Apache 2.0 license, quoted <a href="LICENSE"
[10]: http://developer.telerik.com/featured/nativescript-android/
[11]: http://blogs.telerik.com/valentinstoychev/posts.aspx/14-06-12/announcing-nativescript---cross-platform-framework-for-building-native-mobile-applications
[12]: https://developer.apple.com/xcode/downloads/
[13]: https://rubygems.org/gems/xcodeproj/versions/0.28.2
[Chocolatey]: https://chocolatey.org/
[JDK 8]: http://www.oracle.com/technetwork/java/javase/downloads/index.html
[Android SDK 22]: http://developer.android.com/sdk/index.html
Expand Down
2 changes: 1 addition & 1 deletion lib/common
10 changes: 9 additions & 1 deletion lib/services/doctor-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class DoctorService implements IDoctorService {
private $hostInfo: IHostInfo,
private $logger: ILogger,
private $progressIndicator: IProgressIndicator,
private $staticConfig: IStaticConfig,
private $sysInfo: ISysInfo,
private $childProcess: IChildProcess,
private $config: IConfiguration,
Expand All @@ -32,7 +33,7 @@ class DoctorService implements IDoctorService {
public printWarnings(configOptions?: { trackResult: boolean }): IFuture<boolean> {
return (() => {
let result = false;
let sysInfo = this.$sysInfo.getSysInfo(path.join(__dirname, "..", "..", "package.json")).wait();
let sysInfo = this.$sysInfo.getSysInfo(this.$staticConfig.pathToPackageJson).wait();

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

if (!sysInfo.xcodeprojGemLocation) {
this.$logger.warn("WARNING: xcodeproj gem is not installed or is not configured properly.");
this.$logger.out("You will not be able to build your projects for iOS." + EOL
+ "To be able to build for iOS and run apps in the native emulator, verify that you have installed xcodeproj." + EOL);
result = true;
}

if (!sysInfo.cocoapodVer) {
this.$logger.warn("WARNING: CocoaPods is not installed or is not configured properly.");
this.$logger.out("You will not be able to build your projects for iOS if they contain plugin with CocoaPod file." + EOL
Expand Down
1 change: 1 addition & 0 deletions setup/native-script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def install(program_name, message, script, run_as_root = false, show_all_option

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

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