require 'rake' require 'jruby-rack' module JrubyWarck module Constants HOME = File.expand_path(File.dirname(__FILE__) + '/../..') unless defined?(HOME) WEB_XML = <<-XML RackFilter org.jruby.rack.RackFilter RackFilter /* <%= context_listener %> XML CONTEXT_LISTENERS = { :rack => "org.jruby.rack.RackServletContextListener", :rails => "org.jruby.rack.rails.RailsServletContextListener" } MANIFEST_MF = <<-MANIFEST Manifest-Version: 1.0 Created-By: jruby-warck Main-Class: org.jruby.JarBootstrapMain Class-Path: /opt/jruby/lib/jruby-complete/jruby-complete.jar #{::JRubyJars.jruby_rack_jar_path} MANIFEST INIT = <<-_INIT # rack.version: #{JRuby::Rack::VERSION} _INIT RUNNING_FROM = Dir.pwd BUILD_DIR = "/tmp/war-#{Time.now.to_i}" WEB_INF = BUILD_DIR + "/WEB-INF" META_INF = BUILD_DIR + "/META-INF" RACKUP_FILE = "config.ru" BOOTSTRAP_ERB = File.read(File.exist?(custom_bootstrap = RUNNING_FROM + "/jar-bootstrap.rb.erb") ? custom_bootstrap : (HOME + "/lib/templates/jar-bootstrap.rb.erb")) # additional filename patterns to be included inside the archive # default is all yml files SELECT_FILES = FileList[IO.readlines(Dir.pwd + "/select.files").map(&:chomp).reject { |line| line.each_char.first == "#" }] rescue FileList["**/*.yml", "**/*.erb"] # filename patterns to be rejected from the archive # default is none REJECT_FILES = FileList[IO.readlines(Dir.pwd + "/reject.files").map(&:chomp).reject { |line| line.each_char.first == "#" }] rescue FileList[] end end