Created
April 16, 2010 21:56
-
-
Save calavera/369022 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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