Created
May 29, 2013 21:13
-
-
Save chetan/5673887 to your computer and use it in GitHub Desktop.
Buildr classpath helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module BuildrClasspath | |
include Extension | |
first_time do | |
# Define task not specific to any projet. | |
desc 'Create classpath for passing to java command' | |
Project.local_task('classpath') | |
end | |
before_define do |project| | |
project.recursive_task 'classpath' do |task| | |
# called when the task is actually executed | |
# i.e., via | |
# $ buildr classpath | |
paths = [] | |
project.compile.dependencies.each { |d| paths << d.to_s } | |
project.test.dependencies.each { |d| paths << d.to_s } | |
puts paths.sort.uniq.join(":") | |
end | |
end | |
end | |
class Buildr::Project | |
include BuildrClasspath | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment