lib/ruboto/util/update.rb in ruboto-0.10.0 vs lib/ruboto/util/update.rb in ruboto-0.10.1

- old
+ new

@@ -1,6 +1,7 @@ require 'ruboto/version' +require 'ruboto/core_ext/rexml' module Ruboto module Util module Update include Build @@ -64,11 +65,11 @@ # else # test_manifest.add_element 'uses-permission', {"android:name" => "android.permission.WRITE_EXTERNAL_STORAGE"} # puts 'Added external permission tag' # end - File.open("AndroidManifest.xml", 'w') { |f| test_manifest.document.write(f, 4) } + File.open("AndroidManifest.xml", 'w') { |f| REXML::Formatters::OrderedAttributes.new(4).write(test_manifest.document, f) } run_tests_override = <<-EOF <!-- BEGIN added by Ruboto --> <macrodef name="run-tests-helper"> @@ -158,17 +159,15 @@ log_action("Removing #{jruby_core}") { File.delete *Dir.glob("libs/jruby-core-*.jar") } if jruby_core log_action("Removing #{jruby_stdlib}") { File.delete *Dir.glob("libs/jruby-stdlib-*.jar") } if jruby_stdlib log_action("Copying #{JRubyJars::core_jar_path} to libs") { copier.copy_from_absolute_path JRubyJars::core_jar_path, "libs" } log_action("Copying #{JRubyJars::stdlib_jar_path} to libs") { copier.copy_from_absolute_path JRubyJars::stdlib_jar_path, "libs" } - # FIXME(uwe): Try keeping the class count low to enable installation on Android 2.3 devices - # unless new_jruby_version =~ /^1.7.0/ && verify_target_sdk < 15 log_action("Copying dx.jar to libs") do copier.copy 'libs' + # FIXME(uwe): We may need this for newer Android SDK versions. Keeping as reminder. # File.open('project.properties', 'a'){|f| f << "dex.force.jumbo=true\n"} end - # end reconfigure_jruby_libs(new_jruby_version) puts "JRuby version is now: #{new_jruby_version}" true @@ -179,23 +178,19 @@ FileUtils.rm(Dir['libs/dexmaker*.jar']) # EMXIF jar_file = Dir.glob("libs/dx.jar")[0] - # FIXME(uwe): Skip copying dx.jar to apps using RubotoCore when we include dx.jar in RubotoCore + # FIXME(uwe): Remove when we stop updating from Ruboto 0.10.0 and older. + jruby_present = !!Dir.glob("libs/jruby-core-*.jar")[0] + log_action("Removing #{jar_file}") { File.delete jar_file } if jar_file && !jruby_present + # EMXIF + return if !jar_file && !force copier = AssetCopier.new Ruboto::ASSETS, File.expand_path(".") - # FIXME(uwe): Skip copying dx.jar to apps using RubotoCore when we include dx.jar in RubotoCore - log_action("Removing #{jar_file}") { File.delete jar_file } if jar_file - - # FIXME(uwe): Try keeping the class count low to enable installation on Android 2.3 devices - # FIXME(uwe): Skip copying dx.jar to apps using RubotoCore when we include dx.jar in RubotoCore - #if verify_target_sdk < 15 - # log_action("Copying dx.jar to libs") { copier.copy 'libs' } - #end - # EMXIF + log_action("Copying dx.jar to libs") { copier.copy 'libs' } end def update_assets puts "\nCopying files:" weak_copier = Ruboto::Util::AssetCopier.new Ruboto::ASSETS, '.', false @@ -360,11 +355,11 @@ Dir.chdir 'tmp' do FileUtils.move "../#{jruby_core}", "." `jar -xf #{jruby_core}` raise "Unpacking jruby-core jar failed: #$?" unless $? == 0 File.delete jruby_core - if Gem::Version.new(jruby_core_version) >= Gem::Version.new('1.7.1.dev') + if Gem::Version.new(jruby_core_version) >= Gem::Version.new('1.7.2.dev') excluded_core_packages = [ '**/*Darwin*', '**/*Ruby20*', '**/*Solaris*', '**/*windows*', @@ -402,9 +397,51 @@ 'org/jruby/org/bouncycastle', # TODO(uwe): Issue #154 Add back when we add jruby-openssl. The bouncycastle included in Android is cripled. # 'org/jruby/runtime/invokedynamic', # Should be excluded ] + elsif Gem::Version.new(jruby_core_version) >= Gem::Version.new('1.7.1.dev') + excluded_core_packages = [ + '**/*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', # Needed for initialization, but shoud not be necessary + # 'org/jruby/compiler/impl', # Needed for initialization, but shoud not be necessary + 'org/jruby/compiler/util', + 'org/jruby/demo', + 'org/jruby/embed/bsf', + 'org/jruby/embed/jsr223', + 'org/jruby/embed/osgi', + # 'org/jruby/ext/ffi', # Used by several JRuby core classes, but should not be needed unless we add FFI support + 'org/jruby/ext/ffi/io', + 'org/jruby/ext/ffi/jffi', + 'org/jruby/ext/openssl', # TODO(uwe): Issue #154 Add back when we add jruby-openssl. + 'org/jruby/javasupport/bsf', + + # 'org/jruby/management', # should be excluded + + 'org/jruby/org/bouncycastle', # TODO(uwe): Issue #154 Add back when we add jruby-openssl. The bouncycastle included in Android is cripled. + + # 'org/jruby/runtime/invokedynamic', # Should be excluded + ] 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 = [ '**/*Darwin*', '**/*Solaris*',