Skip to content

Instantly share code, notes, and snippets.

@chetan
Created July 28, 2010 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chetan/496243 to your computer and use it in GitHub Desktop.
Save chetan/496243 to your computer and use it in GitHub Desktop.
# Buildr project bootstrapper
# Chetan Sarva <csarva@pixelcop.net>
#
# 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