Sha256: 097a15c37b5413a3fd29e93ffbbdd1c7128d62441ef8f5739680cc6c9045f52e

Contents?: true

Size: 1.19 KB

Versions: 3

Compression:

Stored size: 1.19 KB

Contents

Execute.define_task do
  desc "war", "Build executable WAR file to be used in Java App Servers"
  def war
    if jruby? then
      puts "building the WAR file"
      if not File::exists? "config/warble.rb"
        puts "generating Warbler's config file"
        includeDirs = []
        Dir.mkdir('config') if not File.exists?('config')
        aFile = File.new("config/warble.rb", "w+")
        if aFile
          includeDirs = FileList['*'].exclude do |entry|
            entry if (not File.directory? entry) || (entry == 'spec')
          end #if
          configFile = "Warbler::Config.new do |config|\n" +
            "config.dirs = %w(#{includeDirs.join(' ')})\n" +
            "config.includes = FileList[\"./*\"]\n" +
            "config.excludes = FileList[\"./*.war\",'spec']\nend"
          aFile.write("#{configFile}")
          aFile.close
        else
          puts "Unable to create config/warble.rb file!"
        end #if
      end #if
      # build the executable WAR using the config/warble.rb file
      ENV['BUNDLE_WITHOUT'] = ['development','test'].join(':')
      sh 'warble executable war'
    else
      puts "Cannot build WAR files outside of JRuby environment!"
    end #if
  end #war
end #do

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rhoconnect-3.2.0.beta3 commands/commands/rhoconnect/war.rb
rhoconnect-3.2.0.beta2 commands/commands/rhoconnect/war.rb
rhoconnect-3.2.0.beta1 commands/commands/rhoconnect/war.rb