<commit_before><project name="ZAP-Extensions" default="build-all" basedir=".">
	<description>Build ZAP extensions</description>

	<property name="src" location="../src" />
	<property name="src.version" value="1.7" />
	<property name="build" location="build" />
	<property name="dist" location="zap-exts" />
	<property name="dist.lib.dir" location="../lib" />
	<property name="status" value="beta" />
	<property name="versions.file" location="${dist}/ZapVersions-${status}.xml" />
	<!-- This assumes you also have the zaproxy project -->
	<property name="zap.plugin.dir" location="../../zaproxy/src/plugin" />
	
	<target name="clean">
		<delete dir="${dist}" includeEmptyDirs="true" />
		<delete dir="${build}" includeEmptyDirs="true" />
	</target>

	<target name="init">
		<!-- Create the build directory structure used by compile -->
		<mkdir dir="${dist}" />
		<mkdir dir="${build}" />
	</target>

	<target name="compile" depends="init" description="compile the source">
		<echo message="Compiling the source..." />
		
		<!-- Compile with debug information if the property "javac.debug" is set to true -->
		<local name="debug" />
		<condition property="debug" value="true" else="false">
			<istrue value="${javac.debug}" />
		</condition>
		
		<!-- Compile the java code from ${src} into ${build} -->
		<javac srcdir="${src}" destdir="${build}" source="${src.version}" target="${src.version}" includeantruntime="false" debug="${debug}" encoding="UTF-8">
			<classpath>
				<fileset dir="${dist.lib.dir}">
					<include name="**/*.jar" />
				</fileset>
			</classpath>
		</javac>
	</target>

	<target name="append-to-versions-file" description="appends the extension details to the versions xml file" unless="addon-example">
		<length file="${dist}/${file}" property="length" />
        <tstamp>
            <format property="yyyymmdd" pattern="yyyy-MM-dd"/>
        </tstamp>
		<echo file="${versions.file}" append="true">
	&lt;addon>${extension}&lt;/addon>
	&lt;addon_${extension}>
		&lt;name>${name}&lt;/name>
		&lt;description>${description}&lt;/description>
		&lt;author>${author}&lt;/author>
		&lt;version>${version}&lt;/version>
		&lt;file>${file}&lt;/file>
		&lt;status>${status}&lt;/status>
		&lt;changes>${changes}&lt;/changes>
		&lt;url>http://sourceforge.net/projects/zaproxy/files/add-ons/${file}/download&lt;/url>
		&lt;size>${length}&lt;/size>
		&lt;date>${yyyymmdd}&lt;/date>
		&lt;not-before-version>${not-before-version}&lt;/not-before-version>
		&lt;not-from-version>${not-from-version}&lt;/not-from-version>
	&lt;/addon_${extension}>
