<commit_before><?xml version="1.0"?>

<!-- ===================================================================
     This file is called by other build files to create web applications.

     It is assumed that no changes will be made to this file. It should be
     possible to make all changes needed by modifying the configuration
     properties or a bedework.build.proeprties file

     An unwrapped web application will be built in the temp directory
     and a war and ear file will be left in the dist directory.

     Properties which must be defined on entry, apart from those described
     in the main build file are:
    app.root.dir       Location of the root directory for the apps
    app.sou.dir        Location of the application skeleton,
    app.name           Name of the application. This wil be used to determine
                       the name of the file containing the rest of the
                       application properties, the directory we build in
                       and the name of war and ear files.
     These should be defined in the build properties for the application.

     It is possible to define any of the app.dest properties below to override
     the location of destination files.

     In the directory
        ${apps.sou.dir}
     we expect an application skeleton formatted like a web-application
     For the purposes of this build it should contain a
     structure like
              war - docs    (contains jsp and html for this app)
                    WEB-INF - struts-config.xml
                              web.xml
                              jboss-web.xml (for jboss only)

     Authors: <NAME>
     =================================================================== -->

<project name="bedework.buildwar" default="build" >
  <import file="${build.dir}/buildfilters.xml" />

  <if>
    <isset property="org.bedework.global.portal.platform" />
    <then>
      <import file="${build.dir}/portals/${org.bedework.global.portal.platform}War.xml" />
    </then>
  </if>

  <import file="${build.dir}/platforms/${org.bedework.global.deploy.platform}War.xml" />

  <target name="init" depends="init.common">
    <if>
      <isset property="org.bedework.global.build.ear" />
      <then>
        <!-- Properties all go into a single jar file at termination -->
        <property name="app.dest.classes"
                  location="${org.bedework.ear.properties.dir}" />
      </then>
      <else>
        <!-- Properties in the war file -->
        <property name="app.dest.classes"
                  location="${app.dest.webinf}/classes" />
      </else>
    </if>
    <property name="app.dest.properties.old"
              location="${app.dest.classes}/properties/calendar" />
    <property name="app.dest.properties"
              location="${app.dest.classes}/properties" />
  </target>

  <target name="init.common">
    <!-- Destinations - where we build an unwrapped war -->
    <property name="app.dest.war"
              location="${org.bedework.temp.wars.home}/${propval.app.war.name}.war" />
    <property name="app.dest.docs"
              location="${app.dest.war}/docs" />
    <property name="app.dest.webinf"
              location="${app.dest.war}/WEB-INF" />
    <property name="app.dest.metainf"
              location="${app.dest.war}/META-INF" />

    <!--temp web.xml location  -->
    <property name="app.temp.web.xml"
              location="${app.dest.webinf}/tempweb.xml" />

    <!--final web.xml location  -->
    <property name="app.dest.web.xml"
              location="${app.dest.webinf}/web.xml" />

    <property name="app.war.file"
              location="${dist.home}/${propval.app.war.name}.war" />

    <!-- default web.xml -->
    <property name="propval.app.web.xml"
              value="war/WEB-INF/web.xml" />

              <!--
    <property name="app.web.xml"
              location="${propval.app.web.xml}" />
              -->
    <resolveFile name="app.web.xml"
                 file="${propval.app.web.xml}"
                 base="${app.sou.dir}"/>

    <property name="app.sou.properties"
              location="${app.sou.dir}/war/WEB-INF/classes/servlet.properties" />
  </target>

  <target name="build" depends="init">
    <echo message="**************************************************" />
    <echo message=" * Building war ${propval.app.war.name}"/>
    <echo message="**************************************************" />

    <delete dir="${app.dest.war}" />

    <!-- Add modifed login pages -->
    <copy todir="${app.dest.docs}/login" failonerror="false" >
      <fileset dir="${org.bedework.common.resources}/login" />
      <filterset>
        <filter token="DISPLAY-NAME" value="${propval.app.display.name}"/>
      </filterset>
    </copy>

    <!-- ===============================================================
         We copy 3 sets of properties.

         First (for struts) are the servlet properties which ends up as
              classes/servlet.properties
         Next we copy in a set of generic property files and then with
         overwrite we copy in a set of base specific files.

         All are updated with new values.
         =============================================================== -->

    <if>
      <available file="${app.sou.dir}/war/docs" type="dir" />
      <then>
        <copy todir="${app.dest.docs}">
          <fileset dir="${app.sou.dir}/war/docs" />
        </copy>
      </then>
    </if>

    <!-- ===============================================================
         Any property files we need for configuration, other than the
         standard struts file, should be in the "${app.sou.dir}/properties
         directory. They will be copied into the appropriate place for the
         war and transformed by the above filter.
         =============================================================== -->

    <!-- Create the runtime options file -->
    <mkdir dir="${app.dest.properties}" />

    <if>
      <available file="${app.sou.dir}/properties" type="dir" />
      <then>
        <copy todir="${app.dest.properties}" overwrite="yes" >
          <fileset dir="${app.sou.dir}/properties"
                   includes="*.properties"/>
          <filterset refid="property.filters" />
        </copy>
      </then>
    </if>

    <copy tofile="${app.dest.properties}/options.xml"
          file="${org.bedework.config.options}" >
      <filterset>
        <filter token="RPI-DEBUG" value="${app.debug.val}"/>
      </filterset>
      <filterset refid="property.filters" />
    </copy>

    <!-- Temp do it again -->
    <mkdir dir="${app.dest.properties.old}" />

    <copy tofile="${app.dest.properties.old}/options.xml"
          file="${org.bedework.config.options}" >
      <filterset>
        <filter token="RPI-DEBUG" value="${app.debug.val}"/>
      </filterset>
      <filterset refid="property.filters" />
    </copy>

    <if>
      <available file="${app.sou.dir}/war/WEB-INF/classes" type="dir" />
      <then>
		    <copy todir="${app.dest.classes}">
		      <fileset dir="${app.sou.dir}/war/WEB-INF/classes"
		               includes="*"/>
		      <filterset refid="property.filters" />
		    </copy>
      </then>
    </if>

  	<!-- Make our own servlet.properties file for struts applications
    <copy tofile="${app.dest.classes}/servlet.properties" file="${app.sou.properties}">
      <filterset refid="property.filters" />
    </copy>
    -->

    <copy tofile="${app.dest.classes}/sysevents.properties"
          file="${org.bedework.config.sysevents.properties}" /><commit_msg>Disable inclusion of any classes in skeleton war<commit_after><?xml version="1.0"?>

