You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by as...@apache.org on 2008/02/17 12:42:28 UTC

svn commit: r628477 - in /incubator/buildr/trunk: doc/pages/contributing.textile lib/java/ant.rb lib/java/jruby.rb

Author: assaf
Date: Sun Feb 17 03:42:24 2008
New Revision: 628477

URL: http://svn.apache.org/viewvc?rev=628477&view=rev
Log:
Removed JRuby hacks now that RC2 is out

Modified:
    incubator/buildr/trunk/doc/pages/contributing.textile
    incubator/buildr/trunk/lib/java/ant.rb
    incubator/buildr/trunk/lib/java/jruby.rb

Modified: incubator/buildr/trunk/doc/pages/contributing.textile
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/doc/pages/contributing.textile?rev=628477&r1=628476&r2=628477&view=diff
==============================================================================
--- incubator/buildr/trunk/doc/pages/contributing.textile (original)
+++ incubator/buildr/trunk/doc/pages/contributing.textile Sun Feb 17 03:42:24 2008
@@ -165,9 +165,9 @@
 
 *"Matthieu Riou":http://offthelip.org*
 
-*Victor Hugo Borja* (vborja at apache.org)	
-Currently a Java Developer at http://jwmsolutions.com, Victor has been enjoying
-and using Apache's software since 1999 when he started with Java, now he prefers
-programming Ruby and is happy to help on Apache's first ruby project. 
-
+*Victor Hugo Borja* (vborja at apache.org)
 
+Currently a Java Developer at
+"http://jwmsolutions.com":http://jwmsolutions.com, Victor has been enjoying and
+using Apache's software since 1999 when he started with Java, now he prefers
+programming Ruby and is happy to help on Apache's first ruby project. 

Modified: incubator/buildr/trunk/lib/java/ant.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/java/ant.rb?rev=628477&r1=628476&r2=628477&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/java/ant.rb (original)
+++ incubator/buildr/trunk/lib/java/ant.rb Sun Feb 17 03:42:24 2008
@@ -33,7 +33,7 @@
       options = { :name=>name, :basedir=>Dir.pwd, :declarative=>true }
       options.merge!(:logger=> Logger.new(STDOUT), :loglevel=> Logger::DEBUG) if Rake.application.options.trace
       Java.load
-      AntProject.new(options).tap do |project|
+      Antwrap::AntProject.new(options).tap do |project|
         # Set Ant logging level to debug (--trace), info (default) or error only (--quiet).
         project.project.getBuildListeners().get(0).
           setMessageOutputLevel((Rake.application.options.trace && 4) || (verbose && 2) || 0)

Modified: incubator/buildr/trunk/lib/java/jruby.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/java/jruby.rb?rev=628477&r1=628476&r2=628477&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/java/jruby.rb (original)
+++ incubator/buildr/trunk/lib/java/jruby.rb Sun Feb 17 03:42:24 2008
@@ -78,96 +78,6 @@
       self
     end
 
-=begin
-    def load_java_tools
-      home = ENV['JAVA_HOME'] or fail 'Are we forgetting something? JAVA_HOME not set.'
-      tools = File.expand_path('lib/tools.jar', home)
-      raise "Missing #{tools}, perhaps your JAVA_HOME is not correclty set" unless File.file?(tools)
-      loader = JRuby.runtime.get_jruby_class_loader
-      loader.add_url(java.io.File.new(tools).toURL)
-    end
-=end
-
-  end
-
-end
-
-
-module FileUtils
-  def touch(list, options = {})
-    fu_check_options options, OPT_TABLE['touch']
-    list = fu_list(list)
-    created = nocreate = options[:nocreate]
-    t = options[:mtime]
-    if options[:verbose]
-      fu_output_message "touch #{nocreate ? ' -c' : ''}#{t ? t.strftime(' -t %Y%m%d%H%M.%S') : ''}#{list.join ' '}"
-    end
-    t ||= Time.now # Otherwise JRuby breaks, and not in a nice way.
-    return if options[:noop]
-    list.each do |path|
-      created = nocreate
-      begin
-        File.utime(t, t, path)
-      rescue Errno::ENOENT
-        raise if created
-        File.open(path, 'a') {
-          ;
-        }
-        created = true
-        retry if t
-      end
-    end
   end
-  module_function :touch
-end
-
 
-# Misnamed in RC1, but fixed before 1.1.
-class IO #:nodoc:
-  alias :isatty :isatty?
-end unless IO.public_instance_methods.include?('isatty')
-
-
-module Buildr
-  class ZipTask
-    # RubyZip doesn't work on JRuby, so we'll use java.util.zip instead.
-    def create_from(file_map) #:nodoc:
-      out = Java.java.io.FileOutputStream.new(name)
-      zip = Java.java.util.zip.ZipOutputStream.new(out)
-      begin
-        zip.setLevel compression_level
-
-        seen = {}
-        mkpath = lambda do |dir|
-          unless dir == '.' || seen[dir]
-            mkpath.call File.dirname(dir)
-            zip.putNextEntry(Java.java.util.zip.ZipEntry.new(dir + '/'))
-            seen[dir] = true
-          end
-        end
-
-        mkpath.call '' if file_map.empty?
-        file_map.each do |path, content|
-          mkpath.call File.dirname(path)
-          if content.nil? || File.directory?(content.to_s)
-            mkpath.call path
-          else
-            if content.respond_to?(:call)
-              io = StringIO.new
-              content.call io
-              data = io.string.to_java_bytes
-            else
-              data = File.read(content.to_s).to_java_bytes
-            end
-            entry = Java.java.util.zip.ZipEntry.new(path)
-            entry.setSize(data.length)
-            zip.putNextEntry(entry)
-            zip.write data
-          end
-        end
-      ensure
-        zip.close
-      end
-    end
-  end
 end