Sha256: 73ce7491057c8ea214b7d4e5f2edf5f9630494a82ae46670d22b0d2a9e3adf96

Contents?: true

Size: 1.22 KB

Versions: 21

Compression:

Stored size: 1.22 KB

Contents

Execute.define_task do
  desc "war", "Build executable WAR file to be used in Java App Servers"
  def war
    if jruby? then
      require 'rake'
      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

21 entries across 21 versions & 1 rubygems

Version Path
rhoconnect-7.6.0 commands/rhoconnect_war/war.rb
rhoconnect-7.5.1 commands/rhoconnect_war/war.rb
rhoconnect-7.4.1 commands/rhoconnect_war/war.rb
rhoconnect-7.1.17 commands/rhoconnect_war/war.rb
rhoconnect-6.2.0 commands/rhoconnect_war/war.rb
rhoconnect-6.0.11 commands/rhoconnect_war/war.rb
rhoconnect-5.5.18 commands/rhoconnect_war/war.rb
rhoconnect-5.5.17 commands/rhoconnect_war/war.rb
rhoconnect-5.5.15 commands/rhoconnect_war/war.rb
rhoconnect-5.5.0.22 commands/rhoconnect_war/war.rb
rhoconnect-5.5.2 commands/rhoconnect_war/war.rb
rhoconnect-5.5.0.7 commands/rhoconnect_war/war.rb
rhoconnect-5.5.0.3 commands/rhoconnect_war/war.rb
rhoconnect-5.5.0 commands/rhoconnect_war/war.rb
rhoconnect-5.1.1 commands/rhoconnect_war/war.rb
rhoconnect-4.0.4 commands/rhoconnect_war/war.rb
rhoconnect-4.0.3 commands/rhoconnect_war/war.rb
rhoconnect-4.0.2 commands/rhoconnect_war/war.rb
rhoconnect-4.0.1 commands/rhoconnect_war/war.rb
rhoconnect-4.0.0 commands/rhoconnect_war/war.rb