<!-- ===================================================================
     This file is called by other build files to create web applications.

     It is assumed that no changes will be made to this file. It should be
     possible to make all changes needed by modifying the configuration
     properties or a bedework.build.proeprties file

     An unwrapped web application will be built in the temp directory
     and a war and ear file will be left in the dist directory.

     Properties which must be defined on entry, apart from those described
     in the main build file are:
    app.root.dir       Location of the root directory for the apps
    app.sou.dir        Location of the application skeleton,
    app.name           Name of the application. This wil be used to determine
                       the name of the file containing the rest of the
                       application properties, the directory we build in
                       and the name of war and ear files.
     These should be defined in the build properties for the application.

     It is possible to define any of the app.dest properties below to override
     the location of destination files.

     In the directory
        ${apps.sou.dir}
     we expect an application skeleton formatted like a web-application
     For the purposes of this build it should contain a
     structure like
              war - docs    (contains jsp and html for this app)
                    WEB-INF - struts-config.xml
                              web.xml
                              jboss-web.xml (for jboss only)

     Authors: <NAME>
     =================================================================== -->

<project name="bedework.buildwar" default="build" >
  <import file="${build.dir}/buildfilters.xml" />

  <if>
    <isset property="org.bedework.global.portal.platform" />
    <then>
      <import file="${build.dir}/portals/${org.bedework.global.portal.platform}War.xml" />
    </then>
  </if>

  <import file="${build.dir}/platforms/${org.bedework.global.deploy.platform}War.xml" />

  <target name="init" depends="init.common">
    <if>
      <isset property="org.bedework.global.build.ear" />
      <then>
        <!-- Properties all go into a single jar file at termination -->
        <property name="app.dest.classes"
                  location="${org.bedework.ear.properties.dir}" />
      </then>
      <else>
        <!-- Properties in the war file -->
        <property name="app.dest.classes"
                  location="${app.dest.webinf}/classes" />
      </else>
    </if>
    <property name="app.dest.properties.old"
              location="${app.dest.classes}/properties/calendar" />
    <property name="app.dest.properties"
              location="${app.dest.classes}/properties" />
  </target>

  <target name="init.common">
    <!-- Destinations - where we build an unwrapped war -->
    <property name="app.dest.war"
              location="${org.bedework.temp.wars.home}/${propval.app.war.name}.war" />
    <property name="app.dest.docs"
              location="${app.dest.war}/docs" />
    <property name="app.dest.webinf"
              location="${app.dest.war}/WEB-INF" />
    <property name="app.dest.metainf"
              location="${app.dest.war}/META-INF" />

    <!--temp web.xml location  -->
    <property name="app.temp.web.xml"
              location="${app.dest.webinf}/tempweb.xml" />

    <!--final web.xml location  -->
    <property name="app.dest.web.xml"
              location="${app.dest.webinf}/web.xml" />

    <property name="app.war.file"
              location="${dist.home}/${propval.app.war.name}.war" />

    <!-- default web.xml -->
    <property name="propval.app.web.xml"
              value="war/WEB-INF/web.xml" />

              <!--
    <property name="app.web.xml"
              location="${propval.app.web.xml}" />
              -->
    <resolveFile name="app.web.xml"
                 file="${propval.app.web.xml}"
                 base="${app.sou.dir}"/>

    <property name="app.sou.properties"
              location="${app.sou.dir}/war/WEB-INF/classes/servlet.properties" />
  </target>

  <target name="build" depends="init">
    <echo message="**************************************************" />
    <echo message=" * Building war ${propval.app.war.name}"/>
    <echo message="**************************************************" />

    <delete dir="${app.dest.war}" />

    <!-- Add modifed login pages -->
    <copy todir="${app.dest.docs}/login" failonerror="false" >
      <fileset dir="${org.bedework.common.resources}/login" />
      <filterset>
        <filter token="DISPLAY-NAME" value="${propval.app.display.name}"/>
      </filterset>
    </copy>

    <!-- ===============================================================
         We copy 3 sets of properties.

         First (for struts) are the servlet properties which ends up as
              classes/servlet.properties
         Next we copy in a set of generic property files and then with
         overwrite we copy in a set of base specific files.

         All are updated with new values.
         =============================================================== -->

    <if>
      <available file="${app.sou.dir}/war/docs" type="dir" />
      <then>
        <copy todir="${app.dest.docs}">
          <fileset dir="${app.sou.dir}/war/docs" />
        </copy>
      </then>
    </if>

    <!-- ===============================================================
         Any property files we need for configuration, other than the
         standard struts file, should be in the "${app.sou.dir}/properties
         directory. They will be copied into the appropriate place for the
         war and transformed by the above filter.
         =============================================================== -->

    <!-- Create the runtime options file -->
    <mkdir dir="${app.dest.properties}" />

    <if>
      <available file="${app.sou.dir}/properties" type="dir" />
      <then>
        <copy todir="${app.dest.properties}" overwrite="yes" >
          <fileset dir="${app.sou.dir}/properties"
                   includes="*.properties"/>
          <filterset refid="property.filters" />
        </copy>
      </then>
    </if>

    <copy tofile="${app.dest.properties}/options.xml"
          file="${org.bedework.config.options}" >
      <filterset>
        <filter token="RPI-DEBUG" value="${app.debug.val}"/>
      </filterset>
      <filterset refid="property.filters" />
    </copy>

    <!-- Temp do it again -->
    <mkdir dir="${app.dest.properties.old}" />

    <copy tofile="${app.dest.properties.old}/options.xml"
          file="${org.bedework.config.options}" >
      <filterset>
        <filter token="RPI-DEBUG" value="${app.debug.val}"/>
      </filterset>
      <filterset refid="property.filters" />
    </copy>

  	<!--
    <if>
      <available file="${app.sou.dir}/war/WEB-INF/classes" type="dir" />
      <then>
		    <copy todir="${app.dest.classes}">
		      <fileset dir="${app.sou.dir}/war/WEB-INF/classes"
		               includes="*"/>
		      <filterset refid="property.filters" />
		    </copy>
      </then>
    </if>
    -->

  	<!-- Make our own servlet.properties file for struts applications
    <copy tofile="${app.dest.classes}/servlet.properties" file="${app.sou.properties}">
      <filterset refid="property.filters" />
    </copy>
    -->

    <copy tofile="${app.dest.classes}/sysevents.properties"
          file="${org.bedework.config.sysevents.properties}" />
{'fraction_non_alphanumeric': 0.20220950877885185, 'fraction_numerical': 0.0003945551390806865, 'mean_word_length': 2.329975914166849, 'pattern_counts': {'":': 0, '<': 216, '<?xml version=': 2, '>': 216, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 44}, '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': '464069', 'n_tokens_mistral': 4250, 'n_tokens_neox': 4069, 'n_words': 1049}