You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by bo...@apache.org on 2010/03/05 06:48:51 UTC
svn commit: r919303 [1/3] - in /buildr/trunk: addon/buildr/ doc/scripts/
lib/buildr/ lib/buildr/core/ lib/buildr/groovy/ lib/buildr/ide/
lib/buildr/java/ lib/buildr/packaging/ lib/buildr/scala/ rakelib/ spec/
spec/addon/ spec/core/ spec/groovy/ spec/id...
Author: boisvert
Date: Fri Mar 5 05:48:49 2010
New Revision: 919303
URL: http://svn.apache.org/viewvc?rev=919303&view=rev
Log:
Remove trailing whitespace on all Ruby files
Modified:
buildr/trunk/addon/buildr/antlr.rb
buildr/trunk/addon/buildr/drb.rb
buildr/trunk/addon/buildr/javacc.rb
buildr/trunk/addon/buildr/jetty.rb
buildr/trunk/addon/buildr/nailgun.rb
buildr/trunk/addon/buildr/openjpa.rb
buildr/trunk/addon/buildr/protobuf.rb
buildr/trunk/doc/scripts/buildr-git.rb
buildr/trunk/doc/scripts/gitflow.rb
buildr/trunk/lib/buildr/core/build.rb
buildr/trunk/lib/buildr/core/cc.rb
buildr/trunk/lib/buildr/core/common.rb
buildr/trunk/lib/buildr/core/doc.rb
buildr/trunk/lib/buildr/core/environment.rb
buildr/trunk/lib/buildr/core/generate.rb
buildr/trunk/lib/buildr/core/help.rb
buildr/trunk/lib/buildr/core/osx.rb
buildr/trunk/lib/buildr/core/progressbar.rb
buildr/trunk/lib/buildr/core/shell.rb
buildr/trunk/lib/buildr/core/test.rb
buildr/trunk/lib/buildr/core/transports.rb
buildr/trunk/lib/buildr/core/util.rb
buildr/trunk/lib/buildr/groovy/bdd.rb
buildr/trunk/lib/buildr/groovy/shell.rb
buildr/trunk/lib/buildr/ide/idea7x.rb
buildr/trunk/lib/buildr/java/ant.rb
buildr/trunk/lib/buildr/java/compiler.rb
buildr/trunk/lib/buildr/java/doc.rb
buildr/trunk/lib/buildr/java/emma.rb
buildr/trunk/lib/buildr/java/jruby.rb
buildr/trunk/lib/buildr/java/jtestr_runner.rb.erb
buildr/trunk/lib/buildr/java/pom.rb
buildr/trunk/lib/buildr/java/rjb.rb
buildr/trunk/lib/buildr/java/tests.rb
buildr/trunk/lib/buildr/java/version_requirement.rb
buildr/trunk/lib/buildr/packaging/archive.rb
buildr/trunk/lib/buildr/packaging/artifact.rb
buildr/trunk/lib/buildr/packaging/artifact_search.rb
buildr/trunk/lib/buildr/packaging/gems.rb
buildr/trunk/lib/buildr/packaging/tar.rb
buildr/trunk/lib/buildr/scala/doc.rb
buildr/trunk/lib/buildr/shell.rb
buildr/trunk/rakelib/all-in-one.rake
buildr/trunk/rakelib/checks.rake
buildr/trunk/rakelib/package.rake
buildr/trunk/rakelib/release.rake
buildr/trunk/rakelib/rspec.rake
buildr/trunk/rakelib/stage.rake
buildr/trunk/spec/addon/drb_spec.rb
buildr/trunk/spec/core/build_spec.rb
buildr/trunk/spec/core/cc_spec.rb
buildr/trunk/spec/core/checks_spec.rb
buildr/trunk/spec/core/common_spec.rb
buildr/trunk/spec/core/generate_spec.rb
buildr/trunk/spec/core/project_spec.rb
buildr/trunk/spec/core/transport_spec.rb
buildr/trunk/spec/core/util_spec.rb
buildr/trunk/spec/groovy/bdd_spec.rb
buildr/trunk/spec/groovy/compiler_spec.rb
buildr/trunk/spec/ide/eclipse_spec.rb
buildr/trunk/spec/ide/idea7x_spec.rb
buildr/trunk/spec/java/ant_spec.rb
buildr/trunk/spec/java/bdd_spec.rb
buildr/trunk/spec/java/cobertura_spec.rb
buildr/trunk/spec/java/commands_spec.rb
buildr/trunk/spec/java/compiler_spec.rb
buildr/trunk/spec/java/emma_spec.rb
buildr/trunk/spec/java/java_spec.rb
buildr/trunk/spec/java/packaging_spec.rb
buildr/trunk/spec/java/test_coverage_helper.rb
buildr/trunk/spec/java/tests_spec.rb
buildr/trunk/spec/packaging/archive_spec.rb
buildr/trunk/spec/packaging/artifact_spec.rb
buildr/trunk/spec/scala/bdd_spec.rb
buildr/trunk/spec/scala/compiler_spec.rb
buildr/trunk/spec/scala/scala.rb
buildr/trunk/spec/spec_helpers.rb
buildr/trunk/spec/version_requirement_spec.rb
Modified: buildr/trunk/addon/buildr/antlr.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/addon/buildr/antlr.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/addon/buildr/antlr.rb (original)
+++ buildr/trunk/addon/buildr/antlr.rb Fri Mar 5 05:48:49 2010
@@ -33,8 +33,8 @@
args = ["-o", options[:output]] + args if options[:output]
if options[:token]
# antlr expects the token directory to exist when it starts
- mkdir_p options[:token]
- args = ["-lib", options[:token]] + args
+ mkdir_p options[:token]
+ args = ["-lib", options[:token]] + args
end
Java.load
#Java.org.antlr.Tool.new_with_sig("[Ljava.lang.String;", args).process
@@ -44,7 +44,7 @@
def antlr(*args)
if Hash === args.last
- options = args.pop
+ options = args.pop
in_package = options[:in_package].split(".")
token = options[:token].split(".") if options[:token]
else
@@ -54,11 +54,11 @@
args = {:output=>File.join(task.name, in_package)}
args.merge!({:token=>File.join(task.name, token)}) if token
ANTLR.antlr task.prerequisites, args
- end
+ end
end
end
-
+
class Project
include ANTLR
end
Modified: buildr/trunk/addon/buildr/drb.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/addon/buildr/drb.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/addon/buildr/drb.rb (original)
+++ buildr/trunk/addon/buildr/drb.rb Fri Mar 5 05:48:49 2010
@@ -23,13 +23,13 @@
# This addon allows you start a DRb server hosting a buildfile, so that
# you can later invoke tasks on it without having to load
# the complete buildr runtime again.
- #
+ #
# Usage:
- #
+ #
# buildr -r buildr/drb drb:start
#
# Once the server has been started you can invoke tasks using a simple script:
- #
+ #
# #!/usr/bin/env ruby
# require 'rubygems'
# require 'buildr/drb'
@@ -48,18 +48,18 @@
# without having to incur JVM startup time.
# See the documentation for buildr/nailgun.
module DRbApplication
-
+
port = ENV['DRB_PORT'] || 2111
PORT = port.to_i
class SavedTask #:nodoc:
-
+
def initialize(original)
@original = original.clone
@prerequisites = original.prerequisites.clone if original.respond_to?(:prerequisites)
@actions = original.actions.clone if original.respond_to?(:actions)
end
-
+
def name
@original.name
end
@@ -71,7 +71,7 @@
def prerequisites
@prerequisites ||= []
end
-
+
def define!
@original.class.send(:define_task, @original.name => prerequisites).tap do |task|
task.comment = @original.comment
@@ -81,9 +81,9 @@
end # SavedTask
class Snapshot #:nodoc:
-
+
attr_accessor :projects, :tasks, :rules, :layout, :options
-
+
# save the tasks,rules,layout defined by buildr
def initialize
@rules = Buildr.application.instance_eval { @rules || [] }.clone
@@ -98,11 +98,11 @@
hash
end
end
-
+
end # Snapshot
class << self
-
+
attr_accessor :original, :snapshot
def run
@@ -139,7 +139,7 @@
def server_uri
"druby://:#{PORT}"
end
-
+
def connect
buildr = DRbObject.new(nil, server_uri)
uri = buildr.client_uri # obtain our uri from the server
@@ -159,7 +159,7 @@
# Lazily load buildr the first time it's needed
require 'buildr'
-
+
# Save the tasks,rules,layout defined by buildr
# before loading any project
@original = self::Snapshot.new
@@ -191,7 +191,7 @@
$stdout = SimpleDelegator.new($stdout)
$stderr = SimpleDelegator.new($stderr)
end
-
+
def with_config(remote)
@invoked = true
set = lambda do |env|
@@ -201,8 +201,8 @@
$stderr.__setobj__(env[:err])
Buildr.application.instance_variable_set :@original_dir, env[:dir]
end
- original = {
- :dir => Buildr.application.instance_variable_get(:@original_dir),
+ original = {
+ :dir => Buildr.application.instance_variable_get(:@original_dir),
:argv => ARGV,
:in => $stdin.__getobj__,
:out => $stdout.__getobj__,
@@ -238,7 +238,7 @@
end
private
-
+
def buildfile_needs_reload?
!@last_loaded || @last_loaded < buildfile.timestamp
end
@@ -274,7 +274,7 @@
end
task('drb:start') { run_server! } if Buildr.respond_to?(:application)
-
+
end # DRbApplication
end
Modified: buildr/trunk/addon/buildr/javacc.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/addon/buildr/javacc.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/addon/buildr/javacc.rb (original)
+++ buildr/trunk/addon/buildr/javacc.rb Fri Mar 5 05:48:49 2010
@@ -54,19 +54,19 @@
def javacc(*args)
if Hash === args.last
- options = args.pop
+ options = args.pop
in_package = options[:in_package].split(".")
else
in_package = []
end
file(path_to(:target, :generated, :javacc)=>args.flatten) do |task|
JavaCC.javacc task.prerequisites, :output=>File.join(task.name, in_package)
- end
+ end
end
def jjtree(*args)
if Hash === args.last
- options = args.pop
+ options = args.pop
in_package = options[:in_package].split(".")
build_node_files = options[:build_node_files]
else
@@ -74,7 +74,7 @@
end
file(path_to(:target, :generated, :jjtree)=>args.flatten) do |task|
JavaCC.jjtree task.prerequisites, :output=>File.join(task.name, in_package), :build_node_files=>build_node_files
- end
+ end
end
end
Modified: buildr/trunk/addon/buildr/jetty.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/addon/buildr/jetty.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/addon/buildr/jetty.rb (original)
+++ buildr/trunk/addon/buildr/jetty.rb Fri Mar 5 05:48:49 2010
@@ -46,15 +46,15 @@
# Which version of Jetty we're using by default (change with options.jetty.version).
VERSION = "6.1.3"
SLF4J_VERSION = "1.4.3"
-
+
# Libraries used by Jetty.
REQUIRES = [ "org.mortbay.jetty:jetty:jar:#{VERSION}", "org.mortbay.jetty:jetty-util:jar:#{VERSION}",
- "org.mortbay.jetty:servlet-api-2.5:jar:#{VERSION}", "org.slf4j:slf4j-api:jar:#{SLF4J_VERSION}",
+ "org.mortbay.jetty:servlet-api-2.5:jar:#{VERSION}", "org.slf4j:slf4j-api:jar:#{SLF4J_VERSION}",
"org.slf4j:slf4j-simple:jar:#{SLF4J_VERSION}", "org.slf4j:jcl104-over-slf4j:jar:#{SLF4J_VERSION}" ]
-
+
Java.classpath << REQUIRES
Java.classpath << File.dirname(__FILE__)
-
+
# Default URL for Jetty (change with options.jetty.url).
URL = "http://localhost:8080"
@@ -135,7 +135,7 @@
response = http.request_get("/buildr/")
response.is_a?(Net::HTTPSuccess) && response.body =~ /Alive/
end
- rescue Errno::ECONNREFUSED, Errno::EBADF
+ rescue Errno::ECONNREFUSED, Errno::EBADF
false
end
end
Modified: buildr/trunk/addon/buildr/nailgun.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/addon/buildr/nailgun.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/addon/buildr/nailgun.rb (original)
+++ buildr/trunk/addon/buildr/nailgun.rb Fri Mar 5 05:48:49 2010
@@ -21,18 +21,18 @@
module Buildr
-
+
# This addon is provided for fast interaction with a DRb BuildrServer (buildr/drb).
- #
+ #
# This module delegates task invocation to the BuildrServer, it only implements
# nailgun required logic (server/client).
#
# Usage:
#
# buildr -r buildr/nailgun nailgun:start
- #
+ #
# Once the server has been started you can invoke tasks using the nailgun client
- # installed on $JRUBY_HOME/tool/nailgun. It's recommended to add this path to
+ # installed on $JRUBY_HOME/tool/nailgun. It's recommended to add this path to
# your PATH environment variable, so that the ng command is available at any dir.
#
# ng build # invoke the build task
@@ -46,12 +46,12 @@
ARTIFACT_SPEC = "com.martiansoftware:nailgun:jar:#{VERSION}"
PORT = DRbApplication::PORT + 2
ADDON_BIN = File.dirname(__FILE__)
-
+
# Returns the path to JRUBY_HOME.
def jruby_home
ENV['JRUBY_HOME'] || Config::CONFIG['prefix']
end
-
+
# Returns the path to NAILGUN_HOME.
def nailgun_home
ENV['NAILGUN_HOME'] || File.expand_path('tool/nailgun', jruby_home)
@@ -109,17 +109,17 @@
stdout = Util.ctor(org.jruby.RubyIO, runtime, java.io.OutputStream => nail.out)
stderr = Util.ctor(org.jruby.RubyIO, runtime, java.io.OutputStream => nail.err)
stdin = Util.ctor(org.jruby.RubyIO, runtime, java.io.InputStream => nail.in)
-
+
dir = nail.getWorkingDirectory
argv = [nail.command] + nail.args
-
+
DRbApplication.remote_run :dir => dir, :argv => argv,
:in => stdin, :out => stdout, :err => stderr
rescue => e
nail.err.println e unless SystemExit === e
nail.exit 1
end
-
+
end # Client
module Server
@@ -131,18 +131,18 @@
def start
self.allow_nails_by_class_name = false
-
+
NGClient::Main.nail = NGClient.new
self.default_nail_class = NGClient::Main
-
+
@thread = java.lang.Thread.new(self)
@thread.setName(to_s)
@thread.start
-
+
sleep 1 while getPort == 0
info "#{self} Started."
end
-
+
def stop
@thread.kill
end
@@ -157,13 +157,13 @@
dist_zip = Buildr.download(tmp_path(NAME + '.zip') => URL)
dist_dir = Buildr.unzip(tmp_path(NAME) => dist_zip)
-
+
nailgun_jar = file(tmp_path(NAME, NAME, NAME + '.jar'))
nailgun_jar.enhance [dist_dir] unless File.exist?(nailgun_jar.to_s)
attr_reader :artifact
@artifact = Buildr.artifact(ARTIFACT_SPEC).from(nailgun_jar)
-
+
compiled_bin = file(tmp_path(NAME, NAME, 'ng' + Config::CONFIG['EXEEXT']) => dist_dir.target) do |task|
unless task.to_s.pathmap('%x') == '.exe'
Dir.chdir(task.to_s.pathmap('%d')) do
@@ -197,25 +197,25 @@
server.start
end
- task('setup' => artifact) do
+ task('setup' => artifact) do
module Util
include Buildr::Util
end
-
+
Util.add_to_sysloader artifact.to_s
Util.add_to_sysloader ADDON_BIN
-
+
class NGClient
include org.apache.buildr.BuildrNail
include Client
end
-
+
class NGServer < com.martiansoftware.nailgun.NGServer
include Server
- end
+ end
end
-
+
end # ng_tasks
-
+
end # module Nailgun
end
Modified: buildr/trunk/addon/buildr/openjpa.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/addon/buildr/openjpa.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/addon/buildr/openjpa.rb (original)
+++ buildr/trunk/addon/buildr/openjpa.rb Fri Mar 5 05:48:49 2010
@@ -26,7 +26,7 @@
REQUIRES = [ "org.apache.openjpa:openjpa:jar:#{VERSION}",
"commons-collections:commons-collections:jar:3.1",
- "commons-dbcp:commons-dbcp:jar:1.2.1",
+ "commons-dbcp:commons-dbcp:jar:1.2.1",
"commons-lang:commons-lang:jar:2.1",
"commons-pool:commons-pool:jar:1.2",
"javax.persistence:persistence-api:jar:1.0",
Modified: buildr/trunk/addon/buildr/protobuf.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/addon/buildr/protobuf.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/addon/buildr/protobuf.rb (original)
+++ buildr/trunk/addon/buildr/protobuf.rb Fri Mar 5 05:48:49 2010
@@ -29,7 +29,7 @@
command_line = []
command_line << "--#{options[:lang]}_out=#{options[:output]}" if options[:output]
-
+
(paths_from_sources(*args) + options[:include]).each { |i| command_line << "-I#{i}" }
command_line += files_from_sources(*args)
@@ -54,7 +54,7 @@
def protoc(*args)
if Hash === args.last
- options = args.pop
+ options = args.pop
else
options = {}
end
@@ -64,11 +64,11 @@
file(options[:output]=>Protobuf.files_from_sources(*args)) do |task|
Protobuf.protoc task.prerequisites, options
- end
+ end
end
end
-
+
class Project
include Protobuf
end
Modified: buildr/trunk/doc/scripts/buildr-git.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/doc/scripts/buildr-git.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/doc/scripts/buildr-git.rb (original)
+++ buildr/trunk/doc/scripts/buildr-git.rb Fri Mar 5 05:48:49 2010
@@ -29,7 +29,7 @@
# git apache setup svn --help
# git apache sync --help
#
-# To configure your local repo for svn synchronization,
+# To configure your local repo for svn synchronization,
#
# git apache update-authors
# git remote add upstream git@github.com:buildr/buildr.git
@@ -77,11 +77,11 @@
def options(opts)
opts.url = @@url
opts.file = self.class.authors_file
- [['-u', '--url URL',
+ [['-u', '--url URL',
"From URL. defaults to: #{opts.url}", lambda { |url|
opts.url = url
}],
- ['-f', '--file FILE',
+ ['-f', '--file FILE',
"Write to FILE, defaults to #{opts.file}", lambda { |path|
opts.file = path
}]
@@ -97,7 +97,7 @@
class CloneCommand < GitFlow/:clone
@help = "Create a clone from github.com/buildr repository."
-
+
def options(opts)
opts.origin = 'git://github.com/buildr/buildr.git'
opts.svn_prefix = 'apache'
@@ -113,7 +113,7 @@
def execute(opts, argv)
git 'clone', opts.origin, opts.local
- Dir.chdir(opts.local) do
+ Dir.chdir(opts.local) do
run 'update-users'
run 'setup'
end
@@ -125,7 +125,7 @@
def options(opt)
[]
end
-
+
def execute(opt, argv)
run 'setup', 'alias'
run 'setup', 'svn'
@@ -146,10 +146,10 @@
opt.svn_prefix = 'apache'
opt.svn_path = 'buildr'
opt.townhall = 'origin'
- [['--username SVN_USER', 'Use Apache svn username for this svn remote',
+ [['--username SVN_USER', 'Use Apache svn username for this svn remote',
lambda { |e| opt.apache_login = e }],
['--svn-prefix PREFIX', 'The name of svn remote to use for project.',
- "Defaults to #{opt.svn_prefix}",
+ "Defaults to #{opt.svn_prefix}",
lambda{|p| opt.svn_prefix = p }],
['--svn-uri URI', lambda {|p| opt.svn_uri = p }],
['--svn-rev REVISION', lambda {|p| opt.svn_rev = p }],
@@ -166,21 +166,21 @@
git 'config', 'svn.authorsfile', authors_file
git 'config', 'apache.svn', opt.svn_prefix
git 'config', 'apache.git', opt.townhall
-
+
if opt.apache_login
user, email = UpdateUsersCommand.user_email(opt.apache_login, authors_file)
puts "You claim to be #{user} <#{email}> with apache login: #{opt.apache_login}"
git('config', 'user.name', user)
git('config', 'user.email', email)
end
-
+
if opt.svn_rev
revision = opt.svn_rev
else
location, revision = svn_loc_rev
revision = opt.svn_rev || revision
end
-
+
if opt.svn_uri
repo = opt.svn_uri
else
@@ -189,13 +189,13 @@
repo = $`
end
- # Tell git where the svn repository is
+ # Tell git where the svn repository is
git('config', "svn-remote.#{opt.svn_prefix}.url", repo)
git('config', "svn-remote.#{opt.svn_prefix}.fetch",
"#{opt.svn_path}/trunk:refs/remotes/#{opt.svn_prefix}/trunk")
- git('config', "svn-remote.#{opt.svn_prefix}.branches",
+ git('config', "svn-remote.#{opt.svn_prefix}.branches",
"#{opt.svn_path}/branches/*:refs/remotes/#{opt.svn_prefix}/*")
- git('config', "svn-remote.#{opt.svn_prefix}.tags",
+ git('config', "svn-remote.#{opt.svn_prefix}.tags",
"#{opt.svn_path}/tags/*:refs/remotes/#{opt.svn_prefix}/tags/*")
# Store the user for svn dcommit
@@ -214,9 +214,9 @@
# update svn metadata
mkdir_p(expand_path('.git/svn'))
svn_meta = expand_path('.git/svn/.metadata')
- git('config', '--file', svn_meta,
+ git('config', '--file', svn_meta,
"svn-remote.#{opt.svn_prefix}.branches-maxRev", revision)
- git('config', '--file', svn_meta,
+ git('config', '--file', svn_meta,
"svn-remote.#{opt.svn_prefix}.tags-maxRev", revision)
end
@@ -255,18 +255,18 @@
class SyncCommand < GitFlow/:sync
@help = "Synchronizes between Apache svn and git townhall."
@documentation = <<-DOC
-This command will perform the following actions:
+This command will perform the following actions:
* fetch changes from apache svn.
* rebase them on the current branch or on the one specified with --onto
* dcommit (this will push your changes to Apache trunk)
GIT CONFIG VALUES:
-apache.svn
+apache.svn
The svn remote using to get changes from Apache SVN.
Set by setup-svn --svn-prefix.
-apache.git
+apache.git
The git remote used as townhall repository.
Set by setup-svn --townhall.
@@ -281,7 +281,7 @@
opt.git_branch = 'master'
opt.apache_git = git('config', '--get', 'apache.git').chomp rescue nil
opt.apache_svn = git('config', '--get', 'apache.svn').chomp rescue nil
- opt.svn_username = git('config', '--get',
+ opt.svn_username = git('config', '--get',
"svn-remote.#{opt.apache_svn}.username").chomp rescue nil
[['--apache-svn SVN_REMOTE', 'The SVN remote used to get changes from Apache',
"Current value: #{opt.apache_svn}",
@@ -289,15 +289,15 @@
['--apache-git REMOTE', 'The git remote used as town-hall repository.',
"Current value: #{opt.apache_git}",
lambda { |r| opt.apache_git = r }],
- ['--username SVN_USER',
+ ['--username SVN_USER',
'Specify the SVN username for dcommit',
"Defaults to: #{opt.svn_username}",
lambda { |b| opt.svn_username = b }],
['--svn-branch SVN_BRANCH',
- 'Specify the SVN branch to rebase changes from, and where to dcommit',
+ 'Specify the SVN branch to rebase changes from, and where to dcommit',
"Defaults to: #{opt.svn_branch}",
lambda { |b| opt.svn_branch = b }],
- ['--git-branch REMOTE_BRANCH',
+ ['--git-branch REMOTE_BRANCH',
'Specify the remote town-hall branch (on apache.git) to update',
"Defaults to: #{opt.git_branch}",
lambda { |b| opt.git_branch = b }],
@@ -318,29 +318,29 @@
# obtain latest changes from svn
git('svn', 'fetch', '--svn-remote', opt.apache_svn)
# obtain latest changes from git
- git('fetch', opt.apache_git,
+ git('fetch', opt.apache_git,
"#{opt.git_branch}:refs/remotes/#{opt.apache_git}/#{opt.git_branch}")
# rebase svn changes in the desired branch
git('rebase', "#{opt.apache_svn}/#{opt.svn_branch}", opt.branch)
git('rebase', "#{opt.apache_git}/#{opt.git_branch}", opt.branch)
-
+
# dcommit to the specific svn branch
- ['svn', 'dcommit',
+ ['svn', 'dcommit',
'--svn-remote', opt.apache_svn, '--commit-url', commit_url].tap do |cmd|
if opt.svn_username
cmd << '--username' << opt.svn_username
end
git(*cmd)
end
-
+
# update townhall remote ref
- git('update-ref',
+ git('update-ref',
"refs/remotes/#{opt.apache_git}/#{opt.git_branch}",
"refs/remotes/#{opt.apache_svn}/#{opt.svn_branch}")
# forward the remote townhall/master to apache/trunk
- git('push', opt.apache_git,
+ git('push', opt.apache_git,
"refs/remotes/#{opt.apache_git}/#{opt.git_branch}:#{opt.git_branch}")
# get back to the original branch
@@ -349,7 +349,7 @@
end
- # This one is displayed when the user executes this script using
+ # This one is displayed when the user executes this script using
# open-uri -e
HEADER = <<HEADER
@@ -364,8 +364,8 @@
Ctrl+D or an invalid option to abort
HEADER
-
- # When fork is completed, we display the following notice on a
+
+ # When fork is completed, we display the following notice on a
# pager, giving the user a brief overview of git aliases used
# to keep the mirror in sync.
NOTICE = <<NOTICE
@@ -381,27 +381,27 @@
git apache merge # Merge already fetched changes on the current branch
# Use this command to get up to date with trunk changes
- # you can always cherry-pick from the apache/trunk
+ # you can always cherry-pick from the apache/trunk
# branch.
git apache pull # get apache-fetch && git apache-merge
-
- git apache push # Push to Apache's SVN. Only staged changes (those
- # recorded using `git commit`) will be sent to SVN.
+
+ git apache push # Push to Apache's SVN. Only staged changes (those
+ # recorded using `git commit`) will be sent to SVN.
# You need not to be on the master branch.
# Actually you can work on a tiny-feature branch and
- # commit directly from it.
+ # commit directly from it.
#
- # VERY IMPORTANT:
+ # VERY IMPORTANT:
#
# Missing commits on Apache's SVN will be sent using
# your apache svn account. This means that you can
# make some commits on behalf of others (like patches
# comming from JIRA issues or casual contributors)
- # Review the apache-push alias on .git/config if you
+ # Review the apache-push alias on .git/config if you
# want to change login-name used for commit to SVN.
- #
- # See the recommended workflow to avoid commiting
+ #
+ # See the recommended workflow to avoid commiting
# other developers' changes and the following section.
THE GITHUB MIRROR:
@@ -410,11 +410,11 @@
http://github.com/buildr/buildr
- This mirror DOES NOT replace Apache's SVN repository. We really care about
- using Apache infrastructure and following Apache project guidelines for
+ This mirror DOES NOT replace Apache's SVN repository. We really care about
+ using Apache infrastructure and following Apache project guidelines for
contributions. This git mirror is provided only for developers convenience,
allowing them to easily create experimental branches or review code from
- other committers.
+ other committers.
All code that wants to make it to the official Apache Buildr repository needs
to be committed to the Apache SVN repository by using the command:
@@ -423,39 +423,39 @@
This command will synchronize both ways svn<->git to keep trunk upto date.
You need to be an Apache committer and have permissions on the SVN repo.
-
+
It's VERY IMPORTANT for Buildr committers to remember that contributions from
external entities wanting to be accepted will require them to sign the Apache ICLA.
- We provide the git mirror to make it easier for people to experiment and
+ We provide the git mirror to make it easier for people to experiment and
contribute back to Buildr, before merging their code in, please remember they
- have to create create a JIRA issue granting ASF permission to include their code,
+ have to create create a JIRA issue granting ASF permission to include their code,
just like any other contribution following Apache's guidelines.
- So, it's very important - if you care about meritocracy - to follow or at
+ So, it's very important - if you care about meritocracy - to follow or at
least that you get an idea of the recommended workflow.
RECOMMENDED WORKFLOW:
-
- So now that you have your local buildr copy you can create topic branches
- to work on independent features, and still merge easily with head changes.
+
+ So now that you have your local buildr copy you can create topic branches
+ to work on independent features, and still merge easily with head changes.
They may seem lots of things to consider, but it's all for Buildr's healt.
As all things git, you can always follow your own workflow and even create
aliases on you .git/config file to avoid typing much. So, here they are:
- 1) get your gitflow configured
+ 1) get your gitflow configured
(you have already do so, this was the most difficult part)
2) create a topic branch to work on, say.. you want to add cool-feature:
- git checkout -b cool-feature master
+ git checkout -b cool-feature master
# now on branch cool-feature
3) hack hack hack.. use the source luke.
- every time you feel you have something important like added failing
+ every time you feel you have something important like added failing
spec, added part of feature, or resolved some conflict from merges,
- you can commit your current progress. If you want to be selective, use:
-
+ you can commit your current progress. If you want to be selective, use:
+
git commit --interactive
3) review your changes, get ALL specs passing, repeat step 3 as needed
@@ -465,12 +465,12 @@
git apache-fetch
# You can inspect the upstream changes without having to merge them
git log apache/trunk # what are they doing!!
-
+
5) integrate mainstream changes to your cool-feature branch, you can always
use `git cherry-pick` to select only some commits.
git merge apache/trunk cool-feature
-
+
6) Go to 3 unless ALL specs are passing.
7.a) (Skip to 7.b you have commit bit on Apache's SVN)
@@ -481,19 +481,19 @@
https://issues.apache.org/jira/browse/BUILDR
dev@buildr.apache.org
- 7.b) Now you have everyhing on staging area and merged important changes
+ 7.b) Now you have everyhing on staging area and merged important changes
from apache/trunk, it's time to commit them to Apache's SVN.
- git apache-push
+ git apache-push
8) Optional. If you are a buildr committer you may want to synchronize
- the github mirror for helping others to get changes without having to
+ the github mirror for helping others to get changes without having to
wait on Victor's cronjob to run every hour (useful for urgent changes).
git synchronize
9) Pull changes from origin frequently.
-
+
git fetch origin
git rebase --onto origin/master master master
@@ -508,5 +508,5 @@
NOTICE
#' for emacs
-
+
end
Modified: buildr/trunk/doc/scripts/gitflow.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/doc/scripts/gitflow.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/doc/scripts/gitflow.rb (original)
+++ buildr/trunk/doc/scripts/gitflow.rb Fri Mar 5 05:48:49 2010
@@ -20,7 +20,7 @@
module GitFlow
extend self
-
+
attr_accessor :should_run, :trace, :program
self.program = 'gitflow'
@@ -34,7 +34,7 @@
OVERVIEW:
gitflow is intended to help developers with their daily git workflow,
-performing repetitive git commands for them. It is implemented in
+performing repetitive git commands for them. It is implemented in
ruby so you can do anything, from invoking rake tasks to telling
people on twitter you are having trouble with their code :P.
@@ -53,7 +53,7 @@
EXTENDING YOUR WORKFLOW:
-You can create your own gitflow commands, to adapt your development
+You can create your own gitflow commands, to adapt your development
workflow.
Simply create a ruby script somewhere say ~/.buildr/gitflow.rb
@@ -66,17 +66,17 @@
#!/usr/bin/env ruby
require /path/to/gitflow.rb
-
+
class MyCommand < GitFlow/'my-flow'
-
+
@help = "Summary to be displayed when listing commands"
@documentation = "Very long help that will be paged if necessary. (for --help)"
-
+
# takes an openstruct to place default values and option values.
# returns an array of arguments given to optparse.on
def options(opts)
opts.something = 'default'
- [
+ [
['--name NAME', lambda { |n| opts.name = n }],
['--yes', lambda { |n| opts.yes = true }]
]
@@ -94,7 +94,7 @@
class SubCommand < MyCommand/'sub-work'
... # implement a subcommand
end
-
+
end
You would then get help for your command with
@@ -203,26 +203,26 @@
# Override this method in your command class if it
# needs to parse command line options.
- #
+ #
# This method takes an openstruct object as argument
- # allowing you to store default values on it, and
+ # allowing you to store default values on it, and
# set option values.
#
- # The return value must be an array of arguments
+ # The return value must be an array of arguments
# given to optparse.on
def options(opt)
[]
end
-
+
# Override this method in your command class to implement
# the command.
# First argument is the openstruct object after
- # it has been populated by the option parser.
+ # it has been populated by the option parser.
# Second argument is the array of non-option arguments.
def execute(opt, argv)
fail "#{self.class.command} not implemented"
end
-
+
# Run the command line given on argv
def run(*argv, &block)
GitFlow.run(*argv, &block)
@@ -233,11 +233,11 @@
GitFlow.pager
yield
end
-
+
def trace(*str)
STDERR.puts(*str) if GitFlow.trace
end
-
+
def git(*args)
cmd = 'git ' + args.map { |arg| arg[' '] ? %Q{"#{arg}"} : arg }.join(' ')
trace cmd
@@ -245,13 +245,13 @@
fail "GIT command `#{cmd}` failed with status #{$?.exitstatus}" unless $?.exitstatus == 0
}
end
-
+
def sh(*args)
`#{args.join(' ')}`.tap {
fail "Shell command `#{args.join(' ')}` failed with status #{$?.exitstatus}" unless $?.exitstatus == 0
}
end
-
+
def expand_path(path, dir=Dir.pwd)
File.expand_path(path, dir)
end
@@ -259,7 +259,7 @@
class NoSuchCommand < GitFlow/nil
@documentation = HELP
-
+
def execute(opts, argv)
page do
puts "Command not found: #{argv.join(' ').inspect}"
@@ -271,7 +271,7 @@
class HelpCommand < GitFlow/:help
@help = "Display help for a command or show command list"
@documentation = "Displays help for the command given as argument"
-
+
def execute(opts, argv)
if argv.empty?
opt = GitFlow.optparse
@@ -290,7 +290,7 @@
end
end
end
-
+
end
at_exit { GitFlow.run(*ARGV) if GitFlow.should_run }
Modified: buildr/trunk/lib/buildr/core/build.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/build.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/build.rb (original)
+++ buildr/trunk/lib/buildr/core/build.rb Fri Mar 5 05:48:49 2010
@@ -188,7 +188,7 @@
def commit(file, message)
svn 'commit', '-m', message, file
end
-
+
# :call-seq:
# tag_url(svn_url, version) => tag_url
#
@@ -209,24 +209,24 @@
def repo_url
svn('info', '--xml')[/<url>(.*?)<\/url>/, 1].strip
end
-
+
def copy(dir, url, message)
svn 'copy', dir, url, '-m', message
end
-
+
def remove(url, message)
svn 'remove', url, '-m', message
end
end
-
+
class Release #:nodoc:
THIS_VERSION_PATTERN = /(THIS_VERSION|VERSION_NUMBER)\s*=\s*(["'])(.*)\2/
class << self
-
+
# Use this to specify a different tag name for tagging the release in source control.
# You can set the tag name or a proc that will be called with the version number,
# for example:
@@ -275,12 +275,12 @@
args = '-S', 'buildr', "_#{Buildr::VERSION}_", '--buildfile', release_candidate_buildfile
args << '--environment' << Buildr.environment unless Buildr.environment.to_s.empty?
args << 'clean' << 'upload' << 'DEBUG=no'
- ruby *args
+ ruby *args
end
tag_release resolve_tag
update_version_to_next
end
-
+
# :call-seq:
# extract_version() => this_versin
#
@@ -292,19 +292,19 @@
rescue
fail 'Looking for THIS_VERSION = "..." in your Buildfile, none found'
end
-
+
# Use this to specify a different tag name for tagging the release in source control.
# You can set the tag name or a proc that will be called with the version number,
# for example:
- # Release.find.tag_name = lambda { |ver| "foo-#{ver}" }
+ # Release.find.tag_name = lambda { |ver| "foo-#{ver}" }
# Deprecated: you should use Release.tag_name instead
def tag_name(tag_proc)
warn("Release.find.tag_name is deprecated. You should use Release.tag_name instead")
Release.tag_name(tag_proc)
end
-
+
protected
-
+
# :call-seq:
# with_release_candidate_version() { |filename| ... }
#
@@ -421,7 +421,7 @@
Git.push if Git.remote
end
end
-
+
class SvnRelease < Release
class << self
@@ -429,7 +429,7 @@
File.exist?('.svn')
end
end
-
+
def check
fail "Uncommitted files violate the First Principle Of Release!\n"+Svn.uncommitted_files.join("\n") unless Svn.uncommitted_files.empty?
fail "SVN URL must contain 'trunk' or 'branches/...'" unless Svn.repo_url =~ /(trunk)|(branches.*)$/
@@ -446,7 +446,7 @@
Svn.commit Buildr.application.buildfile.to_s, message
end
end
-
+
Release.add SvnRelease
Release.add GitRelease
Modified: buildr/trunk/lib/buildr/core/cc.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/cc.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/cc.rb (original)
+++ buildr/trunk/lib/buildr/core/cc.rb Fri Mar 5 05:48:49 2010
@@ -22,7 +22,7 @@
class CCTask < Rake::Task
attr_accessor :delay
attr_reader :project
-
+
def initialize(*args)
super
@delay = 0.2
@@ -30,13 +30,13 @@
monitor_and_compile
end
end
-
+
private
-
+
def associate_with(project)
@project = project
end
-
+
def monitor_and_compile
# we don't want to actually fail if our dependencies don't succede
begin
@@ -45,24 +45,24 @@
rescue Exception => ex
$stderr.puts $terminal.color(ex.message, :red)
$stderr.puts
-
+
notify_build_status(false, project)
end
-
+
main_dirs = project.compile.sources.map(&:to_s)
test_dirs = project.task('test:compile').sources.map(&:to_s)
res_dirs = project.resources.sources.map(&:to_s)
-
+
main_ext = Buildr::Compiler.select(project.compile.compiler).source_ext.map(&:to_s)
test_ext = Buildr::Compiler.select(project.task('test:compile').compiler).source_ext.map(&:to_s)
-
+
test_tail = if test_dirs.empty? then '' else ",{#{test_dirs.join ','}}/**/*.{#{test_ext.join ','}}" end
res_tail = if res_dirs.empty? then '' else ",{#{res_dirs.join ','}}/**/*" end
-
+
pattern = "{{#{main_dirs.join ','}}/**/*.{#{main_ext.join ','}}#{test_tail}#{res_tail}}"
-
+
times, _ = check_mtime pattern, {} # establish baseline
-
+
dir_names = (main_dirs + test_dirs + res_dirs).map { |file| strip_filename project, file }
if dir_names.length == 1
info "Monitoring directory: #{dir_names.first}"
@@ -70,33 +70,33 @@
info "Monitoring directories: [#{dir_names.join ', '}]"
end
trace "Monitoring extensions: [#{main_ext.join ', '}]"
-
+
while true
sleep delay
-
+
times, changed = check_mtime pattern, times
unless changed.empty?
info '' # better spacing
-
+
changed.each do |file|
info "Detected changes in #{strip_filename project, file}"
end
-
+
in_main = main_dirs.any? do |dir|
changed.any? { |file| file.index(dir) == 0 }
end
-
+
in_test = test_dirs.any? do |dir|
changed.any? { |file| file.index(dir) == 0 }
end
-
+
in_res = res_dirs.any? do |dir|
changed.any? { |file| file.index(dir) == 0 }
end
-
+
project.task(:compile).reenable if in_main
project.task('test:compile').reenable if in_test || in_main
-
+
successful = true
begin
project.task(:resources).filter.run if in_res
@@ -106,13 +106,13 @@
$stderr.puts $terminal.color(ex.message, :red)
successful = false
end
-
+
notify_build_status(successful, project)
puts $terminal.color("Build complete", :green) if successful
end
end
end
-
+
def notify_build_status(successful, project)
if RUBY_PLATFORM =~ /darwin/ && $stdout.isatty && verbose
if successful
@@ -122,48 +122,48 @@
end
end
end
-
+
def check_mtime(pattern, old_times)
times = {}
changed = []
-
+
Dir.glob pattern do |fname|
times[fname] = File.mtime fname
if old_times[fname].nil? || old_times[fname] < File.mtime(fname)
changed << fname
end
end
-
+
# detect deletion (slower than it could be)
old_times.each_key do |fname|
changed << fname unless times.has_key? fname
end
-
+
[times, changed]
end
-
+
def strip_filename(project, name)
name.gsub project.base_dir + File::SEPARATOR, ''
end
end
-
+
module CC
include Extension
-
+
first_time do
Project.local_task :cc
end
-
+
before_define do |project|
cc = CCTask.define_task :cc
cc.send :associate_with, project
end
-
+
def cc
task :cc
end
end
-
+
class Project
include CC
end
Modified: buildr/trunk/lib/buildr/core/common.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/common.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/common.rb (original)
+++ buildr/trunk/lib/buildr/core/common.rb Fri Mar 5 05:48:49 2010
@@ -34,7 +34,7 @@
#
# compile.with COMMONS.logging
def struct(hash)
- Struct.new(nil, *hash.keys).new(*hash.values)
+ Struct.new(nil, *hash.keys).new(*hash.values)
end
# :call-seq:
Modified: buildr/trunk/lib/buildr/core/doc.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/doc.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/doc.rb (original)
+++ buildr/trunk/lib/buildr/core/doc.rb Fri Mar 5 05:48:49 2010
@@ -1,52 +1,52 @@
module Buildr
module Doc
include Extension
-
+
class << self
def select_by_lang(lang)
fail 'Unable to define doc task for nil language' if lang.nil?
engines.detect { |e| e.language.to_sym == lang.to_sym }
end
-
+
alias_method :select, :select_by_lang
-
+
def select_by_name(name)
fail 'Unable to define doc task for nil' if name.nil?
engines.detect { |e| e.to_sym == name.to_sym }
end
-
+
def engines
@engines ||= []
end
end
-
-
+
+
# Base class for any documentation provider. Defines most
# common functionality (things like @into@, @from@ and friends).
class Base
class << self
attr_accessor :language, :source_ext
-
+
def specify(options)
@language = options[:language]
@source_ext = options[:source_ext]
end
-
+
def to_sym
@symbol ||= name.split('::').last.downcase.to_sym
end
end
-
+
attr_reader :project
-
+
def initialize(project)
@project = project
end
end
-
-
+
+
class DocTask < Rake::Task
-
+
# The target directory for the generated documentation files.
attr_reader :target
@@ -55,10 +55,10 @@
# Additional sourcepaths that are not part of the documented files.
attr_accessor :sourcepath
-
+
# Returns the documentation tool options.
attr_reader :options
-
+
# :nodoc:
attr_reader :project
@@ -71,14 +71,14 @@
enhance do |task|
rm_rf target.to_s
mkdir_p target.to_s
-
+
engine.generate(source_files, File.expand_path(target.to_s),
options.merge(:classpath => classpath, :sourcepath => sourcepath))
-
+
touch target.to_s
end
end
-
+
# :call-seq:
# into(path) => self
#
@@ -130,15 +130,15 @@
# doc.using :vscaladoc
def using(*args)
args.pop.each { |key, value| @options[key.to_sym] = value } if Hash === args.last
-
+
until args.empty?
new_engine = Doc.select_by_name(args.pop)
@engine = new_engine.new(project) unless new_engine.nil?
end
-
+
self
end
-
+
def engine
@engine ||= guess_engine
end
@@ -161,7 +161,7 @@
when Project
self.enhance source.prerequisites
self.include source.compile.sources
- self.with source.compile.dependencies
+ self.with source.compile.dependencies
when Rake::Task, String
self.include source
else
@@ -177,7 +177,7 @@
def source_files #:nodoc:
@source_files ||= @files.map(&:to_s).map do |file|
- File.directory?(file) ? FileList[File.join(file, "**/*.#{engine.class.source_ext}")] : file
+ File.directory?(file) ? FileList[File.join(file, "**/*.#{engine.class.source_ext}")] : file
end.flatten.reject { |file| @files.exclude?(file) }
end
@@ -186,21 +186,21 @@
return true unless File.exist?(target.to_s)
source_files.map { |src| File.stat(src.to_s).mtime }.max > File.stat(target.to_s).mtime
end
-
+
private
-
+
def guess_engine
doc_engine = Doc.select project.compile.language
fail 'Unable to guess documentation provider for project.' unless doc_engine
doc_engine.new project
end
-
+
def associate_with(project)
@project ||= project
end
end
-
-
+
+
first_time do
desc 'Create the documentation for this project'
Project.local_task :doc
@@ -234,14 +234,14 @@
def doc(*sources, &block)
task('doc').from(*sources).enhance &block
end
-
+
def javadoc(*sources, &block)
warn 'The javadoc method is deprecated and will be removed in a future release.'
doc(*sources, &block)
end
end
-
-
+
+
class Project
include Doc
end
Modified: buildr/trunk/lib/buildr/core/environment.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/environment.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/environment.rb (original)
+++ buildr/trunk/lib/buildr/core/environment.rb Fri Mar 5 05:48:49 2010
@@ -21,7 +21,7 @@
# We use this to present environment variable as arrays.
class EnvArray < Array #:nodoc:
-
+
def initialize(name)
@name = name.upcase
replace((ENV[@name] || ENV[@name.downcase] || '').split(/\s*,\s*/).reject(&:empty?))
@@ -57,7 +57,7 @@
ENV['http_proxy'] = nil
ENV['HTTP_PROXY'] = url
end
-
+
# Returns the HTTPS_PROXY URL.
def https
ENV['HTTPS_PROXY'] || ENV['https_proxy']
@@ -69,7 +69,7 @@
ENV['HTTPS_PROXY'] = url
end
- # Returns list of hosts to exclude from proxying (NO_PROXY).
+ # Returns list of hosts to exclude from proxying (NO_PROXY).
def exclude
@exclude ||= EnvArray.new('NO_PROXY')
end
Modified: buildr/trunk/lib/buildr/core/generate.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/generate.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/generate.rb (original)
+++ buildr/trunk/lib/buildr/core/generate.rb Fri Mar 5 05:48:49 2010
@@ -21,7 +21,7 @@
module Generate #:nodoc:
task 'generate' do
- script = nil
+ script = nil
choose do |menu|
menu.header = "To use Buildr you need a buildfile. Do you want me to create one?"
@@ -29,12 +29,12 @@
menu.choice("From directory structure") { script = Generate.from_directory(Dir.pwd).join("\n") }
menu.choice("Skip") { }
end
-
- if script
+
+ if script
buildfile = File.expand_path(Buildr::Application::DEFAULT_BUILDFILES.first)
File.open(buildfile, "w") { |file| file.write script }
puts "Created #{buildfile}"
- end
+ end
end
class << self
@@ -107,7 +107,7 @@
proxy = settings['proxies'].first['proxy'].find { |proxy|
proxy["active"].nil? || proxy["active"].to_s =~ /true/
} rescue nil
-
+
if proxy
url = %{#{proxy["protocol"].first}://#{proxy["host"].first}:#{proxy["port"].first}}
exclude = proxy["nonProxyHosts"].to_s.gsub("|", ",") if proxy["nonProxyHosts"]
@@ -189,7 +189,7 @@
script << "end"
script.flatten
end
-
+
end
end
-end
+end
Modified: buildr/trunk/lib/buildr/core/help.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/help.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/help.rb (original)
+++ buildr/trunk/lib/buildr/core/help.rb Fri Mar 5 05:48:49 2010
@@ -24,7 +24,7 @@
class << self
def <<(arg)
- if arg.respond_to?(:call)
+ if arg.respond_to?(:call)
texters << arg
else
texters << lambda { arg }
Modified: buildr/trunk/lib/buildr/core/osx.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/osx.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/osx.rb (original)
+++ buildr/trunk/lib/buildr/core/osx.rb Fri Mar 5 05:48:49 2010
@@ -27,7 +27,7 @@
# Register with Growl, that way you can turn notifications on/off from system preferences.
OSX::NSDistributedNotificationCenter.defaultCenter.
postNotificationName_object_userInfo_deliverImmediately(:GrowlApplicationRegistrationNotification, nil,
- { :ApplicationName=>'Buildr', :AllNotifications=>['Completed', 'Failed'],
+ { :ApplicationName=>'Buildr', :AllNotifications=>['Completed', 'Failed'],
:ApplicationIcon=>icon.TIFFRepresentation }, true)
OSX::NSDistributedNotificationCenter.defaultCenter.
@@ -40,7 +40,7 @@
# so we also need to rescue LoadError.
end
end
-
+
Buildr.application.on_completion { |title, message| growl_notify('Completed', title, message) if verbose }
Buildr.application.on_failure { |title, message, ex| growl_notify('Failed', title, message) if verbose }
end
Modified: buildr/trunk/lib/buildr/core/progressbar.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/progressbar.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/progressbar.rb (original)
+++ buildr/trunk/lib/buildr/core/progressbar.rb Fri Mar 5 05:48:49 2010
@@ -66,7 +66,7 @@
end
def title
- @title.size > ProgressBar.width / 5 ? (@title[0, ProgressBar.width / 5 - 2] + '..') : @title
+ @title.size > ProgressBar.width / 5 ? (@title[0, ProgressBar.width / 5 - 2] + '..') : @title
end
def count
@@ -93,7 +93,7 @@
end
def elapsed
- 'Time: %s' % duration(Time.now - @start)
+ 'Time: %s' % duration(Time.now - @start)
end
def rate
@@ -130,7 +130,7 @@
@output.print "\r", " " * (ProgressBar.width - 1), "\r"
@output.flush
end
-
+
def render
return unless @output
format, *args = @format
@@ -143,7 +143,7 @@
end
def changed?
- return false unless @output && Time.now - @last_time > 0.1
+ return false unless @output && Time.now - @last_time > 0.1
return human(@count) != human(@previous) if @total == 0
return true if (@count - @previous) >= @total / 100
return Time.now - @last_time > 1
Modified: buildr/trunk/lib/buildr/core/shell.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/shell.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/shell.rb (original)
+++ buildr/trunk/lib/buildr/core/shell.rb Fri Mar 5 05:48:49 2010
@@ -22,29 +22,29 @@
module Shell
class BeanShell < Base
-
+
include JavaRebel
-
+
VERSION = '2.0b4'
class << self
def version
Buildr.settings.build['bsh'] || VERSION
end
-
+
def artifact
"org.beanshell:bsh:jar:#{version}"
end
-
+
def lang
:java
end
-
+
def to_sym
:bsh
end
end
-
+
def launch
cp = project.compile.dependencies + [project.path_to(:target, :classes), Buildr.artifact(BeanShell.artifact)]
Java::Commands.java 'bsh.Console', {
@@ -53,32 +53,32 @@
:java_args => rebel_args
}
end
-
+
end # BeanShell
-
+
class JIRB < Base
include JavaRebel
-
+
JRUBY_VERSION = '1.4.0'
-
- class << self
+
+ class << self
def lang
:none
end
end
-
+
def launch
if jruby_home # if JRuby is installed, use it
- cp = project.compile.dependencies +
+ cp = project.compile.dependencies +
[project.path_to(:target, :classes)] +
Dir.glob("#{jruby_home}#{File::SEPARATOR}lib#{File::SEPARATOR}*.jar")
-
+
props = {
'jruby.home' => jruby_home,
'jruby.lib' => "#{jruby_home}#{File::SEPARATOR}lib"
}
-
+
if not Util.win_os?
uname = `uname -m`
cpu = if uname =~ /i[34567]86/
@@ -88,24 +88,24 @@
elsif uname =~ /amd64|x86_64/
'amd64'
end
-
+
os = `uname -s | tr '[A-Z]' '[a-z]'`
path = if os == 'darwin'
'darwin'
else
"#{os}-#{cpu}"
end
-
+
props['jna.boot.library.path'] = "#{jruby_home}/lib/native/#{path}"
end
-
+
props['jruby.script'] = if Util.win_os? then 'jruby.bat' else 'jruby' end
props['jruby.shell'] = if Util.win_os? then 'cmd.exe' else '/bin/sh' end
-
+
args = [
"-Xbootclasspath/a:#{Dir.glob("#{jruby_home}#{File::SEPARATOR}lib#{File::SEPARATOR}jruby*.jar").join File::PATH_SEPARATOR}"
]
-
+
Java::Commands.java 'org.jruby.Main', "#{jruby_home}#{File::SEPARATOR}bin#{File::SEPARATOR}jirb", {
:properties => props.merge(rebel_props(project)),
:classpath => cp,
@@ -116,7 +116,7 @@
jruby_artifact,
project.path_to(:target, :classes)
]
-
+
Java::Commands.java 'org.jruby.Main', '--command', 'irb', {
:properties => rebel_props(project),
:classpath => cp,
@@ -133,33 +133,33 @@
version = Buildr.settings.build['jruby'] || JRUBY_VERSION
"org.jruby:jruby-complete:jar:#{version}"
end
-
+
end
-
+
class Clojure < Base
include JavaRebel
-
+
JLINE_VERSION = '0.9.94'
-
+
class << self
def lang
:none
end
-
+
def to_sym
:clj # more common than `clojure`
end
end
-
+
# don't build if it's *only* Clojure sources
def build?
!has_source?(:clojure) or has_source?(:java) or has_source?(:scala) or has_source?(:groovy)
end
-
+
def launch
fail 'Are we forgetting something? CLOJURE_HOME not set.' unless clojure_home
-
- cp = project.compile.dependencies +
+
+ cp = project.compile.dependencies +
[
if build?
project.path_to(:target, :classes)
@@ -169,7 +169,7 @@
File.expand_path('clojure.jar', clojure_home),
'jline:jline:jar:0.9.94'
]
-
+
if build?
Java::Commands.java 'jline.ConsoleRunner', 'clojure.lang.Repl', {
:properties => rebel_props(project),
@@ -180,12 +180,12 @@
Java::Commands.java 'jline.ConsoleRunner', 'clojure.lang.Repl', :classpath => cp
end
end
-
+
private
def clojure_home
@home ||= ENV['CLOJURE_HOME']
end
-
+
def has_source?(lang)
File.exists? project.path_to(:src, :main, lang)
end
Modified: buildr/trunk/lib/buildr/core/test.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/test.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/test.rb (original)
+++ buildr/trunk/lib/buildr/core/test.rb Fri Mar 5 05:48:49 2010
@@ -626,21 +626,21 @@
# We define a module inline that will inject cancelling the task if tests are skipped.
module SkipIfNoTest
-
+
def self.extended(base)
base.instance_eval {alias :execute_before_skip_if_no_test :execute}
base.instance_eval {alias :execute :execute_after_skip_if_no_test}
end
-
+
def execute_after_skip_if_no_test(args) #:nodoc:
if Buildr.options.test == false
- trace "Skipping #{to_s} for #{project.name} as tests are skipped"
+ trace "Skipping #{to_s} for #{project.name} as tests are skipped"
return
end
execute_before_skip_if_no_test(args)
end
end
-
+
# Similar to the regular compile task but using different paths.
compile = CompileTask.define_task('test:compile'=>[project.compile, resources])
compile.extend SkipIfNoTest
Modified: buildr/trunk/lib/buildr/core/transports.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/transports.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/transports.rb (original)
+++ buildr/trunk/lib/buildr/core/transports.rb Fri Mar 5 05:48:49 2010
@@ -76,7 +76,7 @@
uri = URI.parse(uri.to_s) unless URI === uri
uri.download target, options
end
-
+
# :call-seq:
# write(uri, content, options?)
# write(uri, options?) { |bytes| .. }
@@ -98,7 +98,7 @@
uri = URI.parse(uri.to_s) unless URI === uri
uri.write *args, &block
end
-
+
# :call-seq:
# upload(uri, source, options?)
#
@@ -162,7 +162,7 @@
target.flush
end
end
-
+
# :call-seq:
# write(content, options?)
# write(options?) { |bytes| .. }
Modified: buildr/trunk/lib/buildr/core/util.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/util.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/util.rb (original)
+++ buildr/trunk/lib/buildr/core/util.rb Fri Mar 5 05:48:49 2010
@@ -25,7 +25,7 @@
module Buildr
-
+
module Util
extend self
@@ -37,7 +37,7 @@
# prefer this function instead of using Gem.win_platform?.
#
# Gem.win_platform? only checks these RUBY_PLATFORM global,
- # that in some cases like when running on JRuby is not
+ # that in some cases like when running on JRuby is not
# succifient for our purpose:
#
# For JRuby, the value for RUBY_PLATFORM will always be 'java'
@@ -77,7 +77,7 @@
path
end
end
-
+
# Return the timestamp of file, without having to create a file task
def timestamp(file)
if File.exist?(file)
@@ -121,7 +121,7 @@
# Install gems specified by each Gem::Dependency if they are missing. This method prompts the user
# for permission before installing anything.
- #
+ #
# Returns the installed Gem::Dependency objects or fails if permission not granted or when buildr
# is not running interactively (on a tty)
def install(*dependencies)
@@ -334,11 +334,11 @@
end
private :mv
end
-
+
module RakeFileUtils #:nodoc:
def rake_merge_option(args, defaults)
defaults[:verbose] = false if defaults[:verbose] == :default
-
+
if Hash === args.last
defaults.update(args.last)
args.pop
@@ -348,56 +348,56 @@
end
private :rake_merge_option
end
-
+
module Buildr
class ProcessStatus
attr_reader :pid, :termsig, :stopsig, :exitstatus
-
+
def initialize(pid, success, exitstatus)
@pid = pid
@success = success
@exitstatus = exitstatus
-
+
@termsig = nil
@stopsig = nil
end
-
+
def &(num)
pid & num
end
-
+
def ==(other)
pid == other.pid
end
-
+
def >>(num)
pid >> num
end
-
+
def coredump?
false
end
-
+
def exited?
true
end
-
+
def stopped?
false
end
-
+
def success?
@success
end
-
+
def to_i
pid
end
-
+
def to_int
pid
end
-
+
def to_s
pid.to_s
end
@@ -406,21 +406,21 @@
module FileUtils
extend FFI::Library
-
+
ffi_lib FFI::Platform::LIBC if Buildr::Util::win_os?
-
+
alias_method :__jruby_system__, :system
attach_function :system, [:string], :int
alias_method :__native_system__, :system
alias_method :system, :__jruby_system__
-
+
# code "borrowed" directly from Rake
def sh(*cmd, &block)
options = (Hash === cmd.last) ? cmd.pop : {}
unless block_given?
show_command = cmd.join(" ")
show_command = show_command[0,42] + "..."
-
+
block = lambda { |ok, status|
ok or fail "Command failed with status (#{status.exitstatus}): [#{show_command}]"
}
@@ -436,7 +436,7 @@
unless options[:noop]
cd = "cd '#{Dir.pwd}' && "
args = if cmd.size > 1 then cmd[1..cmd.size] else [] end
-
+
res = if Buildr::Util.win_os? && cmd.size == 1
__native_system__("#{cd} call #{cmd.first}")
else
@@ -457,7 +457,7 @@
unless block_given?
show_command = cmd.join(" ")
show_command = show_command[0,42] + "..."
-
+
block = lambda { |ok, status|
ok or fail "Command failed with status (#{status.exitstatus}): [#{show_command}]"
}
@@ -473,14 +473,14 @@
unless options[:noop]
cd = "cd '#{Dir.pwd}' && "
args = if cmd.size > 1 then cmd[1..cmd.size] else [] end
-
+
res = if Buildr::Util.win_os? && cmd.size == 1
system("#{cd} call #{cmd.first}")
else
arg_str = args.map { |a| "'#{a}'" }
system(cd + cmd.first + ' ' + arg_str.join(' '))
end
-
+
block.call(res, $?)
end
end
Modified: buildr/trunk/lib/buildr/groovy/bdd.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/groovy/bdd.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/groovy/bdd.rb (original)
+++ buildr/trunk/lib/buildr/groovy/bdd.rb Fri Mar 5 05:48:49 2010
@@ -20,7 +20,7 @@
# To use in your project:
#
# test.using :easyb
- #
+ #
# This framework will search in your project for:
# src/spec/groovy/**/*Story.groovy
# src/spec/groovy/**/*Specification.groovy
@@ -69,7 +69,7 @@
def run(tests, dependencies) #:nodoc:
options = { :format => :txt }.merge(self.options).only(*OPTIONS)
-
+
if :txt == options[:format]
easyb_format, ext = 'txtstory', '.txt'
elsif :xml == options[:format]
@@ -77,7 +77,7 @@
else
raise "Invalid format #{options[:format]} expected one of :txt :xml"
end
-
+
cmd_args = [ 'org.disco.easyb.BehaviorRunner' ]
cmd_options = { :properties => options[:properties],
:java_args => options[:java_args],
@@ -98,9 +98,9 @@
end
end
end
-
+
end # EasyB
-
+
end
Buildr::TestFramework << Buildr::Groovy::EasyB
Modified: buildr/trunk/lib/buildr/groovy/shell.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/groovy/shell.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/groovy/shell.rb (original)
+++ buildr/trunk/lib/buildr/groovy/shell.rb Fri Mar 5 05:48:49 2010
@@ -19,24 +19,24 @@
module Groovy
class GroovySH < Buildr::Shell::Base
SUFFIX = if Util.win_os? then '.bat' else '' end
-
+
class << self
def lang
:groovy
end
end
-
+
def launch
fail 'Are we forgetting something? GROOVY_HOME not set.' unless groovy_home
-
- cp = project.compile.dependencies.join(File::PATH_SEPARATOR) +
+
+ cp = project.compile.dependencies.join(File::PATH_SEPARATOR) +
File::PATH_SEPARATOR + project.path_to(:target, :classes)
-
+
cmd_args = " -classpath '#{cp}'"
trace "groovysh #{cmd_args}"
system(File.expand_path("bin#{File::SEPARATOR}groovysh#{SUFFIX}", groovy_home) + cmd_args)
end
-
+
private
def groovy_home
@home ||= ENV['GROOVY_HOME']
Modified: buildr/trunk/lib/buildr/ide/idea7x.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/ide/idea7x.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/ide/idea7x.rb (original)
+++ buildr/trunk/lib/buildr/ide/idea7x.rb Fri Mar 5 05:48:49 2010
@@ -90,7 +90,7 @@
ext_libs = m2_libs.map { |path| "jar://#{path.to_s.sub(m2repo, "$M2_REPO$")}!/" }
ext_libs << "#{MODULE_DIR_URL}/#{relative[project.test.resources.target.to_s]}" if project.test.resources.target
ext_libs << "#{MODULE_DIR_URL}/#{relative[project.resources.target.to_s]}" if project.resources.target
-
+
Buildr::Idea7x.generate_module_libs(xml, ext_libs)
xml.orderEntryProperties
end
Modified: buildr/trunk/lib/buildr/java/ant.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/java/ant.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/java/ant.rb (original)
+++ buildr/trunk/lib/buildr/java/ant.rb Fri Mar 5 05:48:49 2010
@@ -26,7 +26,7 @@
# Which version of Ant we're using by default.
VERSION = '1.8.0'
-
+
class << self
# Current version of Ant being used.
def version
@@ -40,14 +40,14 @@
@dependencies ||= ["org.apache.ant:ant:jar:#{version}", "org.apache.ant:ant-launcher:jar:#{version}",
"org.apache.ant:ant-trax:jar:#{version}"]
end
-
+
private
def const_missing(const)
return super unless const == :REQUIRES # TODO: remove in 1.5
Buildr.application.deprecated "Please use Ant.dependencies/.version instead of Ant::REQUIRES/VERSION"
dependencies
end
- end
+ end
Java.classpath << lambda { Ant.dependencies }
Modified: buildr/trunk/lib/buildr/java/compiler.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/java/compiler.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/java/compiler.rb (original)
+++ buildr/trunk/lib/buildr/java/compiler.rb Fri Mar 5 05:48:49 2010
@@ -36,7 +36,7 @@
# * :source -- Source code compatibility.
# * :target -- Bytecode compatibility.
# * :lint -- Lint option is one of true, false (default), name (e.g. 'cast') or array.
- # * :other -- Array of options passed to the compiler
+ # * :other -- Array of options passed to the compiler
# (e.g. ['-implicit:none', '-encoding', 'iso-8859-1'])
class Javac < Base
@@ -74,7 +74,7 @@
private
def javac_args #:nodoc:
- args = []
+ args = []
args << '-nowarn' unless options[:warnings]
args << '-verbose' if Buildr.application.options.trace
args << '-g' if options[:debug]
@@ -90,7 +90,7 @@
end
end
-
+
end
Modified: buildr/trunk/lib/buildr/java/doc.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/java/doc.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/java/doc.rb (original)
+++ buildr/trunk/lib/buildr/java/doc.rb Fri Mar 5 05:48:49 2010
@@ -15,9 +15,9 @@
# doc projects('myapp:foo', 'myapp:bar')
# end
class Javadoc < Base
-
+
specify :language => :java, :source_ext => 'java'
-
+
def generate(sources, target, options = {})
cmd_args = [ '-d', target, Buildr.application.options.trace ? '-verbose' : '-quiet' ]
options.reject { |key, value| [:sourcepath, :classpath].include?(key) }.
Modified: buildr/trunk/lib/buildr/java/emma.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/java/emma.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/java/emma.rb (original)
+++ buildr/trunk/lib/buildr/java/emma.rb Fri Mar 5 05:48:49 2010
@@ -22,16 +22,16 @@
# Provides the <code>emma:html</code> and <code>emma:xml</code> tasks.
# Require explicitly using <code>require "buildr/emma"</code>.
#
- # You can generate emma reports for a single project
+ # You can generate emma reports for a single project
# using the project name as prefix:
#
# project_name:emma:html
#
- # You can also specify which classes to include/exclude from instrumentation by
- # passing a class name regexp to the <code>emma.include</code> or
- # <code>emma.exclude</code> methods.
- #
- # define 'someModule' do
+ # You can also specify which classes to include/exclude from instrumentation by
+ # passing a class name regexp to the <code>emma.include</code> or
+ # <code>emma.exclude</code> methods.
+ #
+ # define 'someModule' do
# emma.include 'some.package.*'
# emma.exclude 'some.foo.util.SimpleUtil'
# end
@@ -58,7 +58,7 @@
end
def ant
-
+
Buildr.ant 'emma' do |ant|
ant.taskdef :resource=>'emma_ant.properties',
:classpath=>Buildr.artifacts(dependencies).each(&:invoke).map(&:to_s).join(File::PATH_SEPARATOR)
@@ -68,18 +68,18 @@
end
end
end
-
+
class EmmaConfig # :nodoc:
-
+
def initialize(project)
@project = project
end
-
+
attr_reader :project
private :project
attr_writer :metadata_file, :coverage_file, :instrumented_dir, :report_dir
-
+
def coverage_file
@coverage_file ||= File.join(report_dir, 'coverage.ec')
end
@@ -95,7 +95,7 @@
def report_dir
@report_dir ||= project.path_to(:reports, :emma)
end
-
+
def report_to format
report_dir
end
@@ -107,7 +107,7 @@
includes.push(*classPatterns)
self
end
-
+
def includes
@includeClasses ||= []
end
@@ -138,7 +138,7 @@
after_define do |project|
emma = project.emma
-
+
namespace 'emma' do
unless project.compile.target.nil?
# Instrumented bytecode goes in a different directory. This task creates before running the test
@@ -155,14 +155,14 @@
touch task.to_s
end
end
-
+
task 'instrument' => instrumented
-
+
# We now have two target directories with bytecode.
project.test.dependencies.unshift emma.instrumented_dir
project.test.with Emma.dependencies
project.test.options[:properties]["emma.coverage.out.file"] = emma.coverage_file
-
+
[:xml, :html].each do |format|
task format => ['instrument', 'test'] do
missing_required_files = [emma.metadata_file, emma.coverage_file].reject { |f| File.exist?(f) }
@@ -192,9 +192,9 @@
project.clean do
rm_rf [emma.report_dir, emma.coverage_file, emma.metadata_file, emma.instrumented_dir]
end
-
+
end
-
+
end
class Buildr::Project
@@ -204,7 +204,7 @@
namespace "emma" do
Project.local_task('instrument') { |name| "Instrumenting #{name}" }
-
+
[:xml, :html].each do |format|
desc "Run the test cases and produce code coverage reports in #{format}"
task format => ['instrument', 'test'] do
@@ -224,13 +224,13 @@
ant.sourcepath do
Buildr.projects.map(&:emma).map(&:sources).flatten.map(&:to_s).each do |src|
ant.dirset :dir=>src if File.exist?(src)
- end
+ end
end
end
end
end
end
-
+
task :clean do
rm_rf [report_to, data_file]
end
Modified: buildr/trunk/lib/buildr/java/jruby.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/java/jruby.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/java/jruby.rb (original)
+++ buildr/trunk/lib/buildr/java/jruby.rb Fri Mar 5 05:48:49 2010
@@ -71,7 +71,7 @@
def classpath
@classpath ||= []
end
-
+
# Most platforms requires tools.jar to be on the classpath, tools.jar contains the
# Java compiler (OS X and AIX are two exceptions we know about, may be more).
# Guess where tools.jar is from JAVA_HOME, which hopefully points to the JDK,
@@ -101,13 +101,13 @@
# Most platforms requires tools.jar to be on the classpath.
add_path[tools_jar] if tools_jar
-
- classpath.map! { |path| Proc === path ? path.call : path }
+
+ classpath.map! { |path| Proc === path ? path.call : path }
Buildr.artifacts(classpath).map(&:to_s).each do |path|
file(path).invoke
add_path[path]
end
-
+
@loaded = true
self
end
Modified: buildr/trunk/lib/buildr/java/jtestr_runner.rb.erb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/java/jtestr_runner.rb.erb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/java/jtestr_runner.rb.erb (original)
+++ buildr/trunk/lib/buildr/java/jtestr_runner.rb.erb Fri Mar 5 05:48:49 2010
@@ -13,12 +13,12 @@
# License for the specific language governing permissions and limitations under
# the License.
-# ___ ___ _ _ ___ _____ ___ ___ ___ _____ _____ _ _ ___ ___
+# ___ ___ _ _ ___ _____ ___ ___ ___ _____ _____ _ _ ___ ___
# | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _| |_ _| || |_ _/ __|
# | |) | (_) | | .` | (_) || | | _|| |) | | | | | | | __ || |\__ \
# |___/ \___/ |_|\_|\___/ |_| |___|___/___| |_| |_| |_||_|___|___/
-#
-# ___ ___ _ ___
+#
+# ___ ___ _ ___
# | __|_ _| | | __| CHANGES TO THIS FILE WILL BE LOST
# | _| | || |__| _| AUTO-GENERATED BY BUILDR on <%= Time.now %>
# |_| |___|____|___| PREFER TO EDIT JtestR CONFIGURATION FILE:
@@ -31,46 +31,46 @@
<%= dependencies.map(&:to_s).inspect %>.each { |dep| $CLASSPATH << dep }
<%= runner.gems.inspect %>.each { |ary| JRuby.gem(*ary.flatten) }
<%= runner.requires.inspect %>.each { |rb| Kernel.require rb }
-
+
jtestr = JtestR::TestRunner.new
-
+
class << jtestr
def config(&block)
@config_blocks ||= []
@config_blocks << block if block
@config_blocks
end
-
+
def load_configuration
super
config.each { |block| @configuration.instance_eval(&block) }
end
end
-
- jtestr.config do
+
+ jtestr.config do
classpath [] # already loaded
add_common_classpath false
-
+
<% ts = ( @jtestr_tests[:junit] & tests ).map { |c| 'Java.' + c } %>
junit [<%= ts.join(', ') %>]
-
+
<% ts = ( @jtestr_tests[:testng] & tests ).map { |c| 'Java.' + c } %>
testng [<%= ts.join(', ') %>]
-
+
<% ts = @jtestr_tests[:testunit] & tests %>
test_unit <%= ts.inspect %>
-
+
<% ts = @jtestr_tests[:story] & tests %>
story <%= ts.inspect %>
-
+
<% ts = @jtestr_tests[:rspec] & tests %>
rspec <%= ts.inspect %>
-
+
<% ts = @jtestr_tests[:expect] & tests %>
expectations <%= ts.inspect %>
-
+
ignore __FILE__
-
+
if File.file?(<%= user_config.inspect %>)
ignore <%= user_config.inspect %>
load <%= user_config.inspect %>
@@ -78,7 +78,7 @@
end # config
fake_out = StringIO.new
-
+
<% if runner.output == false %>
output = fake_out
<% elsif runner.output.kind_of?(String) %>
@@ -86,23 +86,23 @@
<% else %>
output = STDOUT
<% end %>
-
-
+
+
args = [ '<%= spec_dir %>', # the directory to search for jtestr files
JtestR::SimpleLogger::ERR, # log level (DEBUG/WARN/ERR)
JtestR::GenericResultHandler::QUIET, #output level (QUIET/VERBOSE)
fake_out, # output STDOUT
- [], # groups to run
+ [], # groups to run
# Use JtestR::GenericResultHandler for debugging
Buildr::TestFramework::TestResult::RSpecResultHandler, # result handler
[] # classpath
]
-
+
argv = <%= runner.rspec.inspect %> || []
argv.push *<%= tests.inspect %>
Buildr::TestFramework::TestResult::RSpecResultHandler.init(argv, output, output)
Buildr::TestFramework::TestResult::RSpecResultHandler.test_files = <%= tests.inspect %>
-
+
jtestr.run *args
rescue => e
@@ -111,8 +111,8 @@
end
exit 0 # let buildr find the erros from the result yaml
-
+
# Local Variables:
# mode: ruby
# End:
-
+
Modified: buildr/trunk/lib/buildr/java/pom.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/java/pom.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/java/pom.rb (original)
+++ buildr/trunk/lib/buildr/java/pom.rb Fri Mar 5 05:48:49 2010
@@ -28,7 +28,7 @@
attr_reader :parent
class << self
-
+
# :call-seq:
# POM.load(arg)
#
@@ -82,8 +82,8 @@
unless depends = @depends_for_scopes[scopes]
declared = project["dependencies"].first["dependency"] rescue nil
depends = (declared || []).reject { |dep| value_of(dep["optional"]) =~ /true/ }.
- map { |dep|
- spec = pom_to_hash(dep, properties)
+ map { |dep|
+ spec = pom_to_hash(dep, properties)
apply = managed(spec)
spec = apply.merge(spec) if apply
@@ -93,7 +93,7 @@
exclusions = dep["exclusions"]["exclusion"] rescue nil
transitive_deps = POM.load(spec).dependencies(SCOPES_TRANSITIVE)
- transitive_deps = transitive_deps.reject{|dep|
+ transitive_deps = transitive_deps.reject{|dep|
exclusions.find {|ex| dep.index("#{dep['groupdId'].first}:#{dep['artifactId'].first}:") == 0}
} if exclusions
Modified: buildr/trunk/lib/buildr/java/rjb.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/java/rjb.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/java/rjb.rb (original)
+++ buildr/trunk/lib/buildr/java/rjb.rb Fri Mar 5 05:48:49 2010
@@ -71,13 +71,13 @@
end
end
-
+
# On OS X we know where the default JDK is. We can try to guess for other OS.
# We set JAVA_HOME early so we can use it without calling Java.load first.
ENV['JAVA_HOME'] ||= '/System/Library/Frameworks/JavaVM.framework/Home' if Config::CONFIG['host_os'] =~ /darwin/i
class << self
-
+
# Returns the classpath, an array listing directories, JAR files and
# artifacts. Use when loading the extension to add any additional
# libraries used by that extension.
@@ -87,7 +87,7 @@
def classpath
@classpath ||= []
end
-
+
# Most platforms requires tools.jar to be on the classpath, tools.jar contains the
# Java compiler (OS X and AIX are two exceptions we know about, may be more).
# Guess where tools.jar is from JAVA_HOME, which hopefully points to the JDK,
@@ -99,7 +99,7 @@
find { |path| File.exist?(path) }
end
end
-
+
# Loads the JVM and all the libraries listed on the classpath. Call this
# method before accessing any Java class, but only call it from methods
# used in the build, giving the Buildfile a chance to load all extensions
@@ -107,14 +107,14 @@
def load
return self if @loaded
classpath << tools_jar if tools_jar
-
+
classpath.map! { |path| Proc === path ? path.call : path }
cp = Buildr.artifacts(classpath).map(&:to_s).each { |path| file(path).invoke }
java_opts = (ENV['JAVA_OPTS'] || ENV['JAVA_OPTIONS']).to_s.split
::Rjb.load cp.join(File::PATH_SEPARATOR), java_opts
props = ::Rjb.import('java.lang.System').getProperties
- enum = props.propertyNames
+ enum = props.propertyNames
while enum.hasMoreElements
name = enum.nextElement.toString
ENV_JAVA[name] = props.getProperty(name)
Modified: buildr/trunk/lib/buildr/java/tests.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/java/tests.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/java/tests.rb (original)
+++ buildr/trunk/lib/buildr/java/tests.rb Fri Mar 5 05:48:49 2010
@@ -104,7 +104,7 @@
def dependencies
two_or_later = version[0,1].to_i >= 2
group = two_or_later ? "org.jmock" : "jmock"
-
+
@dependencies ||= ["#{group}:jmock:jar:#{version}"]
if two_or_later
@dependencies << "org.jmock:jmock-junit#{Buildr::JUnit.version[0,1]}:jar:#{version}"
Modified: buildr/trunk/lib/buildr/java/version_requirement.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/java/version_requirement.rb?rev=919303&r1=919302&r2=919303&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/java/version_requirement.rb (original)
+++ buildr/trunk/lib/buildr/java/version_requirement.rb Fri Mar 5 05:48:49 2010
@@ -15,11 +15,11 @@
module Buildr
-
+
#
# See ArtifactNamespace#need
class VersionRequirement
-
+
CMP_PROCS = Gem::Requirement::OPS.dup
CMP_REGEX = Gem::Requirement::OP_RE.dup
CMP_CHARS = CMP_PROCS.keys.join
@@ -31,16 +31,16 @@
def version?(str)
/^\s*[#{VER_CHARS}]+\s*$/ === str
end
-
+
# is +str+ a version requirement?
def requirement?(str)
/[#{BOOL_CHARS}#{CMP_CHARS}\(\)]/ === str
end
-
+
# :call-seq:
# VersionRequirement.create(" >1 <2 !(1.5) ") -> requirement
#
- # parse the +str+ requirement
+ # parse the +str+ requirement
def create(str)
instance_eval normalize(str)
rescue StandardError => e
@@ -61,7 +61,7 @@
vreq.negative = !vreq.negative
vreq
end
-
+
def normalize(str)
str = str.strip
if str[/[^\s\(\)#{BOOL_CHARS + VER_CHARS + CMP_CHARS}]/]
@@ -147,7 +147,7 @@
def &(other)
operation(:&, other)
end
-
+
# return the parsed expression
def to_s
str = requirements.map(&:to_s).join(" " + @op.to_s + " ").to_s
@@ -160,7 +160,7 @@
protected
attr_reader :requirements, :op
def operation(op, other)
- @op ||= op
+ @op ||= op
if negative == other.negative && @op == op && other.requirements.size == 1
@requirements << other.requirements.first
self