<commit_before><?xml version="1.0"?>
<project name="GWAP-Subproject" basedir=".">

	<property name="subproject.war.dir" value="${ear.dir}/${subproject.name}_war"/>
	<condition property="subproject.defined">
		<not><matches string="${subproject.name}" pattern="\$\{subproject[0-9]+}"/></not>
	</condition>
	
	<target name="jar" if="subproject.defined" description="Adds additional resources to jar">
		<copy todir="${jar.dir}" failonerror="no">
			<fileset dir="${basedir}/resources/${subproject.name}/jar-resources"/>
		</copy>
	</target>
	
	<target name="war" if="subproject.defined"
		description="Builds a single WAR in a staging directory">
		<echo message="Subproject ${subproject.name}" level="info" />
        <copy todir="${subproject.war.dir}" overwrite="true">
            <fileset dir="${basedir}/view/common"/>
            <fileset dir="${basedir}/view/${subproject.name}"/>
        </copy>
        <copy tofile="${subproject.war.dir}/WEB-INF/classes/components.properties"
            file="${basedir}/resources/components-${profile}.properties">
            <filterset refid="seam"/>
            <filterset refid="profile"/>
        </copy>
		
        <copy todir="${subproject.war.dir}/WEB-INF" overwrite="true">
            <fileset dir="${basedir}/resources/WEB-INF">
                <include name="*.*"/>
                <include name="lib/*.*"/>
                <include name="tags/*.*"/>
                <exclude name="web.xml"/>
            	<exclude name="*.spdia"/>
            </fileset>
        </copy>
        <copy todir="${subproject.war.dir}/WEB-INF" overwrite="true">
            <fileset dir="${basedir}/resources/${subproject.name}/WEB-INF">
                <include name="*.*"/>
                <include name="lib/*.*"/>
                <include name="tags/*.*"/>
                <exclude name="web.xml"/>
            	<exclude name="*.spdia"/>
            	<exclude name="jboss-web.xml"/>
            </fileset>
        </copy>
		<antcall target="jboss-web-xml" inheritrefs="true"></antcall>
		
        <copy todir="${subproject.war.dir}/WEB-INF/lib">
            <fileset dir="${lib.dir}">
                <includesfile name="deployed-jars-war.list"/>
                <exclude name="jboss-seam-gen.jar"/>
                <exclude name="jboss-seam-debug.jar" unless="is.debug"/>
            </fileset>
        </copy>
		
        <copy todir="${subproject.war.dir}/WEB-INF/classes">
            <fileset dir="${basedir}/resources">
                <include name="messages*.properties"/>
                <include name="*.skin.properties" if="richfaces.present"/>
                <include name="*_theme.properties"/>
                <include name="**/*.xcss" if="richfaces.present"/>
            </fileset>
            <!-- move XCSS into classpath for now
                 loading from web context only works in JBoss AS 4 -->
            <fileset dir="${basedir}/view/common">
                <include name="**/*.xcss" if="richfaces.present"/>
            </fileset>
        </copy>
        <copy todir="${subproject.war.dir}/WEB-INF/classes" overwrite="true">
            <fileset dir="${basedir}/resources/${subproject.name}">
                <include name="messages*.properties"/>
                <include name="*.skin.properties" if="richfaces.present"/>
                <include name="*_theme.properties"/>
                <include name="**/*.xcss" if="richfaces.present"/>
            </fileset>
            <!-- move XCSS into classpath for now
                 loading from web context only works in JBoss AS 4 -->
            <fileset dir="${basedir}/view/${subproject.name}">
                <include name="**/*.xcss" if="richfaces.present"/>
            </fileset>
        </copy>
		
        <copy todir="${subproject.war.dir}/WEB-INF">
        	<fileset dir="${basedir}/resources/WEB-INF">
        		<include name="web.xml"/>
        	</fileset>
            <filterset refid="profile"/>
        </copy>
        <copy todir="${subproject.war.dir}/WEB-INF" overwrite="yes">
        	<fileset dir="${basedir}/resources/${subproject.name}/WEB-INF">
        		<include name="web.xml"/>
        	</fileset>
            <filterset refid="profile"/>
        </copy>
    </target>
	
	<target name="jboss-web-xml" if="is.prod">
        <copy todir="${subproject.war.dir}/WEB-INF" overwrite="true"
        	file="${basedir}/resources/${subproject.name}/WEB-INF/jboss-web.xml"/>
	</target>
	
	<target name="ear-application-xml" if="subproject.defined">
		<echo message="Subproject ${subproject.name}" level="info" />
		<replace file="${ear.dir}/META-INF/application.xml" token="&lt;!-- @@${subproject.varname}@@ -->" 
			value="&lt;module&gt; &lt;web&gt; &lt;web-uri&gt;${subproject.name}.war&lt;/web-uri&gt; &lt;context-root&gt;/${subproject.name}&lt;/context-root&gt; &lt;/web&gt; &lt;/module&gt;"></replace>
		<replace file="${ear.dir}/META-INF/application.xml"
			propertyfile="${basedir}/resources/${subproject.name}/WARs/application-xml-additional.properties">
			<replacefilter token="&lt;!-- @@${subproject.varname}.additional@@ -->" property="module"/>
		</replace>
	</target>
	
	<target name="archive" if="subproject.defined">
		<echo message="Subproject ${subproject.name}" level="info" />
		<jar jarfile="${dist.dir}/${subproject.name}.war" basedir="${subproject.war.dir}"/>
		<jar jarfile="${dist.dir}/${project.name}.ear" update="true">
			<fileset dir="${dist.dir}">
	           	<include name="${web.project.name}.war"/>
			</fileset>
		</jar>
	</target>
	
	<target name="explode" if="subproject.defined">
		<echo message="Subproject ${subproject.name}" level="info" />
		<copy todir="${ear.deploy.dir}/${subproject.name}.war">
		    <fileset dir="${subproject.war.dir}"/><commit_msg>removed replace option for quiz<commit_after><?xml version="1.0"?>
