Skip to content

Commit 2ef7b8b

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

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

native-script.rb

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# coding: utf-8
2+
3+
puts "Installing Homebrew (a sudo password prompt may appear)."
4+
`ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"`
5+
6+
puts "Installing Homebrew-Cask (a sudo password prompt may appear)."
7+
`brew install caskroom/cask/brew-cask`
8+
9+
puts "Installing Java (a sudo password prompt may appear)."
10+
`brew cask install java`
11+
12+
puts "Creating NativeScript brew formula."
13+
File.open("/usr/local/Library/Formula/native-script.rb", "w:utf-8") do |f|
14+
f.write DATA.read
15+
end
16+
17+
puts "Installing NativeScript brew formula."
18+
`brew install native-script`
19+
20+
__END__
21+
22+
class NativeScript < Formula
23+
desc "NativeScript"
24+
homepage "https://www.nativescript.org"
25+
version "1.1.1"
26+
url "https://github.com/NativeScript/nativescript-cli/releases/download/v1.1.1/nativescript.tgz"
27+
sha256 "965f652b932acdbd780050d0760715c46a7fa4a621b40be02e348915244f2475"
28+
29+
depends_on :macos => :yosemite
30+
depends_on "pkg-config" => :build
31+
depends_on "node"
32+
depends_on "ant"
33+
depends_on "android-sdk"
34+
35+
def install
36+
ohai "Installing NativeScript."
37+
system "/usr/local/bin/npm install -g"
38+
39+
ohai "Installing Android SDK modules. This takes some time, please be patient."
40+
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"
41+
end
42+
end

0 commit comments

Comments
 (0)