-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Conversation
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" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
).
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. |
@@ -0,0 +1,42 @@ | |||
# coding: utf-8 | |||
|
|||
puts "Installing Homebrew (a sudo password prompt may appear)." |
There was a problem hiding this comment.
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.)
03cfdc7
to
d848247
Compare
# 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." |
There was a problem hiding this comment.
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.
ping @ErjanGavalji |
class NativeScript < Formula | ||
desc "NativeScript" | ||
homepage "https://www.nativescript.org" | ||
version "1.1.1" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
051663b
to
12a3d4a
Compare
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` |
There was a problem hiding this comment.
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.
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 |
707a0c8
to
21ba5a1
Compare
Ping @fealebenpae for the Mac configuration, @rosen-vladimirov for android configuration and @ikoevska for the messages. |
✅ |
# 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." |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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..." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TO finish installing
👍 for the messages |
✅ |
1 similar comment
✅ |
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." |
There was a problem hiding this comment.
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
👍 |
A script to setup a fresh Mac OS machine to develop with NativeScript
This script installs xcode, homebrew, brew cask, java jdk, node, npm, android sdk and ant and nativescript cli
Implements #625