Skip to content

Instantly share code, notes, and snippets.

@calavera
Created April 16, 2010 21:56
Show Gist options
  • Save calavera/369022 to your computer and use it in GitHub Desktop.
Save calavera/369022 to your computer and use it in GitHub Desktop.
require 'ant'
require 'fileutils'
include FileUtils
TARGET_DIR = 'target'
LIBS_DIR = 'trinidad-libs'
JAR_NAME = 'trinidad-daemon-extension.jar'
namespace :ant do
desc 'clean the java target directory'
task :clean do
rm_r TARGET_DIR
rm "#{LIBS_DIR}/#{JAR_NAME}"
end
desc 'Compile the java classes'
task :build do
opts = {
:fork => 'true',
:failonerror => 'true',
:srcdir => 'src/main',
:destdir => TARGET_DIR
:classpath => Dir.glob('trinidad-libs/*.jar').join(':')
}
mkdir_p TARGET_DIR
ant.javac(opts)
end
desc 'Create the jar file'
task :jar => :build do
opts = {
:destfile => "#{LIBS_DIR}/#{JAR_NAME}",
:basedir => TARGET_DIR
}
ant.jar(opts)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment