Sha256: 6ffb44a4dd52f992458284186f7351798d84b61d1098236bf9f8424416a184aa

Contents?: true

Size: 1.21 KB

Versions: 17

Compression:

Stored size: 1.21 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(':')
      system 'bundle exec warble executable war'
    else
      puts "Cannot build WAR files outside of JRuby environment!"
    end #if
  end #war
end #do

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
rhoconnect-3.4.5 commands/rhoconnect_war/war.rb
rhoconnect-3.4.4 commands/rhoconnect_war/war.rb
rhoconnect-3.4.3 commands/rhoconnect_war/war.rb
rhoconnect-3.4.2 commands/rhoconnect_war/war.rb
rhoconnect-3.3.6 commands/commands/rhoconnect/war.rb
rhoconnect-3.3.5 commands/commands/rhoconnect/war.rb
rhoconnect-3.3.4 commands/commands/rhoconnect/war.rb
rhoconnect-3.3.3 commands/commands/rhoconnect/war.rb
rhoconnect-3.3.2 commands/commands/rhoconnect/war.rb
rhoconnect-3.3.1 commands/commands/rhoconnect/war.rb
rhoconnect-3.3.1.beta4 commands/commands/rhoconnect/war.rb
rhoconnect-3.3.1.beta3 commands/commands/rhoconnect/war.rb
rhoconnect-3.3.1.beta2 commands/commands/rhoconnect/war.rb
rhoconnect-3.2.1 commands/commands/rhoconnect/war.rb
rhoconnect-3.2.0 commands/commands/rhoconnect/war.rb
rhoconnect-3.2.0.beta5 commands/commands/rhoconnect/war.rb
rhoconnect-3.2.0.beta4 commands/commands/rhoconnect/war.rb