Code review cleanups
This commit is contained in:
parent
5a214de68d
commit
c49b97dd9c
@ -4,11 +4,8 @@ class JavaRequirement < Requirement
|
||||
default_formula "jdk"
|
||||
|
||||
env do
|
||||
next unless @java_home
|
||||
env_java_common
|
||||
if (Pathname.new(@java_home)/"include").exist? # Oracle JVM
|
||||
env_oracle_jdk
|
||||
end
|
||||
env_oracle_jdk
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -3,12 +3,7 @@ class JavaRequirement
|
||||
|
||||
env do
|
||||
env_java_common
|
||||
java_home = Pathname.new(@java_home)
|
||||
if (java_home/"include").exist? # Oracle JVM
|
||||
env_oracle_jdk
|
||||
else # Apple JVM
|
||||
env_apple
|
||||
end
|
||||
env_oracle_jdk || env_apple
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -83,15 +83,19 @@ class JavaRequirement < Requirement
|
||||
end
|
||||
|
||||
def env_java_common
|
||||
return unless @java_home
|
||||
java_home = Pathname.new(@java_home)
|
||||
ENV["JAVA_HOME"] = java_home
|
||||
ENV.prepend_path "PATH", java_home/"bin"
|
||||
end
|
||||
|
||||
def env_oracle_jdk
|
||||
return unless @java_home
|
||||
java_home = Pathname.new(@java_home)
|
||||
return unless (java_home/"include").exist?
|
||||
ENV.append_to_cflags "-I#{java_home}/include"
|
||||
ENV.append_to_cflags "-I#{java_home}/include/#{oracle_java_os}"
|
||||
true
|
||||
end
|
||||
|
||||
def oracle_java_os
|
||||
|
Loading…
x
Reference in New Issue
Block a user