Merge pull request #3886 from commitay/java-10

java_requirement, cask dsl caveats: java 10
This commit is contained in:
commitay 2018-03-21 09:00:24 +10:00 committed by GitHub
commit 540f1545c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -90,7 +90,7 @@ module Hbc
brew cask install java brew cask install java
EOS EOS
elsif java_version.include?("9") || java_version.include?("+") elsif java_version.include?("10") || java_version.include?("+")
<<~EOS <<~EOS
#{@cask} requires Java #{java_version}. You can install the latest version with #{@cask} requires Java #{java_version}. You can install the latest version with

View File

@ -5,10 +5,10 @@ class JavaRequirement < Requirement
end end
# A strict Java 8 requirement (1.8) should prompt the user to install # A strict Java 8 requirement (1.8) should prompt the user to install
# the legacy java8 cask because the current version, Java 9, is not # the legacy java8 cask because versions newer than Java 8 are not
# completely backwards compatible, and contains breaking changes such as # completely backwards compatible, and contain breaking changes such as
# strong encapsulation of JDK-internal APIs and a modified version scheme # strong encapsulation of JDK-internal APIs and a modified version scheme
# (9.0 not 1.9). # (*.0 not 1.*).
def cask def cask
if @version.nil? || @version.to_s.end_with?("+") || if @version.nil? || @version.to_s.end_with?("+") ||
@version.to_f >= JAVA_CASK_MAP.keys.max.to_f @version.to_f >= JAVA_CASK_MAP.keys.max.to_f
@ -22,7 +22,7 @@ class JavaRequirement < Requirement
JAVA_CASK_MAP = { JAVA_CASK_MAP = {
"1.8" => "caskroom/versions/java8", "1.8" => "caskroom/versions/java8",
"9.0" => "java", "10.0" => "java",
}.freeze }.freeze
def possible_javas def possible_javas