Skip to content

Commit

Permalink
clean up Rakefile a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
baroquebobcat committed Feb 2, 2011
1 parent 89dcf15 commit 43c86d2
Showing 1 changed file with 9 additions and 26 deletions.
35 changes: 9 additions & 26 deletions Rakefile
@@ -1,6 +1,8 @@
require 'rubygems'
require 'rubygems/package_task'
require 'rake/clean'
require 'bundler/setup'
Bundler.setup

begin
require 'ant'
Expand All @@ -16,24 +18,7 @@ end

task :gem => :jar

neighbor_mirah = File.expand_path '../mirah'

if File.exists?(neighbor_mirah)
ENV['MIRAH_HOME'] ||= neighbor_mirah
end


MIRAH_HOME = ENV['MIRAH_HOME'] ? ENV['MIRAH_HOME'] : Gem.find_files('mirah').first.sub(/lib\/mirah.rb/,'')

if ENV['MIRAH_HOME'] && File.exist?(ENV['MIRAH_HOME'] +'/lib/mirah.rb')
$: << File.expand_path(ENV['MIRAH_HOME'] +'/lib')
end

if File.exist?('../bitescript/lib/bitescript.rb')
$: << File.expand_path('../bitescript/lib/')
end

require 'mirah/appengine_tasks'
require 'dubious_tasks'

OUTDIR = File.expand_path 'build'
SRCDIR = File.expand_path 'src'
Expand All @@ -58,10 +43,9 @@ LIB_SRC = LIB_MIRAH_SRC + LIB_JAVA_SRC
LIB_CLASSES = class_files_for LIB_SRC
STDLIB_CLASSES= LIB_CLASSES.select{|l|l.include? 'stdlib'}

Mirah.dest_paths << OUTDIR
Mirah.source_paths << SRCDIR
Mirah.compiler_options << '--classpath' << [OUTDIR + '/', *FileList["lib/*.jar", "javalib/*.jar"].map{|f|File.expand_path(f)}].join(':')

mirah_compile_options :compiler_options => ['--classpath', [OUTDIR+'/', SERVLET_JAR,*FileList["lib/*.jar", "javalib/*.jar"].map{|f|File.expand_path(f)}].join(':')],
:dest_path => OUTDIR,
:source_paths => SRCDIR

file "#{OUTDIR}/dubious/Inflection.class" => :'compile:java'
file "#{OUTDIR}/dubious/ScopedParameterMap.class" => :'compile:java'
Expand Down Expand Up @@ -107,13 +91,12 @@ namespace :compile do
task :dubious => "lib/dubious.jar"
task :java => OUTDIR do
ant.javac :srcdir => SRCDIR,
:destdir => OUTDIR,
:classpath => CLASSPATH
:destdir => OUTDIR,
:classpath => CLASSPATH,
:includeantruntime => true
end
end

CLASSPATH = [AppEngine::Rake::SERVLET, AppEngine::SDK::API_JAR].join(":")

directory OUTDIR

(LIB_CLASSES).zip(LIB_SRC).each do |klass,src|
Expand Down

0 comments on commit 43c86d2

Please sign in to comment.