<project name="GWAP-Subproject" basedir=".">

	<property name="subproject.war.dir" value="${ear.dir}/${subproject.name}_war"/>
	<condition property="subproject.defined">
		<not><matches string="${subproject.name}" pattern="\$\{subproject[0-9]+}"/></not>
	</condition>
	
	<target name="jar" if="subproject.defined" description="Adds additional resources to jar">
		<copy todir="${jar.dir}" failonerror="no">
			<fileset dir="${basedir}/resources/${subproject.name}/jar-resources"/>
		</copy>
	</target>
	
	<target name="war" if="subproject.defined"
		description="Builds a single WAR in a staging directory">
		<echo message="Subproject ${subproject.name}" level="info" />
        <copy todir="${subproject.war.dir}" overwrite="true">
            <fileset dir="${basedir}/view/common"/>
            <fileset dir="${basedir}/view/${subproject.name}"/>
        </copy>
        <copy tofile="${subproject.war.dir}/WEB-INF/classes/components.properties"
            file="${basedir}/resources/components-${profile}.properties">
            <filterset refid="seam"/>
            <filterset refid="profile"/>
        </copy>
		
        <copy todir="${subproject.war.dir}/WEB-INF" overwrite="true">
            <fileset dir="${basedir}/resources/WEB-INF">
                <include name="*.*"/>
                <include name="lib/*.*"/>
                <include name="tags/*.*"/>
                <exclude name="web.xml"/>
            	<exclude name="*.spdia"/>
            </fileset>
        </copy>
        <copy todir="${subproject.war.dir}/WEB-INF" overwrite="true">
            <fileset dir="${basedir}/resources/${subproject.name}/WEB-INF">
                <include name="*.*"/>
                <include name="lib/*.*"/>
                <include name="tags/*.*"/>
                <exclude name="web.xml"/>
            	<exclude name="*.spdia"/>
            	<exclude name="jboss-web.xml"/>
            </fileset>
        </copy>
		<antcall target="jboss-web-xml" inheritrefs="true"></antcall>
		
        <copy todir="${subproject.war.dir}/WEB-INF/lib">
            <fileset dir="${lib.dir}">
                <includesfile name="deployed-jars-war.list"/>
                <exclude name="jboss-seam-gen.jar"/>
                <exclude name="jboss-seam-debug.jar" unless="is.debug"/>
            </fileset>
        </copy>
		
        <copy todir="${subproject.war.dir}/WEB-INF/classes">
            <fileset dir="${basedir}/resources">
                <include name="messages*.properties"/>
                <include name="*.skin.properties" if="richfaces.present"/>
                <include name="*_theme.properties"/>
                <include name="**/*.xcss" if="richfaces.present"/>
            </fileset>
            <!-- move XCSS into classpath for now
                 loading from web context only works in JBoss AS 4 -->
            <fileset dir="${basedir}/view/common">
                <include name="**/*.xcss" if="richfaces.present"/>
            </fileset>
        </copy>
        <copy todir="${subproject.war.dir}/WEB-INF/classes" overwrite="true">
            <fileset dir="${basedir}/resources/${subproject.name}">
                <include name="messages*.properties"/>
                <include name="*.skin.properties" if="richfaces.present"/>
                <include name="*_theme.properties"/>
                <include name="**/*.xcss" if="richfaces.present"/>
            </fileset>
            <!-- move XCSS into classpath for now
                 loading from web context only works in JBoss AS 4 -->
            <fileset dir="${basedir}/view/${subproject.name}">
                <include name="**/*.xcss" if="richfaces.present"/>
            </fileset>
        </copy>
		
        <copy todir="${subproject.war.dir}/WEB-INF">
        	<fileset dir="${basedir}/resources/WEB-INF">
        		<include name="web.xml"/>
        	</fileset>
            <filterset refid="profile"/>
        </copy>
        <copy todir="${subproject.war.dir}/WEB-INF" overwrite="yes">
        	<fileset dir="${basedir}/resources/${subproject.name}/WEB-INF">
        		<include name="web.xml"/>
        	</fileset>
            <filterset refid="profile"/>
        </copy>
    </target>
	
	<target name="jboss-web-xml" if="is.prod">
        <copy todir="${subproject.war.dir}/WEB-INF" overwrite="true"
        	file="${basedir}/resources/${subproject.name}/WEB-INF/jboss-web.xml"/>
	</target>
	
	<target name="ear-application-xml" if="subproject.defined">
		<echo message="Subproject ${subproject.name}" level="info" />
		<replace file="${ear.dir}/META-INF/application.xml" token="&lt;!-- @@${subproject.varname}@@ -->" 
			value="&lt;module&gt; &lt;web&gt; &lt;web-uri&gt;${subproject.name}.war&lt;/web-uri&gt; &lt;context-root&gt;/${subproject.name}&lt;/context-root&gt; &lt;/web&gt; &lt;/module&gt;"></replace>
	</target>
	
	<target name="archive" if="subproject.defined">
		<echo message="Subproject ${subproject.name}" level="info" />
		<jar jarfile="${dist.dir}/${subproject.name}.war" basedir="${subproject.war.dir}"/>
		<jar jarfile="${dist.dir}/${project.name}.ear" update="true">
			<fileset dir="${dist.dir}">
	           	<include name="${web.project.name}.war"/>
			</fileset>
		</jar>
	</target>
	
	<target name="explode" if="subproject.defined">
		<echo message="Subproject ${subproject.name}" level="info" />
		<copy todir="${ear.deploy.dir}/${subproject.name}.war">
		    <fileset dir="${subproject.war.dir}"/>
{'fraction_non_alphanumeric': 0.20080213903743316, 'fraction_numerical': 0.0010695187165775401, 'mean_word_length': 2.509852987175477, 'pattern_counts': {'":': 0, '<': 224, '<?xml version=': 2, '>': 227, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 24}, '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': '769875', 'n_tokens_mistral': 3585, 'n_tokens_neox': 3366, 'n_words': 547}