<commit_before>require "rubygems"
# ruby superclassmismatch when loading buildr before rubyzip
# so leave this here
# gem 'rubyzip'
# require 'zip/zip'
# require 'zip/zipfilesystem'

gem "buildr",">=1.3.3"
require "buildr"
require "pp"

# The goal of this script is to
#
# [1] create a release of tomcat+tempo+ode that can run out of the box
# [2] create a release of liferay+tempo+ode that can run out of the box
# [3] create a release of liferay+ui or tomcat+ui that connects to a standalone server, with or without opensso
# [4] create a set of files that can be expanded into a liferay server to configure ui-fw
# [5] create an OpenSSO standalone bundle
#
# Created: 2009-03-04
#
# Author: Nico: nico at intalio dot com

OPENSSO_SERVER = "com.sun.opensso:server:war:8.0"

# loading repositories, dependencies files to locate artifacts
@@script_folder = File.dirname(File.expand_path("#{$0}"))
load "#{@@script_folder}/../scripts/lib/build_support.rb"
load "#{@@script_folder}/../build/repositories.rb"
load "#{@@script_folder}/../build/dependencies.rb"
load "#{@@script_folder}/../scripts/lib/bundle_servers.rb"
load "#{@@script_folder}/../scripts/lib/bundle_opensso.rb"
load "#{@@script_folder}/../scripts/lib/bundle_standalone.rb"
load "#{@@script_folder}/../scripts/lib/bundle_liferay_uifw.rb"
load "#{@@script_folder}/../scripts/lib/bundle_jetty.rb"
# load "#{@@script_folder}/../scripts/config.rb"
TEMPO_SVN="#{@@script_folder}/../.."


class TempoBuilder  
  include BuildActivate
  include Buildr

  def build cconfig, show_steps=false
    Dir.chdir check_folder(cconfig[:directory])
    @config=cconfig
    pp @config
    @show_steps = show_steps

    # Create a standalone opensso server
    # opensso server 8.0 needs tomcat6
    activate_step [BuildMode::TOMCAT6,BuildMode::OPENSSO_SERVER], "Creating OpenSSO Bundle" do
      install_tomcat6 "tomcat-sso"
      install_opensso

      set_tomcat_ports({"8005"=>"7005","8080"=>"7080", "8443"=>"7443", "8009"=> "7009"})
    end

    # Create a standalone cas server
    activate_step [BuildMode::TOMCAT5,BuildMode::CAS], "Creating CAS Bundle" do
      install_tomcat
      install_cas
      config_ssl
    end
    
    # Create a standalone Liferay server
    activate_step [BuildMode::LIFERAY], "Installing Liferay" do
      install_liferay
      if BUILD_CONFIG[:liferay][:server_folder].index("jboss")
      else
        # Uncomment the following if necessary(only works for liferay-tomcat bundle for now)
        #setup_axis_and_ode
        #install_tempo_services
        #install_tempo_webapps
        #install_tmp
        #install_absence_request
        # copy_missing_lib
        configure_tomcat<commit_msg>fix the ui-fw portlet missing in liferay_ee(tomcat) application list<commit_after>require "rubygems"
# ruby superclassmismatch when loading buildr before rubyzip
# so leave this here
# gem 'rubyzip'
# require 'zip/zip'
# require 'zip/zipfilesystem'

gem "buildr",">=1.3.3"
require "buildr"
require "pp"

# The goal of this script is to
#
# [1] create a release of tomcat+tempo+ode that can run out of the box
# [2] create a release of liferay+tempo+ode that can run out of the box
# [3] create a release of liferay+ui or tomcat+ui that connects to a standalone server, with or without opensso
# [4] create a set of files that can be expanded into a liferay server to configure ui-fw
# [5] create an OpenSSO standalone bundle
#
# Created: 2009-03-04
#
# Author: Nico: nico at intalio dot com

OPENSSO_SERVER = "com.sun.opensso:server:war:8.0"

# loading repositories, dependencies files to locate artifacts
@@script_folder = File.dirname(File.expand_path("#{$0}"))
load "#{@@script_folder}/../scripts/lib/build_support.rb"
load "#{@@script_folder}/../build/repositories.rb"
load "#{@@script_folder}/../build/dependencies.rb"
load "#{@@script_folder}/../scripts/lib/bundle_servers.rb"
load "#{@@script_folder}/../scripts/lib/bundle_opensso.rb"
load "#{@@script_folder}/../scripts/lib/bundle_standalone.rb"
load "#{@@script_folder}/../scripts/lib/bundle_liferay_uifw.rb"
load "#{@@script_folder}/../scripts/lib/bundle_jetty.rb"
# load "#{@@script_folder}/../scripts/config.rb"
TEMPO_SVN="#{@@script_folder}/../.."


class TempoBuilder  
  include BuildActivate
  include Buildr

  def build cconfig, show_steps=false
    Dir.chdir check_folder(cconfig[:directory])
    @config=cconfig
    pp @config
    @show_steps = show_steps

    # Create a standalone opensso server
    # opensso server 8.0 needs tomcat6
    activate_step [BuildMode::TOMCAT6,BuildMode::OPENSSO_SERVER], "Creating OpenSSO Bundle" do
      install_tomcat6 "tomcat-sso"
      install_opensso

      set_tomcat_ports({"8005"=>"7005","8080"=>"7080", "8443"=>"7443", "8009"=> "7009"})
    end

    # Create a standalone cas server
    activate_step [BuildMode::TOMCAT5,BuildMode::CAS], "Creating CAS Bundle" do
      install_tomcat
      install_cas
      config_ssl
    end
    
    # Create a standalone Liferay server
    activate_step [BuildMode::LIFERAY], "Installing Liferay" do
      install_liferay
      if BUILD_CONFIG[:liferay][:server_folder].index("jboss")
      else
        # Uncomment the following if necessary(only works for liferay-tomcat bundle for now)
        #setup_axis_and_ode
        #install_tempo_services
        #install_tempo_webapps
        #install_tmp
        #install_absence_request
        locate_and_copy(LOG4J, @@lib_folder)
        configure_tomcat
{'fraction_non_alphanumeric': 0.1224452218744246, 'fraction_numerical': 0.021174737617381697, 'mean_word_length': 4.095684803001876, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4501303', 'n_tokens_mistral': 1872, 'n_tokens_neox': 1783, 'n_words': 460}