Commit 6a98049f authored by Ed Reel's avatar Ed Reel Committed by GitHub

Update flutter from 1.20.2 to 2.2.0 (#5805)

parent b3b80003
...@@ -3,32 +3,48 @@ require 'package' ...@@ -3,32 +3,48 @@ require 'package'
class Flutter < Package class Flutter < Package
description "Flutter is Google's UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase." description "Flutter is Google's UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase."
homepage 'https://flutter.dev/' homepage 'https://flutter.dev/'
version '1.20.2' version '2.2.0'
license 'BSD-3' license 'BSD-3'
compatibility 'all' compatibility 'all'
source_url 'https://github.com/flutter/flutter/archive/1.20.2.tar.gz' source_url 'https://github.com/flutter/flutter.git'
source_sha256 'b4086649d29f85d035ec38c27e383f8989382241331d2e352f12cc00a6b8c96b' git_hashtag version
depends_on 'libglu' depends_on 'libglu'
def self.build
system 'bin/flutter'
end
def self.install def self.install
system "git clone https://github.com/flutter/flutter.git -b #{version} --depth 1"
FileUtils.mkdir_p CREW_DEST_HOME FileUtils.mkdir_p CREW_DEST_HOME
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/bin" FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/bin"
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/share" FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/share/flutter"
FileUtils.cp_r 'flutter/', "#{CREW_DEST_PREFIX}/share" FileUtils.cp_r Dir['.'], "#{CREW_DEST_PREFIX}/share/flutter"
FileUtils.touch "#{CREW_DEST_HOME}/.flutter_tool_state" FileUtils.touch "#{CREW_DEST_HOME}/.flutter_tool_state"
FileUtils.ln_sf "#{CREW_PREFIX}/share/flutter/bin/dart", "#{CREW_DEST_PREFIX}/bin/dart" unless File.exist? "#{CREW_PREFIX}/bin/dart"
FileUtils.ln_sf "#{CREW_PREFIX}/share/flutter/bin/dart", "#{CREW_DEST_PREFIX}/bin/dart"
end
FileUtils.ln_sf "#{CREW_PREFIX}/share/flutter/bin/flutter", "#{CREW_DEST_PREFIX}/bin/flutter" FileUtils.ln_sf "#{CREW_PREFIX}/share/flutter/bin/flutter", "#{CREW_DEST_PREFIX}/bin/flutter"
end end
def self.postinstall def self.postinstall
puts puts "\nType 'flutter' to get started.\n".lightblue
puts "Type 'flutter' to get started.".lightblue end
puts
puts "To uninstall, execute the following:".lightblue def self.remove
puts "crew remove flutter".lightblue print "Would you like to remove the config directories? [y/N] "
puts "rm -rf #{CREW_PREFIX}/share/flutter".lightblue response = STDIN.getc
puts config_dirs = ["#{HOME}/.flutter", "#{CREW_PREFIX}/share/flutter"]
config_dirs.each { |config_dir|
if Dir.exists? config_dir
case response
when "y", "Y"
FileUtils.rm_rf config_dir
puts "#{config_dir} removed.".lightred
else
puts "#{config_dir} saved.".lightgreen
end
end
}
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