Skip to content
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

A script to setup a fresh Mac OS machine to develop with NativeScript #626

Merged
merged 1 commit into from
Sep 10, 2015

Conversation

teobugslayer
Copy link
Contributor

This script installs xcode, homebrew, brew cask, java jdk, node, npm, android sdk and ant and nativescript cli

Implements #625

@ligaz
Copy link

ligaz commented Jul 7, 2015

Isn't it better if we put such scripts in their own folder instead of the root?


def install
ohai "Installing NativeScript."
system "/usr/local/bin/npm install -g"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need the full path to npm here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. it is documented here that npm removes /usr/local/bin before calling my install callback.

You can easily verify this is the case. Make the formula incorrect, for example, remove the URL property. Try installing it with --debug --verbose. Brew complains and suggests to start a sub-shell. Accept it and observe the constructed path (echo $PATH).

@teobugslayer
Copy link
Contributor Author

About this script location - I think it may be a good idea to move it into NativeScript main repository. I created the PR here, to allow other people to check it. I need QA verification as well.

@teobugslayer teobugslayer added this to the 1.2.0 milestone Jul 7, 2015
@teobugslayer teobugslayer self-assigned this Jul 7, 2015
@@ -0,0 +1,42 @@
# coding: utf-8

puts "Installing Homebrew (a sudo password prompt may appear)."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installing Homebrew...
(You might need to provide your password.)

@teobugslayer teobugslayer force-pushed the brew branch 2 times, most recently from 03cfdc7 to d848247 Compare July 7, 2015 13:11
# coding: utf-8

# Only the user can manually download and install Xcode from AppStore
puts "Installing Xcode. Please click on 'Get Xcode' on the following dialog and install Xcode from AppStore."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installing Xcode... Please, click 'Get Xcode' in the dialog that will appear next and install Xcode from the App Store.

@teobugslayer
Copy link
Contributor Author

ping @ErjanGavalji

class NativeScript < Formula
desc "NativeScript"
homepage "https://www.nativescript.org"
version "1.1.1"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it better if we install it from the npm registry?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! I'll see how to implement it.

@teobugslayer teobugslayer force-pushed the brew branch 6 times, most recently from 051663b to 12a3d4a Compare July 24, 2015 16:15
end

puts "You need to accept the Xcode license agreement to be able to use the compilers. (You might need to provide your password.)"
`sudo gcc`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest using sudo xcodebuild -license instead.

@teobugslayer teobugslayer added this to the 1.4.0 milestone Aug 31, 2015
@teobugslayer teobugslayer removed this from the 1.3.0 milestone Aug 31, 2015
@teobugslayer
Copy link
Contributor Author

I should add installation of cocoapods and gradle, android sdk >= 21, build tools >= 22, android support library (same ver as compile sdk), javac, JAVA_HOME, ANDROID_HOME

@teobugslayer teobugslayer force-pushed the brew branch 6 times, most recently from 707a0c8 to 21ba5a1 Compare September 4, 2015 13:16
@teobugslayer
Copy link
Contributor Author

Ping @fealebenpae for the Mac configuration, @rosen-vladimirov for android configuration and @ikoevska for the messages.

@ns-bot
Copy link

ns-bot commented Sep 4, 2015

# coding: utf-8

# Only the user can manually download and install Xcode from AppStore
puts "Installing Xcode... Please, click 'Get' or 'Update' to install Xcode from the App Store."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does "Launching Xcode install... Please, click..." sound better?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are opening the AppStore to let the user install Xcode. We are not launching the Xcode installer, per se. The message was suggested by @ikoevska and I think it is appropriate in our case.

`open 'macappstore://itunes.apple.com/us/app/xcode/id497799835'`

until `xcodebuild -version`.include? "version" do
puts "Waiting for Xcode do finish installing..."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TO finish installing

@ikoevska
Copy link
Contributor

ikoevska commented Sep 8, 2015

👍 for the messages

@ns-bot
Copy link

ns-bot commented Sep 8, 2015

1 similar comment
@ns-bot
Copy link

ns-bot commented Sep 8, 2015

ohai "Configuring your system for Android development... This might take some time, please, be patient."
system "echo yes | android update sdk --filter tools,platform-tools,android-22,android-17,build-tools-22.0.1,sys-img-x86-android-22,extra-android-m2repository,extra-google-m2repository,extra-android-support --all --no-ui"

ohai "The ANDROID_HOME and JAVA_HOME environment variables have been added to your .bash_profile. Restart the terminal to use them."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can call "source ~/.bash_profile" and there will be no need to restart the terminal

@rosen-vladimirov
Copy link
Contributor

👍

teobugslayer added a commit that referenced this pull request Sep 10, 2015
A script to setup a fresh Mac OS machine to develop with NativeScript
@teobugslayer teobugslayer merged commit 4027186 into master Sep 10, 2015
@teobugslayer teobugslayer deleted the brew branch October 2, 2015 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants