Skip to content

Commit 6321fa0

Browse files
committed
Mac setup improvements
- rewritten as pure Ruby script, no longer tries to be a brew formula - update installed node to 4 LTS
1 parent 9dcd3b4 commit 6321fa0

File tree

1 file changed

+10
-32
lines changed

1 file changed

+10
-32
lines changed

setup/native-script.rb

+10-32
Original file line numberDiff line numberDiff line change
@@ -43,40 +43,18 @@
4343
puts "Installing the Java SE Development Kit... This might take some time, please, be patient. (You might need to provide your password.)"
4444
system('brew cask install java')
4545
system('echo "export JAVA_HOME=$(/usr/libexec/java_home)" >> ~/.bash_profile')
46-
system('echo "export ANDROID_HOME=/usr/local/opt/android-sdk" >> ~/.bash_profile')
47-
48-
puts "Installing node.js 0.12"
49-
system('brew install homebrew/versions/node012')
50-
51-
puts "Creating Homebrew formula for NativeScript."
52-
File.open("/usr/local/Library/Formula/native-script.rb", "w:utf-8") do |f|
53-
f.write DATA.read
54-
end
5546

56-
puts "Installing NativeScript formula... This might take some time, please, be patient."
57-
system('brew install native-script')
58-
59-
__END__
60-
61-
class NativeScript < Formula
62-
desc "NativeScript"
63-
homepage "https://www.nativescript.org"
64-
version "1.3.0"
65-
url "https://raw.githubusercontent.com/NativeScript/nativescript-cli/brew/setup/empty.tar.gz"
66-
sha256 "813e1b809c094d29255191c14892a32a498e2ca298abbf5ce5cb4081faa4e88f"
47+
puts "Installing Android SDK"
48+
system('brew install android-sdk')
49+
system('echo "export ANDROID_HOME=/usr/local/opt/android-sdk" >> ~/.bash_profile')
6750

68-
depends_on :macos => :yosemite
69-
depends_on "pkg-config" => :build
70-
# depends_on "node" # currently we do not work with latest node, and we manually install 0.12 (see above)
71-
depends_on "android-sdk"
51+
puts "Configuring your system for Android development... This might take some time, please, be patient."
52+
system "echo yes | /usr/local/opt/android-sdk/tools/android update sdk --filter tools,platform-tools,android-23,build-tools-23.0.2,extra-android-m2repository --all --no-ui"
7253

73-
def install
74-
ohai "Installing NativeScript CLI..."
75-
system "/usr/local/bin/npm install -g nativescript"
54+
puts "Installing node.js 4"
55+
system('brew install homebrew/versions/node4-lts')
7656

77-
ohai "Configuring your system for Android development... This might take some time, please, be patient."
78-
system "echo yes | android update sdk --filter tools,platform-tools,android-23,build-tools-23.0.2,extra-android-m2repository --all --no-ui"
57+
puts "Installing NativeScript CLI..."
58+
system "/usr/local/bin/npm install -g nativescript"
7959

80-
ohai "The ANDROID_HOME and JAVA_HOME environment variables have been added to your .bash_profile. Restart the terminal to use them."
81-
end
82-
end
60+
puts "The ANDROID_HOME and JAVA_HOME environment variables have been added to your .bash_profile. Restart the terminal to use them."

0 commit comments

Comments
 (0)