Skip to content

Commit

Permalink
A script to setup a fresh Mac OS machine to develop with NativeScript
Browse files Browse the repository at this point in the history
Implements #625
  • Loading branch information
teobugslayer committed Sep 4, 2015
1 parent 96bc691 commit 57ac9fa
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
Empty file added setup/empty
Empty file.
Binary file added setup/empty.tar.gz
Binary file not shown.
61 changes: 61 additions & 0 deletions setup/native-script.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# 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."
`open 'macappstore://itunes.apple.com/us/app/xcode/id497799835'`

until `pkgutil --pkg-info=com.apple.pkg.Xcode`.include? "version" do
puts "Waiting for Xcode do finish installing..."
sleep(30)
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 xcodebuild -license`

# 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 Cocoapods. (You might need to provide your password.)"
`sudo gem install cocoapods`

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.3.0"
url "https://raw.githubusercontent.com/NativeScript/nativescript-cli/brew/setup/empty.tar.gz"
sha256 "813e1b809c094d29255191c14892a32a498e2ca298abbf5ce5cb4081faa4e88f"

depends_on :macos => :yosemite
depends_on "pkg-config" => :build
depends_on "node"
depends_on "ant"
depends_on "android-sdk"
depends_on "gradle"

def install
ohai "Installing NativeScript CLI."
system "/usr/local/bin/npm install -g nativescript"

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,extra-android-m2repository,extra-google-m2repository,extra-android-support --all --no-ui"

# export ANDROID_HOME=/usr/local/opt/android-sdk
end
end

0 comments on commit 57ac9fa

Please sign in to comment.