Skip to content

Commit 051663b

Browse files
committed
A script to setup a fresh Mac OS machine to develop with NativeScript
implements #625
1 parent ab28cfe commit 051663b

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

setup/empty

Whitespace-only changes.

setup/native-script.rb

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# coding: utf-8
2+
3+
# Only the user can manually download and install Xcode from AppStore
4+
puts "Installing Xcode... Please, click 'Get' or 'Update' to install Xcode from the App Store."
5+
`open 'macappstore://itunes.apple.com/us/app/xcode/id497799835'`
6+
7+
until `pkgutil --pkg-info=com.apple.pkg.Xcode`.include? "version" do
8+
puts "Waiting for Xcode do finish installing..."
9+
sleep(30)
10+
end
11+
12+
puts "You need to accept the Xcode license agreement to be able to use the compilers. (You might need to provide your password.)"
13+
`sudo gcc`
14+
15+
# Install all other dependencies
16+
puts "Installing Homebrew... (You might need to provide your password.)"
17+
`ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"`
18+
19+
puts "Installing Homebrew-Cask... (You might need to provide your password.)"
20+
`brew install caskroom/cask/brew-cask`
21+
22+
puts "Installing the Java SE Development Kit... (You might need to provide your password.)"
23+
`brew cask install java`
24+
25+
puts "Creating Homebrew formula for NativeScript..."
26+
File.open("/usr/local/Library/Formula/native-script.rb", "w:utf-8") do |f|
27+
f.write DATA.read
28+
end
29+
30+
puts "Installing NativeScript formula..."
31+
`brew install native-script`
32+
33+
__END__
34+
35+
class NativeScript < Formula
36+
desc "NativeScript"
37+
homepage "https://www.nativescript.org"
38+
version "1.1.1"
39+
url "https://raw.githubusercontent.com/NativeScript/nativescript-cli/brew/setup/empty"
40+
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
41+
42+
depends_on :macos => :yosemite
43+
depends_on "pkg-config" => :build
44+
depends_on "node"
45+
depends_on "ant"
46+
depends_on "android-sdk"
47+
48+
def install
49+
ohai "Installing NativeScript CLI..."
50+
system "/usr/local/bin/npm install -g"
51+
52+
ohai "Installing Android SDK packages. This might take some time, please, be patient."
53+
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"
54+
end
55+
end

0 commit comments

Comments
 (0)