Created
July 28, 2010 20:48
-
-
Save chetan/496243 to your computer and use it in GitHub Desktop.
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
# Buildr project bootstrapper | |
# Chetan Sarva <[email protected]> | |
# | |
# Creates standard java project layout directories and files such as etc, src | |
# and README. | |
# | |
# USAGE | |
# | |
# buildr bootstrap | |
# | |
module BuildrBootstrap | |
include Extension | |
first_time do | |
# Define task not specific to any projet. | |
desc 'Create standard project layout' | |
Project.local_task('bootstrap') | |
end | |
before_define do |project| | |
# # Define the loc task for this particular project. | |
project.task 'bootstrap' do |task, args| | |
BuildrBootstrap.exec(args) | |
end | |
end | |
def bootstrap() | |
task('bootstrap') | |
end | |
def self.exec(args) | |
root = File.dirname(__FILE__) + "/../" | |
%w( | |
etc | |
src | |
src/main | |
src/main/java | |
src/main/resources | |
src/test | |
src/test/java | |
src/test/resources | |
).each { |d| Dir.mkdir(root + d)} | |
FileUtils.touch(root + "README") | |
end | |
end | |
class Buildr::Project | |
include BuildrBootstrap | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment