<commit_before><?xml version="1.0" encoding="UTF-8"?>
<project name="org.mwc.debrief.help" default="docbook_to_eclipse" basedir=".">

	<!-- and the cvs-logging related ones -->
	<property name="rootDir" value="../" />
	<property name="scrapRootDir" value="d:/dev/cmap_net" />
	<property name="contribDir" value="${rootDir}/contribs" />
	<property name="sourceDir"
	          value="../"
	          description="top level directory within which all our sources are stored" />
	<property name="deployDir"
	          value="${rootDir}/deploy"
	          description="where we start building the output set" />
	<property name="buildSVNLogDir" value="${deployDir}/svn" />

	<!-- and the docbook/help related bits -->
	<property name="contribDir" value="${rootDir}/contribs" />
	<property name="helpDir" value="./" />
	<property name="helpDest" value="${helpDir}/html/legacy" />
	<property name="pdfDest" value="${helpDir}/html/pdf" />

	<target name="_log1_produce" description="produce the cvs change logs">

		<!-- clear the output directory -->
		<delete dir="${buildSVNLogDir}" />

		<!-- create the output directory if we have to -->
		<mkdir dir="${buildSVNLogDir}" />
		<mkdir dir="${buildSVNLogDir}/statcvs" />

		<!-- produce the CVS log -->
		<echo message="about to log:${sourceDir}" />

		<tstamp>
			<format property="statsvn.start" pattern="yyyy-MM-dd" />
		</tstamp>
		<tstamp>
			<format property="statsvn.stop"
			        pattern="yyyy-MM-dd"
			        offset="-60"
			        unit="day" />
		</tstamp>

		<exec executable="svn"
		      dir="${sourceDir}"
		      output="../deploy/cvs/statcvs.xml">
			<arg line="log" />
			<arg line="-v" />
			<arg line="--xml" />
			<arg line="-r {${statsvn.start}}:{${statsvn.stop}}" />
		</exec>

	</target>

	<target name="_log2_format" description="use the stylesheet tidier">
		<antcall target="_svn_stat_formatter">
			<param name="svn_stat_outputDir"
			       value="${buildSVNLogDir}/statcvs/short" />
			<param name="svn_stat_stylesheet"
			       value="../org.mwc.cmap.installer/statcvs_template/single_page_suite.xml" />
			<param name="svn_stat_outputTitle"
			       value="Abbreviated change statistics" />
		</antcall>

<!--		<antcall target="_svn_stat_formatter">
			<param name="svn_stat_outputDir"
			       value="${buildSVNLogDir}/statcvs/long" />
			<param name="svn_stat_stylesheet"
			       value="../org.mwc.cmap.installer/statcvs_template/suite.xml" />
			<param name="svn_stat_outputTitle"
			       value="Debrief change statistics" />
		</antcall> -->
	</target>

	<target name="_log3_copy"
	        description="copy the tidy cvs logs to the help structure so that they can be included in help-references">
		<copy todir="..\org.mwc.debrief.help\html\history">
			<fileset dir="${buildSVNLogDir}" />
		</copy>
	</target>

	<target name="cvs_log" description="do the steps to produce a cvs log">
		<antcall target="_log1_produce" />
		<antcall target="_log2_format" />
		<antcall target="_log3_copy" />
	</target>

	<target name="clear_output" description="ditch the existing output files">
		<delete dir="${helpDest}" />
	</target>

	<target name="docbook_to_eclipse" description="Generate html from docbook">
		<!-- clear the output directories -->
		<antcall target="clear_output">
		</antcall>

		<!-- generate the output -->
		<mkdir dir="${helpDest}" />
		<mkdir dir="${pdfDest}" />

		<!-- build the history content 
		<antcall target="cvs_log" />-->

		<!-- generate the HTML  -->
		<echo message="Generating HTML" />
		<java classpath="${contribDir}/saxon6_5_2/saxon.jar"
		      fork="yes"
		      dir="${helpDest}"
		      classname="com.icl.saxon.StyleSheet"
		      maxmemory="128m">
			<arg value="../../../org.mwc.debrief.help/docbook/ng_help.xml" />
			<arg value="../../../org.mwc.debrief.help/docbook/eclipse_html_style.xsl" />
		</java>

		<!-- hey, to maintain the correct document locations, we've got to copy the generated content back
		  into the top-level of the docbook output directories -->
		<echo message="Copying HTML" />
		<copy todir="${helpDest}/" preservelastmodified="yes">
			<fileset dir="${helpDest}/html/legacy" />
		</copy> 
		<!-- and delete the duff directory (to stop us getting confused... -->
		<delete dir="${helpDest}/html/legacy" /> 


		<!-- also copy the images to the target directory -->
		<echo message="Copying images" />
		<copy todir="${helpDest}/figures" preservelastmodified="yes">
			<fileset dir="${helpDir}\docbook/figures" />
		</copy>
		<copy todir="${helpDest}/images" preservelastmodified="yes">
			<fileset dir="${helpDir}/docbook/images" />
		</copy>
		<!-- and the stylesheet -->
		<echo message="Copying stylesheet" />
		<copy todir="${helpDest}" preservelastmodified="yes">
			<fileset file="${helpDir}/docbook/Header.css" />
		</copy>

		<!-- make sure the help file gets moved across -->
		<echo message="Copying stylesheet" />
		<copy file="${helpDir}/docbook/Header.css"
		      verbose="true"
		      failonerror="true"
		      todir="${helpDest}"
		      preservelastmodified="yes" />

		<!-- try to insert our additional section content -->
		<echo message="Inserting history" />
		<antcall target="insert_history_link" />

		<!-- lastly, do the pdf stage -->
		<antcall target="docbook_to_pdf"></antcall>
		
	</target>


	<target name="docbook_to_pdf"  description="Generate html from docbook">

		<property name="fopVersion"
		          value="fop-0.94"
		          description="the current version of FOP" />
		<property name="fopDir"
		          value="${rootDir}/contribs/${fopVersion}"
		          description="where the fop libraries are located" />
		<property name="docName"
		          value="DebriefNG.pdf"
		          description="The Debrief document file" />
		<property name="xml.dir"
		          value="docbook"
		          description="where our docbook sources are" />
		
		<property name="pdfDestination" value="../org.mwc.debrief.help.feature/root_installs"/>
		<echo message="Ditching old pdf"/>
		<delete file="${pdfDestination}/${docName}"/>

		<echo message="ditching old fo document"/>
		<delete file="${rootDir}/org.mwc.debrief.help/docbook/out.fo" />

		<!-- produce the FO file, ready for PDF -->
		<echo message="going from xml to FO" />
		<property name="docbook.home"    value="${rootDir}/contribs/docbook-xsl-1.72.0"/>
		<property name="saxon.dir"       value="${rootDir}/contribs/saxon6_5_2"/>
		<property name="xml.dir"         value="${helpDir}docbook"/>
		<property name="fo.dir"          value="fo"/>
		<xslt style="${xml.dir}/fo_style.xsl"
		      classpath="${saxon.dir}/saxon.jar"
		      in="${xml.dir}/ng_help.xml"
		      out="${xml.dir}/out.fo" />

		<echo message="output to fo complete, now going to pdf" />		

		<taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop">
			<classpath>
				<pathelement location="${fopDir}/build/fop.jar" />
				<pathelement location="${fopDir}/lib/avalon-framework-4.2.0.jar" />
				<pathelement location="${fopDir}/lib/batik-all-1.6.jar" />
				<pathelement location="${fopDir}/lib/commons-logging-1.0.4.jar" />
				<pathelement location="${fopDir}/lib/xmlgraphics-commons-1.2.jar" />
				<pathelement location="${fopDir}/lib/commons-io-1.3.1.jar" />
			</classpath><commit_msg>reflect updated libs in new FOP<commit_after><?xml version="1.0" encoding="UTF-8"?>
<project name="org.mwc.debrief.help" default="docbook_to_eclipse" basedir=".">

	<!-- and the cvs-logging related ones -->
	<property name="rootDir" value="../" />
	<property name="scrapRootDir" value="d:/dev/cmap_net" />
	<property name="contribDir" value="${rootDir}/contribs" />
	<property name="sourceDir"
	          value="../"
	          description="top level directory within which all our sources are stored" />
	<property name="deployDir"
	          value="${rootDir}/deploy"
	          description="where we start building the output set" />
	<property name="buildSVNLogDir" value="${deployDir}/svn" />

	<!-- and the docbook/help related bits -->
	<property name="contribDir" value="${rootDir}/contribs" />
	<property name="helpDir" value="./" />
	<property name="helpDest" value="${helpDir}/html/legacy" />
	<property name="pdfDest" value="${helpDir}/html/pdf" />

	<target name="_log1_produce" description="produce the cvs change logs">

		<!-- clear the output directory -->
		<delete dir="${buildSVNLogDir}" />

		<!-- create the output directory if we have to -->
		<mkdir dir="${buildSVNLogDir}" />
		<mkdir dir="${buildSVNLogDir}/statcvs" />

		<!-- produce the CVS log -->
		<echo message="about to log:${sourceDir}" />

		<tstamp>
			<format property="statsvn.start" pattern="yyyy-MM-dd" />
		</tstamp>
		<tstamp>
			<format property="statsvn.stop"
			        pattern="yyyy-MM-dd"
			        offset="-60"
			        unit="day" />
		</tstamp>

		<exec executable="svn"
		      dir="${sourceDir}"
		      output="../deploy/cvs/statcvs.xml">
			<arg line="log" />
			<arg line="-v" />
			<arg line="--xml" />
			<arg line="-r {${statsvn.start}}:{${statsvn.stop}}" />
		</exec>

	</target>

	<target name="_log2_format" description="use the stylesheet tidier">
		<antcall target="_svn_stat_formatter">
			<param name="svn_stat_outputDir"
			       value="${buildSVNLogDir}/statcvs/short" />
			<param name="svn_stat_stylesheet"
			       value="../org.mwc.cmap.installer/statcvs_template/single_page_suite.xml" />
			<param name="svn_stat_outputTitle"
			       value="Abbreviated change statistics" />
		</antcall>

<!--		<antcall target="_svn_stat_formatter">
			<param name="svn_stat_outputDir"
			       value="${buildSVNLogDir}/statcvs/long" />
			<param name="svn_stat_stylesheet"
			       value="../org.mwc.cmap.installer/statcvs_template/suite.xml" />
			<param name="svn_stat_outputTitle"
			       value="Debrief change statistics" />
		</antcall> -->
	</target>

	<target name="_log3_copy"
	        description="copy the tidy cvs logs to the help structure so that they can be included in help-references">
		<copy todir="..\org.mwc.debrief.help\html\history">
			<fileset dir="${buildSVNLogDir}" />
		</copy>
	</target>

	<target name="cvs_log" description="do the steps to produce a cvs log">
		<antcall target="_log1_produce" />
		<antcall target="_log2_format" />
		<antcall target="_log3_copy" />
	</target>

	<target name="clear_output" description="ditch the existing output files">
		<delete dir="${helpDest}" />
	</target>

	<target name="docbook_to_eclipse" description="Generate html from docbook">
		<!-- clear the output directories -->
		<antcall target="clear_output">
		</antcall>

		<!-- generate the output -->
		<mkdir dir="${helpDest}" />
		<mkdir dir="${pdfDest}" />

		<!-- build the history content 
		<antcall target="cvs_log" />-->

		<!-- generate the HTML  -->
		<echo message="Generating HTML" />
		<java classpath="${contribDir}/saxon6_5_2/saxon.jar"
		      fork="yes"
		      dir="${helpDest}"
		      classname="com.icl.saxon.StyleSheet"
		      maxmemory="128m">
			<arg value="../../../org.mwc.debrief.help/docbook/ng_help.xml" />
			<arg value="../../../org.mwc.debrief.help/docbook/eclipse_html_style.xsl" />
		</java>

		<!-- hey, to maintain the correct document locations, we've got to copy the generated content back
		  into the top-level of the docbook output directories -->
		<echo message="Copying HTML" />
		<copy todir="${helpDest}/" preservelastmodified="yes">
			<fileset dir="${helpDest}/html/legacy" />
		</copy> 
		<!-- and delete the duff directory (to stop us getting confused... -->
		<delete dir="${helpDest}/html/legacy" /> 


		<!-- also copy the images to the target directory -->
		<echo message="Copying images" />
		<copy todir="${helpDest}/figures" preservelastmodified="yes">
			<fileset dir="${helpDir}\docbook/figures" />
		</copy>
		<copy todir="${helpDest}/images" preservelastmodified="yes">
			<fileset dir="${helpDir}/docbook/images" />
		</copy>
		<!-- and the stylesheet -->
		<echo message="Copying stylesheet" />
		<copy todir="${helpDest}" preservelastmodified="yes">
			<fileset file="${helpDir}/docbook/Header.css" />
		</copy>

		<!-- make sure the help file gets moved across -->
		<echo message="Copying stylesheet" />
		<copy file="${helpDir}/docbook/Header.css"
		      verbose="true"
		      failonerror="true"
		      todir="${helpDest}"
		      preservelastmodified="yes" />

		<!-- try to insert our additional section content -->
		<echo message="Inserting history" />
		<antcall target="insert_history_link" />

		<!-- lastly, do the pdf stage -->
		<antcall target="docbook_to_pdf"></antcall>
		
	</target>


	<target name="docbook_to_pdf"  description="Generate html from docbook">

		<property name="fopVersion"
		          value="fop-0.95"
		          description="the current version of FOP" />
		<property name="fopDir"
		          value="${rootDir}/contribs/${fopVersion}"
		          description="where the fop libraries are located" />
		<property name="docName"
		          value="DebriefNG.pdf"
		          description="The Debrief document file" />
		<property name="xml.dir"
		          value="docbook"
		          description="where our docbook sources are" />
		
		<property name="pdfDestination" value="../org.mwc.debrief.help.feature/root_installs"/>
		<echo message="Ditching old pdf"/>
		<delete file="${pdfDestination}/${docName}"/>

		<echo message="ditching old fo document"/>
		<delete file="${rootDir}/org.mwc.debrief.help/docbook/out.fo" />

		<!-- produce the FO file, ready for PDF -->
		<echo message="going from xml to FO" />
		<property name="docbook.home"    value="${rootDir}/contribs/docbook-xsl-1.72.0"/>
		<property name="saxon.dir"       value="${rootDir}/contribs/saxon6_5_2"/>
		<property name="xml.dir"         value="${helpDir}docbook"/>
		<property name="fo.dir"          value="fo"/>
		<xslt style="${xml.dir}/fo_style.xsl"
		      classpath="${saxon.dir}/saxon.jar"
		      in="${xml.dir}/ng_help.xml"
		      out="${xml.dir}/out.fo" />

		<echo message="output to fo complete, now going to pdf" />		

		<taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop">
			<classpath>
				<pathelement location="${fopDir}/build/fop.jar" />
				<pathelement location="${fopDir}/lib/avalon-framework-4.2.0.jar" />
				<pathelement location="${fopDir}/lib/batik-all-1.7.jar" />
				<pathelement location="${fopDir}/lib/commons-logging-1.0.4.jar" />
				<pathelement location="${fopDir}/lib/xmlgraphics-commons-1.3.1.jar" />
				<pathelement location="${fopDir}/lib/commons-io-1.3.1.jar" />
			</classpath>
{'fraction_non_alphanumeric': 0.17995302569770655, 'fraction_numerical': 0.005595468361425808, 'mean_word_length': 3.388299484692331, 'pattern_counts': {'":': 0, '<': 269, '<?xml version=': 2, '>': 269, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 28}, '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': '2359497', 'n_tokens_mistral': 5205, 'n_tokens_neox': 4624, 'n_words': 964}