Sha256: aa846299153216de07cf42e745aac9b71db8574a3acf6dcd73811b0c85386cb0

Contents?: true

Size: 1.2 KB

Versions: 2

Compression:

Stored size: 1.2 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
          configFile = "Warbler::Config.new do |config|\n" +
            "  config.dirs = %w(#{includeDirs.join(' ')})\n" +
            "  config.includes = FileList[\"./*\", \".rcgemfile\"]\n" +
            "  config.excludes = FileList[\"./*.war\",'spec']\nend"
          aFile.write("#{configFile}")
          aFile.close
        else
          puts "Unable to create config/warble.rb file!"
        end
      end
      # 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
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rhoconnect-4.0.0.beta.10 commands/rhoconnect_war/war.rb
rhoconnect-4.0.0.beta.12 commands/rhoconnect_war/war.rb