<commit_before><?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
 Copyright (c) 2000-2015 <NAME>

 All rights reserved. This program and the accompanying materials
 are made available under the terms of the Eclipse Public License v1.0
 which accompanies this distribution, and is available at
 http://www.eclipse.org/legal/epl-v10.html
 -->
<project basedir="." default="updatesite.experimental" name="build_main" xmlns:if="ant:if" xmlns:unless="ant:unless">
	
	<import file="build_import.xml"/>

	<target name="init">
		<mkdir dir="${build.dir}"/>
		<mkdir dir="${result.dir}"/>
		<mkdir dir="${log.dir}"/>
		<mkdir dir="${log.dir}/error"/>

			<echo message="LD_LIBRARY_PATH: ${env.LD_LIBRARY_PATH}"/>
			<echo message="JAVA_HOME: ${env.JAVA_HOME}"/>
			<exec executable="ldd" failonerror="true">
				<arg value="/usr/bin/xsltproc"/>
			</exec>
		
	</target>

	<!-- Macro which builds a plugin -->
	<macrodef name="build.plugin">
		<attribute name="name"/>
		<sequential>
			<timestamp.echo message="Building plugin @{name} started" />
			<record name="${log.dir}/plugin_@{name}.txt" action="start"/>
			<ant dir="${build.dir}/@{name}"
				 antfile="${base.dir}/build_@{name}.xml"
				 target="build.jars">
				<property name="build.config" value="${build.config}"/>
			</ant>
			<record name="${log.dir}/plugin_@{name}.txt" action="stop"/>
			<timestamp.echo message="Building plugin @{name} finished" />
		</sequential>
	</macrodef>

	<target name="common.plugin" depends="init">
		<build.plugin name="${common.name}"/>
	</target>

	<target name="designer.plugin" depends="init, common.plugin">
		<build.plugin name="${designer.name}"/>
	</target>

	<target name="executor.plugin" depends="init, common.plugin, designer.plugin">
		<build.plugin name="${executor.name}"/>
	</target>

	<target name="help.plugin" depends="init, common.plugin">
		<build.plugin name="${help.name}"/>
	</target>

	<target name="logviewer.plugin" depends="init, common.plugin">
		<build.plugin name="${logviewer.name}"/>
	</target>

	<target name="debug.plugin" depends="init, common.plugin, designer.plugin">
		<build.plugin name="${debug.name}"/>
	</target>

	<target name="regressiontests.plugin" depends="init, common.plugin, designer.plugin">
		<build.plugin name="${regressiontests.name}"/>
	</target>

	<target name="titanium.plugin" depends="init, common.plugin, designer.plugin">
		<build.plugin name="${titanium.name}"/>
	</target>

	<target name="titanium.regressiontests.plugin" depends="init, titanium.plugin">
		<build.plugin name="${titanium.regressiontests.name}"/>
	</target>

	<!-- Macro which builds a feature -->
	<macrodef name="build.feature">
		<attribute name="dir"/>
		<attribute name="name"/>
		<attribute name="updatesite.name"/>
		<attribute name="updatesite.url"/>
		<sequential>
			<timestamp.echo message="-> build.feature( @{dir}, @{name}, @{updatesite.name}, @{updatesite.url} )" />
			<record name="${log.dir}/feature_@{name}.txt" action="start"/>
            <!--
			<cvs cvsRoot="${cvsRoot}"
				 command="get -d ${build.dir}/@{dir} ${cvs.module}/@{dir}"
				 failonerror="true"/>
                 -->

			<!-- Updating the version qualifier in the feature.xml file -->
			<echo message="Creating ${build.dir}/@{dir}/feature.xml"/>
			<apply executable="xsltproc" output="${build.dir}/@{dir}/feature.xml_unformatted"
				   verbose="true" error="${log.dir}/error/error_@{dir}.log" logError="true" failonerror="true"
				   timeout="60000">
				<arg value="--stringparam"/>
					<arg value="version"/> <arg value="${version.qualifier}"/>
				<arg value="--stringparam"/>
					<arg value="update_site_name"/> <arg value="@{updatesite.name}"/>
				<arg value="--stringparam"/>
					<arg value="update_site_url"/> <arg value="@{updatesite.url}"/>
				<arg value="${base.dir}/feature_xml_transformer.xsl"/>
				<fileset dir="${build.dir}/@{dir}">
					<include name="feature.xml"/>
				</fileset>
			</apply>

			<!-- Formatting the feature.xml file (also checks if the file is valid) -->
			<apply executable="xmllint" output="${build.dir}/@{dir}/feature.xml" failonerror="true"
				error="${log.dir}/error/error_@{dir}_xmllint.log" verbose="true">
				<arg value="--format"/>
				<fileset dir="${build.dir}/@{dir}">
					<include name="feature.xml_unformatted"/>
				</fileset>
			</apply>

	<!-- see https://bugzilla.novell.com/show_bug.cgi?id=485299
			<xslt in="${build.dir}/@{dir}/feature.xml"
				  out="${build.dir}/@{dir}/feature.xml"
				  style="${base.dir}/transform.xsl">
				  <param name="version" expression="${version.qualifier}"/>
				  <param name="update_site_name" expression="@{updatesite.name}"/>
				  <param name="update_site_url" expression="@{updatesite.url}"/>
			</xslt>
	-->
			<mkdir dir="${result.dir}/features"/>
			<jar
				destfile="${result.dir}/features/@{name}_${version.qualifier}.jar"
				basedir="${build.dir}/@{dir}"/>
			<record name="${log.dir}/feature_@{name}.txt" action="stop"/>
		</sequential>
	</macrodef>

	<macrodef name="build.features">
		<attribute name="updatesite.name"/>
		<attribute name="updatesite.url"/>
		<sequential>
			<log message="-> build.features( @{updatesite.name}, @{updatesite.url} )" />

			<build.feature  dir="TITAN_Designer_feature"
							name="TITAN_Designer"
							updatesite.name="@{updatesite.name}"
							updatesite.url="@{updatesite.url}"/>
			<build.feature  dir="TITAN_Executor_feature"
							name="TITAN_Executor"
							updatesite.name="@{updatesite.name}"
							updatesite.url="@{updatesite.url}"/>
			<build.feature  dir="TITAN_Log_Viewer_Feature"
							name="TITAN_Log_Viewer"
							updatesite.name="@{updatesite.name}"
							updatesite.url="@{updatesite.url}"/>
			<build.feature  dir="Titanium_feature"
							name="Titanium"
							updatesite.name="@{updatesite.name}"
							updatesite.url="@{updatesite.url}"/>
			<build.feature  dir="Titan_external_dependencies_feature"
							name="Titan_external_dependencies"
							updatesite.name="@{updatesite.name}"
							updatesite.url="@{updatesite.url}"/>
			<build.feature  dir="Titanium_external_dependencies_feature"
							name="Titanium_external_dependencies"
							updatesite.name="@{updatesite.name}"
							updatesite.url="@{updatesite.url}"/>
		</sequential>
	</macrodef>

	<!-- update sites -->
	<macrodef name="build.updatesite">
		<attribute name="site.name"/><commit_msg>lets try building the external dependency features with fixed version numbers.<commit_after><?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
 Copyright (c) 2000-2015 <NAME> AB

 All rights reserved. This program and the accompanying materials
 are made available under the terms of the Eclipse Public License v1.0
 which accompanies this distribution, and is available at
 http://www.eclipse.org/legal/epl-v10.html
 -->
