lib/ruboto/util/update.rb in ruboto-0.11.0 vs lib/ruboto/util/update.rb in ruboto-0.12.0.rc.0
- old
+ new
@@ -1,13 +1,15 @@
require 'ruboto/version'
require 'ruboto/core_ext/rexml'
+require 'ruboto/sdk_locations'
module Ruboto
module Util
module Update
include Build
include Ruboto::SdkVersions
+ include Ruboto::SdkLocations
###########################################################################
#
# Updating components
#
@@ -424,15 +426,10 @@
excluded_core_packages = %w(**/*Darwin* **/*Ruby20* **/*Solaris* **/*windows* **/*Windows* META-INF com/headius com/kenai/constantine com/kenai/jffi com/martiansoftware jline jni jnr/constants/platform/darwin jnr/constants/platform/fake jnr/constants/platform/freebsd jnr/constants/platform/openbsd jnr/constants/platform/sunos jnr/ffi/annotations jnr/ffi/byref jnr/ffi/provider jnr/ffi/util jnr/ffi/Struct$* jnr/ffi/types jnr/posix/MacOS* jnr/posix/OpenBSD* org/apache org/fusesource org/jruby/ant org/jruby/cext org/jruby/compiler/util org/jruby/demo org/jruby/embed/bsf org/jruby/embed/jsr223 org/jruby/embed/osgi org/jruby/ext/ffi/io org/jruby/ext/ffi/jffi org/jruby/ext/openssl org/jruby/javasupport/bsf org/jruby/org/bouncycastle)
elsif Gem::Version.new(jruby_core_version) >= Gem::Version.new('1.7.0')
# TODO(uwe): Remove when we stop supporting jruby-jars 1.7.0
excluded_core_packages = %w(**/*Darwin* **/*Solaris* **/*windows* **/*Windows* META-INF com/headius com/kenai/constantine com/kenai/jffi com/martiansoftware jline jni jnr/constants/platform/darwin jnr/constants/platform/fake jnr/constants/platform/freebsd jnr/constants/platform/openbsd jnr/constants/platform/sunos jnr/ffi/annotations jnr/ffi/byref jnr/ffi/provider jnr/ffi/util jnr/ffi/Struct$* jnr/ffi/types jnr/posix/MacOS* jnr/posix/OpenBSD* org/apache org/bouncycastle org/fusesource org/jruby/ant org/jruby/cext org/jruby/compiler/util org/jruby/demo org/jruby/embed/bsf org/jruby/embed/jsr223 org/jruby/embed/osgi org/jruby/ext/ffi/io org/jruby/ext/ffi/jffi org/jruby/ext/openssl org/jruby/javasupport/bsf)
# ODOT
- elsif Gem::Version.new(jruby_core_version) >= Gem::Version.new('1.6.0')
- # TODO(uwe): Remove when we stop supporting jruby-jars 1.6.x
- print 'Retaining com.kenai.constantine and removing jnr for JRuby 1.6.x...'
- excluded_core_packages = %w(META-INF cext com/kenai/jffi com/martiansoftware ext java jline jni jnr jnr/constants/platform/darwin jnr/constants/platform/fake jnr/constants/platform/freebsd jnr/constants/platform/openbsd jnr/constants/platform/sunos jnr/constants/platform/windows jnr/ffi/annotations jnr/ffi/byref jnr/ffi/provider jnr/ffi/util jnr/netdb jnr/ffi/posix/util org/apache org/jruby/ant org/jruby/compiler/ir org/jruby/compiler/util org/jruby/demo org/jruby/embed/bsf org/jruby/embed/jsr223 org/jruby/embed/osgi org/jruby/ext/ffi org/jruby/javasupport/bsf org/jruby/runtime/invokedynamic)
- # ODOT
else
raise "Unsupported JRuby version: #{jruby_core_version.inspect}."
end
excluded_core_packages.each do |i|
@@ -464,15 +461,15 @@
# `jar -cf ../jruby-core-#{dir.gsub('/', '.')}-#{jruby_core_version}.jar #{dir}`
# FileUtils.rm_rf dir
#end
# Add our proxy class factory
- android_jar = Dir["#{Ruboto::SdkVersions::ANDROID_HOME}/platforms/*/android.jar"][0]
+ android_jar = Dir["#{ANDROID_HOME}/platforms/*/android.jar"][0]
unless android_jar
puts
puts '*' * 80
- puts " Could not find any Android platforms in #{Ruboto::SdkVersions::ANDROID_HOME}/platforms."
+ puts " Could not find any Android platforms in #{ANDROID_HOME}/platforms."
puts ' At least one Android Platform SDK must be installed to compile the Ruboto classes.'
puts ' Please install an Android Platform SDK using the "android" package manager.'
puts '*' * 80
puts
exit 1
@@ -512,21 +509,17 @@
raise "Unrecognized JRuby stdlib jar: #{jruby_stdlib}" unless jruby_stdlib =~ /jruby-stdlib-(.*).jar/
jruby_stdlib_version = Gem::Version.new($1)
if included_stdlibs
+ lib_dirs = %w(1.8 1.9 2.0 shared)
- # TODO(uwe): Simplify when we stop supporting JRuby < 1.7.0
- if jruby_stdlib_version < Gem::Version.new('1.7.0.preview1')
- lib_dirs = %w(1.8 1.9 site_ruby/1.8 site_ruby/1.9 site_ruby/shared)
- else
- lib_dirs = %w(1.8 1.9 shared)
- end
- # ODOT
+ # FIXME(uwe): Remove when we stop testing JRuby < 1.7.4.dev
+ lib_dirs.delete('2.0') if jruby_stdlib_version < Gem::Version.new('1.7.4.dev')
+ # EMXIF
print 'excluded...'
-
lib_dirs.each do |ld|
Dir.chdir "new/jruby.home/lib/ruby/#{ld}" do
libs = Dir['*'].map{|d|d.sub /\.(rb|jar)$/, ''}.uniq
libs.each do |d|
next if included_stdlibs.include? d
@@ -540,19 +533,13 @@
end
end
end
if excluded_stdlibs.any?
-
- # TODO(uwe): Simplify when we stop supporting JRuby < 1.7.0
- if jruby_stdlib_version < Gem::Version.new('1.7.0.preview1')
- lib_dirs = %w(1.8 1.9 site_ruby/1.8 site_ruby/1.9 site_ruby/shared)
- else
- lib_dirs = %w(1.8 1.9 shared)
- end
- # ODOT
-
- lib_dirs.each do |ld|
+ %w(1.8 1.9 2.0 shared).each do |ld|
+ # FIXME(uwe): Remove when we stop testing JRuby < 1.7.4.dev
+ next if ld == '2.0' && jruby_stdlib_version < Gem::Version.new('1.7.4.dev')
+ # EMXIF
excluded_stdlibs.each do |d|
dir = "new/jruby.home/lib/ruby/#{ld}/#{d}"
FileUtils.rm_rf dir if File.exists? dir
file = "#{dir}.rb"
FileUtils.rm_rf file if File.exists? file