Module: Buildr::Ant
Constant Summary collapse
- VERSION =
Which version of Ant we’re using by default.
'1.7.1'
Class Method Summary collapse
-
.dependencies ⇒ Object
Ant classpath dependencies.
-
.version ⇒ Object
Current version of Ant being used.
Instance Method Summary collapse
-
#ant(name, &block) ⇒ Object
:call-seq: ant(name) { |AntProject| … } => AntProject.
Class Method Details
.dependencies ⇒ Object
Ant classpath dependencies.
37 38 39 40 41 42 |
# File 'lib/buildr/java/ant.rb', line 37 def dependencies # Ant-Trax required for running the JUnitReport task, and there's no other place # to put it but the root classpath. @dependencies ||= ["org.apache.ant:ant:jar:#{version}", "org.apache.ant:ant-launcher:jar:#{version}", "org.apache.ant:ant-trax:jar:#{version}"] end |
Instance Method Details
#ant(name, &block) ⇒ Object
:call-seq:
ant(name) { |AntProject| ... } => AntProject
Creates a new AntProject with the specified name, yield to the block for defining various Ant tasks, and executes each task as it’s defined.
For example:
ant("hibernatedoclet') do |doclet|
doclet.taskdef :name=>'hibernatedoclet',
:classname=>'xdoclet.modules.hibernate.HibernateDocletTask', :classpath=>DOCLET
doclet.hibernatedoclet :destdir=>dest_dir, :force=>'true' do
hibernate :version=>'3.0'
fileset :dir=>source, :includes=>'**/*.java'
end
end
70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/buildr/java/ant.rb', line 70 def ant(name, &block) = { :name=>name, :basedir=>Dir.pwd, :declarative=>true } .merge!(:logger=> Logger.new(STDOUT), :loglevel=> Logger::DEBUG) if Buildr.application..trace Java.load Antwrap::AntProject.new().tap do |project| # Set Ant logging level to debug (--trace), info (default) or error only (--quiet). project.project.getBuildListeners().get(0). setMessageOutputLevel((Buildr.application..trace && 4) || (verbose && 2) || 0) yield project if block_given? end end |