<project basedir="." default="updatesite.experimental" name="build_main" xmlns:if="ant:if" xmlns:unless="ant:unless">
	
	<import file="build_import.xml"/>

	<target name="init">
		<mkdir dir="${build.dir}"/>
		<mkdir dir="${result.dir}"/>
		<mkdir dir="${log.dir}"/>
		<mkdir dir="${log.dir}/error"/>

			<echo message="LD_LIBRARY_PATH: ${env.LD_LIBRARY_PATH}"/>
			<echo message="JAVA_HOME: ${env.JAVA_HOME}"/>
			<exec executable="ldd" failonerror="true">
				<arg value="/usr/bin/xsltproc"/>
			</exec>
		
	</target>

	<!-- Macro which builds a plugin -->
	<macrodef name="build.plugin">
		<attribute name="name"/>
		<sequential>
			<timestamp.echo message="Building plugin @{name} started" />
			<record name="${log.dir}/plugin_@{name}.txt" action="start"/>
			<ant dir="${build.dir}/@{name}"
				 antfile="${base.dir}/build_@{name}.xml"
				 target="build.jars">
				<property name="build.config" value="${build.config}"/>
			</ant>
			<record name="${log.dir}/plugin_@{name}.txt" action="stop"/>
			<timestamp.echo message="Building plugin @{name} finished" />
		</sequential>
	</macrodef>

	<target name="common.plugin" depends="init">
		<build.plugin name="${common.name}"/>
	</target>

	<target name="designer.plugin" depends="init, common.plugin">
		<build.plugin name="${designer.name}"/>
	</target>

	<target name="executor.plugin" depends="init, common.plugin, designer.plugin">
		<build.plugin name="${executor.name}"/>
	</target>

	<target name="help.plugin" depends="init, common.plugin">
		<build.plugin name="${help.name}"/>
	</target>

	<target name="logviewer.plugin" depends="init, common.plugin">
		<build.plugin name="${logviewer.name}"/>
	</target>

	<target name="debug.plugin" depends="init, common.plugin, designer.plugin">
		<build.plugin name="${debug.name}"/>
	</target>

	<target name="regressiontests.plugin" depends="init, common.plugin, designer.plugin">
		<build.plugin name="${regressiontests.name}"/>
	</target>

	<target name="titanium.plugin" depends="init, common.plugin, designer.plugin">
		<build.plugin name="${titanium.name}"/>
	</target>

	<target name="titanium.regressiontests.plugin" depends="init, titanium.plugin">
		<build.plugin name="${titanium.regressiontests.name}"/>
	</target>

	<!-- Macro which builds a feature -->
	<macrodef name="build.feature">
		<attribute name="dir"/>
		<attribute name="name"/>
		<attribute name="updatesite.name"/>
		<attribute name="updatesite.url"/>
		<sequential>
			<timestamp.echo message="-> build.feature( @{dir}, @{name}, @{updatesite.name}, @{updatesite.url} )" />
			<record name="${log.dir}/feature_@{name}.txt" action="start"/>
            <!--
			<cvs cvsRoot="${cvsRoot}"
				 command="get -d ${build.dir}/@{dir} ${cvs.module}/@{dir}"
				 failonerror="true"/>
                 -->

			<!-- Updating the version qualifier in the feature.xml file -->
			<echo message="Creating ${build.dir}/@{dir}/feature.xml"/>
			<apply executable="xsltproc" output="${build.dir}/@{dir}/feature.xml_unformatted"
				   verbose="true" error="${log.dir}/error/error_@{dir}.log" logError="true" failonerror="true"
				   timeout="60000">
				<arg value="--stringparam"/>
					<arg value="version"/> <arg value="${version.qualifier}"/>
				<arg value="--stringparam"/>
					<arg value="update_site_name"/> <arg value="@{updatesite.name}"/>
				<arg value="--stringparam"/>
					<arg value="update_site_url"/> <arg value="@{updatesite.url}"/>
				<arg value="${base.dir}/feature_xml_transformer.xsl"/>
				<fileset dir="${build.dir}/@{dir}">
					<include name="feature.xml"/>
				</fileset>
			</apply>

			<!-- Formatting the feature.xml file (also checks if the file is valid) -->
			<apply executable="xmllint" output="${build.dir}/@{dir}/feature.xml" failonerror="true"
				error="${log.dir}/error/error_@{dir}_xmllint.log" verbose="true">
				<arg value="--format"/>
				<fileset dir="${build.dir}/@{dir}">
					<include name="feature.xml_unformatted"/>
				</fileset>
			</apply>

	<!-- see https://bugzilla.novell.com/show_bug.cgi?id=485299
			<xslt in="${build.dir}/@{dir}/feature.xml"
				  out="${build.dir}/@{dir}/feature.xml"
				  style="${base.dir}/transform.xsl">
				  <param name="version" expression="${version.qualifier}"/>
				  <param name="update_site_name" expression="@{updatesite.name}"/>
				  <param name="update_site_url" expression="@{updatesite.url}"/>
			</xslt>
	-->
			<mkdir dir="${result.dir}/features"/>
			<jar
				destfile="${result.dir}/features/@{name}_${version.qualifier}.jar"
				basedir="${build.dir}/@{dir}"/>
			<record name="${log.dir}/feature_@{name}.txt" action="stop"/>
		</sequential>
	</macrodef>
	
	<!-- Macro which builds a feature -->
	<macrodef name="build.external_feature">
		<attribute name="dir"/>
		<attribute name="name"/>
		<attribute name="updatesite.name"/>
		<attribute name="updatesite.url"/>
		<sequential>
			<timestamp.echo message="-> build.feature( @{dir}, @{name}, @{updatesite.name}, @{updatesite.url} )" />
			<record name="${log.dir}/feature_@{name}.txt" action="start"/>
            <!--
			<cvs cvsRoot="${cvsRoot}"
				 command="get -d ${build.dir}/@{dir} ${cvs.module}/@{dir}"
				 failonerror="true"/>
                 -->

			<!-- Updating the version qualifier in the feature.xml file -->
			<echo message="Creating ${build.dir}/@{dir}/feature.xml"/>
			<apply executable="xsltproc" output="${build.dir}/@{dir}/feature.xml_unformatted"
				   verbose="true" error="${log.dir}/error/error_@{dir}.log" logError="true" failonerror="true"
				   timeout="60000">
				<arg value="--stringparam"/>
					<arg value="version"/> <arg value="0.0.0"/>
				<arg value="--stringparam"/>
					<arg value="update_site_name"/> <arg value="@{updatesite.name}"/>
				<arg value="--stringparam"/>
					<arg value="update_site_url"/> <arg value="@{updatesite.url}"/>
				<arg value="${base.dir}/feature_xml_transformer.xsl"/>
				<fileset dir="${build.dir}/@{dir}">
					<include name="feature.xml"/>
				</fileset>
			</apply>

			<!-- Formatting the feature.xml file (also checks if the file is valid) -->
			<apply executable="xmllint" output="${build.dir}/@{dir}/feature.xml" failonerror="true"
				error="${log.dir}/error/error_@{dir}_xmllint.log" verbose="true">
				<arg value="--format"/>
				<fileset dir="${build.dir}/@{dir}">
					<include name="feature.xml_unformatted"/>
				</fileset>
			</apply>

			<mkdir dir="${result.dir}/features"/>
			<jar
				destfile="${result.dir}/features/@{name}_${version.qualifier}.jar"
				basedir="${build.dir}/@{dir}"/>
			<record name="${log.dir}/feature_@{name}.txt" action="stop"/>
		</sequential>
	</macrodef>

	<macrodef name="build.features">
		<attribute name="updatesite.name"/>
		<attribute name="updatesite.url"/>
		<sequential>
			<log message="-> build.features( @{updatesite.name}, @{updatesite.url} )" />

			<build.feature  dir="TITAN_Designer_feature"
							name="TITAN_Designer"
							updatesite.name="@{updatesite.name}"
							updatesite.url="@{updatesite.url}"/>
			<build.feature  dir="TITAN_Executor_feature"
							name="TITAN_Executor"
							updatesite.name="@{updatesite.name}"
							updatesite.url="@{updatesite.url}"/>
			<build.feature  dir="TITAN_Log_Viewer_Feature"
							name="TITAN_Log_Viewer"
							updatesite.name="@{updatesite.name}"
							updatesite.url="@{updatesite.url}"/>
			<build.feature  dir="Titanium_feature"
							name="Titanium"
							updatesite.name="@{updatesite.name}"
							updatesite.url="@{updatesite.url}"/>
			<build.external_feature  dir="Titan_external_dependencies_feature"
							name="Titan_external_dependencies"
							updatesite.name="@{updatesite.name}"
							updatesite.url="@{updatesite.url}"/>
			<build.external_feature  dir="Titanium_external_dependencies_feature"
							name="Titanium_external_dependencies"
							updatesite.name="@{updatesite.name}"
							updatesite.url="@{updatesite.url}"/>
		</sequential>
	</macrodef>

	<!-- update sites -->
	<macrodef name="build.updatesite">
		<attribute name="site.name"/>
{'fraction_non_alphanumeric': 0.2057668877758224, 'fraction_numerical': 0.004061188574522811, 'mean_word_length': 4.137343532684284, 'pattern_counts': {'":': 0, '<': 279, '<?xml version=': 2, '>': 284, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '2988474', 'n_tokens_mistral': 5704, 'n_tokens_neox': 4796, 'n_words': 823}