-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A script to setup a fresh Mac OS machine to develop with NativeScript
implements #625
- Loading branch information
1 parent
ab28cfe
commit 1840741
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# coding: utf-8 | ||
|
||
# Only the user can manually download and install Xcode from AppStore | ||
puts "Installing Xcode... Please, click 'Get Xcode' in the dialog that will appear next and install Xcode from the App Store." | ||
`xcode-select --install` | ||
|
||
until `pkgutil --pkg-info=com.apple.pkg.Xcode`.include? "version" do | ||
puts "Waiting for Xcode do finish installing..." | ||
sleep(20) | ||
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` | ||
|
||
# Install all other dependencies | ||
puts "Installing Homebrew... (You might need to provide your password.)" | ||
`ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"` | ||
|
||
puts "Installing Homebrew-Cask... (You might need to provide your password.)" | ||
`brew install caskroom/cask/brew-cask` | ||
|
||
puts "Installing the Java SE Development Kit... (You might need to provide your password.)" | ||
`brew cask install java` | ||
|
||
puts "Creating Homebrew formula for NativeScript..." | ||
File.open("/usr/local/Library/Formula/native-script.rb", "w:utf-8") do |f| | ||
f.write DATA.read | ||
end | ||
|
||
puts "Installing NativeScript formula..." | ||
`brew install native-script` | ||
|
||
__END__ | ||
|
||
class NativeScript < Formula | ||
desc "NativeScript" | ||
homepage "https://www.nativescript.org" | ||
version "1.1.1" | ||
url "https://raw.githubusercontent.com/NativeScript/nativescript-cli/brew/setup/empty" | ||
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" | ||
|
||
depends_on :macos => :yosemite | ||
depends_on "pkg-config" => :build | ||
depends_on "node" | ||
depends_on "ant" | ||
depends_on "android-sdk" | ||
|
||
def install | ||
ohai "Installing NativeScript CLI..." | ||
system "/usr/local/bin/npm install -g" | ||
|
||
ohai "Installing Android SDK packages. 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 --all --no-ui" | ||
end | ||
end |