Skip to content

Commit 5ef66cb

Browse files
committed
A script to setup a fresh Mac OS machine to develop with NativeScript
implements #625
1 parent 7ede70f commit 5ef66cb

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

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 Xcode' in the dialog that will appear next and install Xcode from the App Store."
5+
`xcode-select --install`
6+
7+
until `pkgutil --pkg-info=com.apple.pkg.Xcode`.include? "version" do
8+
puts "Waiting for Xcode do finish installing..."
9+
sleep(20)
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://github.com/NativeScript/nativescript-cli/releases/download/v1.1.1/nativescript.tgz"
40+
sha256 "965f652b932acdbd780050d0760715c46a7fa4a621b40be02e348915244f2475"
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)