</echo>
	</target>
	
	<target name="build-addon" description="build the specified addon">
		
		<xmlproperty file="${src}/org/zaproxy/zap/extension/${addon}/ZapAddOn.xml"/>
		<property name="file" value="${addon}-${status}-${zapaddon.version}.zap" />
		
		<antcall target="build-addon-help"> 
			<param name="addon" value="${addon}"/>
		</antcall>

		<jar jarfile="${dist}/${file}" update="true" compress="true">
			<zipfileset dir="${build}" prefix="">
				<include name="org/zaproxy/zap/extension/${addon}/**"/>
			</zipfileset>
			<zipfileset dir="${src}" prefix="">
				<include name="org/zaproxy/zap/extension/${addon}/Messages*"/>
			</zipfileset>
			<zipfileset dir="${src}" prefix="">
				<include name="org/zaproxy/zap/extension/${addon}/resource/**"/>
			</zipfileset>
			<zipgroupfileset dir="${src}/org/zaproxy/zap/extension/${addon}/lib/" includes="*.jar" erroronmissingdir="false"/>
			<zipfileset dir="${src}" includes="org/zaproxy/zap/extension/${addon}/ZapAddOn.xml" fullpath="ZapAddOn.xml"/>
		</jar>

		<antcall target="include-files"> 
			<param name="addon" value="${addon}"/>
			<param name="file" value="${file}"/>
		</antcall>

		<antcall target="cleanup-addon-help"> 
			<param name="addon" value="${addon}"/>
		</antcall>

		<antcall target="append-to-versions-file"> 
			<param name="extension" value="${addon}"/> 
			<param name="name" value="${zapaddon.name}"/> 
			<param name="version" value="${zapaddon.version}"/> 
			<param name="description" value="${zapaddon.description}"/> 
			<param name="author" value="${zapaddon.author}"/> <commit_msg>Issue 948 - Change target "build-addon" to not include manifest signature files when building add-on files<commit_after><project name="ZAP-Extensions" default="build-all" basedir=".">
	<description>Build ZAP extensions</description>

	<property name="src" location="../src" />
	<property name="src.version" value="1.7" />
	<property name="build" location="build" />
	<property name="temp" location="temp" />
	<property name="dist" location="zap-exts" />
	<property name="dist.lib.dir" location="../lib" />
	<property name="status" value="beta" />
	<property name="versions.file" location="${dist}/ZapVersions-${status}.xml" />
	<!-- This assumes you also have the zaproxy project -->
	<property name="zap.plugin.dir" location="../../zaproxy/src/plugin" />
	
	<target name="clean">
		<delete dir="${dist}" includeEmptyDirs="true" />
		<delete dir="${build}" includeEmptyDirs="true" />
		<delete dir="${temp}" includeEmptyDirs="true" />
	</target>

	<target name="init">
		<!-- Create the build directory structure used by compile -->
		<mkdir dir="${dist}" />
		<mkdir dir="${build}" />
		<mkdir dir="${temp}" />
	</target>

	<target name="compile" depends="init" description="compile the source">
		<echo message="Compiling the source..." />
		
		<!-- Compile with debug information if the property "javac.debug" is set to true -->
		<local name="debug" />
		<condition property="debug" value="true" else="false">
			<istrue value="${javac.debug}" />
		</condition>
		
		<!-- Compile the java code from ${src} into ${build} -->
		<javac srcdir="${src}" destdir="${build}" source="${src.version}" target="${src.version}" includeantruntime="false" debug="${debug}" encoding="UTF-8">
			<classpath>
				<fileset dir="${dist.lib.dir}">
					<include name="**/*.jar" />
				</fileset>
			</classpath>
		</javac>
	</target>

	<target name="append-to-versions-file" description="appends the extension details to the versions xml file" unless="addon-example">
		<length file="${dist}/${file}" property="length" />
        <tstamp>
            <format property="yyyymmdd" pattern="yyyy-MM-dd"/>
        </tstamp>
		<echo file="${versions.file}" append="true">
	&lt;addon>${extension}&lt;/addon>
	&lt;addon_${extension}>
		&lt;name>${name}&lt;/name>
		&lt;description>${description}&lt;/description>
		&lt;author>${author}&lt;/author>
		&lt;version>${version}&lt;/version>
		&lt;file>${file}&lt;/file>
		&lt;status>${status}&lt;/status>
		&lt;changes>${changes}&lt;/changes>
		&lt;url>http://sourceforge.net/projects/zaproxy/files/add-ons/${file}/download&lt;/url>
		&lt;size>${length}&lt;/size>
		&lt;date>${yyyymmdd}&lt;/date>
		&lt;not-before-version>${not-before-version}&lt;/not-before-version>
		&lt;not-from-version>${not-from-version}&lt;/not-from-version>
	&lt;/addon_${extension}>
</echo>
	</target>
	
	<target name="build-addon" description="build the specified addon">
		
		<xmlproperty file="${src}/org/zaproxy/zap/extension/${addon}/ZapAddOn.xml"/>
		<property name="file" value="${addon}-${status}-${zapaddon.version}.zap" />
		
		<antcall target="build-addon-help"> 
			<param name="addon" value="${addon}"/>
		</antcall>

		<local name="addon.libs.zip" />
		<property name="addon.libs.zip" value="${temp}/libs-${addon}.zip" />

		<delete file="${addon.libs.zip}" failonerror="true" />
		<zip destfile="${addon.libs.zip}" whenempty="create">
			<zipgroupfileset dir="${src}/org/zaproxy/zap/extension/${addon}/lib/" includes="*.jar" erroronmissingdir="false" />
		</zip>

		<jar jarfile="${dist}/${file}" update="true" compress="true">
			<zipfileset dir="${build}" prefix="">
				<include name="org/zaproxy/zap/extension/${addon}/**"/>
			</zipfileset>
			<zipfileset dir="${src}" prefix="">
				<include name="org/zaproxy/zap/extension/${addon}/Messages*"/>
			</zipfileset>
			<zipfileset dir="${src}" prefix="">
				<include name="org/zaproxy/zap/extension/${addon}/resource/**"/>
			</zipfileset>
			<zipfileset src="${addon.libs.zip}">
				<exclude name="META-INF/*.DSA" />
				<exclude name="META-INF/*.SF" />
			</zipfileset>
			<zipfileset dir="${src}" includes="org/zaproxy/zap/extension/${addon}/ZapAddOn.xml" fullpath="ZapAddOn.xml"/>
		</jar>
		<delete file="${addon.libs.zip}" />

		<antcall target="include-files"> 
			<param name="addon" value="${addon}"/>
			<param name="file" value="${file}"/>
		</antcall>

		<antcall target="cleanup-addon-help"> 
			<param name="addon" value="${addon}"/>
		</antcall>

		<antcall target="append-to-versions-file"> 
			<param name="extension" value="${addon}"/> 
			<param name="name" value="${zapaddon.name}"/> 
			<param name="version" value="${zapaddon.version}"/> 
			<param name="description" value="${zapaddon.description}"/> 
			<param name="author" value="${zapaddon.author}"/> 
{'fraction_non_alphanumeric': 0.22696553277765263, 'fraction_numerical': 0.0010137418337463392, 'mean_word_length': 4.709967845659164, 'pattern_counts': {'":': 0, '<': 170, '<?xml version=': 0, '>': 226, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3341823', 'n_tokens_mistral': 3295, 'n_tokens_neox': 3017, 'n_words': 521}