Commit e8a54b50 authored by Ed Reel's avatar Ed Reel Committed by GitHub

Update android_studio from 3.5.3.0 to 4.1.2.0 (#5348)

* Update android_studio from 3.5.3.0 to 4.1.2.0

* Add self.remove section

* Prompt to delete config dirs
parent c332b8ae
......@@ -3,18 +3,18 @@ require 'package'
class Android_studio < Package
description 'Android Studio is the official IDE for Android development.'
homepage 'https://developer.android.com/studio'
version '3.5.3.0'
version '4.1.2.0'
compatibility 'x86_64'
case ARCH
when 'x86_64'
source_url 'https://dl.google.com/dl/android/studio/ide-zips/3.5.3.0/android-studio-ide-191.6010548-linux.tar.gz'
source_sha256 'af630d40f276b0d169c6ac8c7663a989f562b0ac48a1d3f0d720f5b6472355db'
source_url 'https://dl.google.com/dl/android/studio/ide-zips/4.1.2.0/android-studio-ide-201.7042882-linux.tar.gz'
source_sha256 '89f7c3a03ed928edeb7bbb1971284bcb72891a77b4f363557a7ad4ed37652bb9'
depends_on 'jdk8'
depends_on 'xdg_base'
depends_on 'sommelier'
end
def self.preinstall
def self.preflight
free_space = `echo $(($(stat -f --format="%a*%S" .)))`.chomp.to_i
abort 'Not enough free disk space. You need at least 6 GB to install.'.lightred if free_space < 6442450944
end
......@@ -26,11 +26,11 @@ class Android_studio < Package
FileUtils.cd(CREW_DEST_PREFIX + '/bin') do
FileUtils.ln_s(CREW_PREFIX + '/share/android-studio/bin/studio.sh', 'studio')
end
FileUtils.mkdir_p(CREW_DEST_PREFIX + '/.config/.AndroidStudio3.5')
FileUtils.mkdir_p(CREW_DEST_PREFIX + '/.config/.AndroidStudio4.1')
FileUtils.mkdir_p(CREW_DEST_PREFIX + '/.config/Android')
FileUtils.mkdir_p(CREW_DEST_HOME)
FileUtils.cd(CREW_DEST_HOME) do
FileUtils.ln_sf(CREW_PREFIX + '/.config/.AndroidStudio3.5/', '.AndroidStudio3.5')
FileUtils.ln_sf(CREW_PREFIX + '/.config/.AndroidStudio4.1/', '.AndroidStudio4.1')
FileUtils.ln_sf(CREW_PREFIX + '/.config/Android/', 'Android')
end
end
......@@ -39,11 +39,22 @@ class Android_studio < Package
puts
puts 'To start using Android Studio, type `studio`.'.lightblue
puts
puts 'To completely remove Android Studio, including the'.lightblue
puts 'settings, SDK and tools, execute the following:'.lightblue
puts 'crew remove android_studio'.lightblue
puts "rm -rf #{CREW_PREFIX}/.config/Android".lightblue
puts "rm -rf #{CREW_PREFIX}/.config/.AndroidStudio3.5".lightblue
puts
end
def self.remove
config_dirs = ["#{CREW_PREFIX}/.config/Android", "#{CREW_PREFIX}/.config/.AndroidStudio4.1"]
config_dirs.each { |config_dir|
if Dir.exists? config_dir
puts
print "Would you like to remove #{config_dir}? [y/N] "
case STDIN.getc
when "y", "Y"
FileUtils.rm_rf config_dir
puts "#{config_dir} removed.".lightred
else
puts "#{config_dir} saved.".lightgreen
end
end
}
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment