Skip to content

Mac setup improvements #1250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 27, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 11 additions & 33 deletions setup/native-script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,41 +42,19 @@

puts "Installing the Java SE Development Kit... This might take some time, please, be patient. (You might need to provide your password.)"
system('brew cask install java')
system('echo "export JAVA_HOME=$(/usr/libexec/java_home)" >> ~/.bash_profile')
system('echo "export ANDROID_HOME=/usr/local/opt/android-sdk" >> ~/.bash_profile')
system('echo "export JAVA_HOME=$(/usr/libexec/java_home)" >> ~/.profile')

puts "Installing node.js 0.12"
system('brew install homebrew/versions/node012')
puts "Installing Android SDK"
system('brew install android-sdk')
system('echo "export ANDROID_HOME=/usr/local/opt/android-sdk" >> ~/.profile')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so sad...
still, let's use the .profile file instead of sticking to the bash-specific .bash_profile :)


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... This might take some time, please, be patient."
system('brew install native-script')

__END__
puts "Configuring your system for Android development... This might take some time, please, be patient."
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"

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"
puts "Installing Node.js 4"
system('brew install homebrew/versions/node4-lts')

depends_on :macos => :yosemite
depends_on "pkg-config" => :build
# depends_on "node" # currently we do not work with latest node, and we manually install 0.12 (see above)
depends_on "android-sdk"
puts "Installing NativeScript CLI..."
system "/usr/local/bin/npm install -g nativescript"

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

ohai "Configuring your system for Android development... This might take some time, please, be patient."
system "echo yes | android update sdk --filter tools,platform-tools,android-23,build-tools-23.0.2,extra-android-m2repository --all --no-ui"

ohai "The ANDROID_HOME and JAVA_HOME environment variables have been added to your .bash_profile. Restart the terminal to use them."
end
end
puts "The ANDROID_HOME and JAVA_HOME environment variables have been added to your .profile. Restart the terminal to use them."