<commit_before><!-- ======================================================================= -->
<!-- caCore Workbench Portal build file                                  -->
<!-- ======================================================================= -->
<project name="caCORE Workbench Webstart" basedir="." default="deploy:local:install">

	<!--***********************************************************************
	*** Define the Environment Variable
	*********************************************************************** -->
	<property environment="env"/>

	<!--***********************************************************************
	*** Load the build properties for the project
	*********************************************************************** -->

	<property file="project.properties" />
	<property file="build.properties" />

	<property name="software.dir" location=".." />
	<property name="target.dir" location="${software.dir}/target" />
	<property name="shared.local.repo.dir" location="${target.dir}/shared-local-ivy-repo" />
	<property name="bda-blueprints-webapp.install.zip.file" value="${project-webapp.install.name}"/>
	<property name="bda-blueprints-webapp.upgrade.zip.file" value="${project-webapp.upgrade.name}"/>
	<property name="bda-download.dir" location="${target.dir}/bda-download" />
	
	<property name="ivy.settings.dir" value="${basedir}/../common" />
	<property name="ivy.settings.file" value="ivysettings.xml" />

	<import file="bda-master-build.xml"/>
	<import file="build-util-macros.xml"/>

	<property name="project.home" location="${basedir}/.." />
	<property name="project.build.home" location="${project.home}/build" />
	<property name="project.common.dir" location="${project.home}/common" />

	<property name="workbench.project.dir" value="../../../workbench-project" />
	<property name="workbench.software.build.dir" location="${workbench.project.dir}/software/build" />
	<property name="workbench.dist.dir" value="${workbench.project.dir}/software/target/dist/exploded" />
	<property name="workbench.common.sdk.dist.dir" value="${workbench.project.dir}/software/common/resources/sdk-dist" />

	<property name="dist.exploded.dir" value="${dist.dir}/exploded"/>
	<property name="dist.exploded.common.dir" value="${dist.exploded.dir}/common"/>
	<property name="dist.exploded.common.sdk.dist.dir" value="${dist.exploded.common.dir}/resources/sdk-dist"/>

	<property name="keystore.dir" value="${dist.exploded.dir}/keystore"/>
	<property name="keystore.lib.dir" value="${keystore.dir}/lib"/>

	<property name="webstart.dir" value="${dist.exploded.dir}/common/resources/web"/>
	<property name="webstart.webinf.dir" value="${webstart.dir}/WEB-INF"/>


	<property name="output.war.dir" value="${dist.exploded.dir}/output/${PROJECT_NAME}/package/server/tomcat/webapps"/>


	<property name="sdk.src.file" value="SDK-src.zip" />

	<!--***********************************************************************
	*** Packages the caCORE Workbench into a WebStart application
	*********************************************************************** -->
	<target name="package:webstart" depends="build:workbench-modules,-copy-webstart-jars,-create-webstart-keystore,-sign-webstart-jars,-package-webstart-webapp">
		<SDKecho message="${ant.project.name}: Completed Packaging the caCORE Workbench into a WebStart application"/>
	</target>

	<!--***********************************************************************
	*** Copies the Jar files required in the Workbench WebStart application
	*********************************************************************** -->
	<target name="-copy-webstart-jars">
		<delete dir="${keystore.dir}" failonerror=""/>
		<mkdir dir="${keystore.lib.dir}" />
		<copy toDir="${keystore.lib.dir}">
			<fileset dir="${workbench.dist.dir}" includes="**/*.jar" />
		</copy>
	</target>

	<!--***********************************************************************
	*** Make Workbench Workbench WebStart Application jars; required for full access
	*********************************************************************** -->
	<target name="-create-webstart-keystore">
		<SDKecho message="${ant.project.name}: Creating Workbench WebStart Keystore; Required for Signing Jars"/>
		<generate-jar-signing-keystore />
	</target>

	<!--***********************************************************************
	*** Sign Workbench WebStart Application jars; required for full access
	*********************************************************************** -->
	<target name="-sign-webstart-jars">
		<SDKecho message="${ant.project.name}: Sign Workbench WebStart Application jars; required for full client system access"/>
		<echoproperties prefix="jar-signing"/>
		<if>
			<equals arg1="${jar-signing.execution.time}" arg2="build"/>
			<then>
				<echo message="jar-signing.execution.time set to build, signing jars"/>
				<sign-jars jars.dir="${keystore.lib.dir}"
				/>
			</then>
			<else>
				<echo message="jar-signing.execution.time not set to build, not signing jars"/>
			</else>
		</if>
		<flattenmapper/>
	</target>

	<!--***********************************************************************
	*** Package the Workbench files into WebStart Web Application
	*********************************************************************** -->
	<target name="-package-webstart-webapp">
		<SDKecho message="${ant.project.name}: Packaging the Workbench into WebStart Web Application" />
		<mkdir dir="${output.war.dir}" />
		<war destfile="${output.war.dir}\${workbench.webstart.war.file}" webxml="${webstart.webinf.dir}\web.xml">
			<manifest>
				<attribute name="Generated-By" value="caCORE caCORE Workbench" />
				<attribute name="Version" value="${VERSION}" />
			</manifest>
			<fileset dir="${keystore.dir}">
				<include name="**/*.jar" />
			</fileset>
			<fileset dir="${webstart.dir}">
				<include name="*" />
			</fileset>
			<fileset dir="${dist.exploded.common.sdk.dist.dir}">
				<include name="*" />
			</fileset>
		</war>
	</target>


	<target name="init" description="Sets up build are and initalizes variables">
		<echo message=" ______   ______   _______ " />
		<mkdir dir="${target.dir}" />
		<mkdir dir="${dist.dir}" />
		<mkdir dir="${dist.exploded.dir}" />
		<mkdir dir="${common.dist.dir}" />
		<mkdir dir="${tools.dist.dir}" />
		<mkdir dir="${temp.dir}" />
		<mkdir dir="${download.dir}" />

		<available file="${tomcat.dest.file}" property="tomcat.tools.exists" />
	</target>

	<!-- Wrapper build target, calls appropriate builds for sub-projects -->
	<target name="build:all" description="Builds all the sub projects, putting artifacts in the project level target directory, used by distribution targets to make distributions" depends="
		clean,
		init,
		-copy-project-properties,
		package:webstart
		" />

	<target name="build:workbench-modules" description="Call workbench modules build target to produce artifacts">
		<SDKecho message="${ant.project.name}: Building the workbench source"/>
		<ant antfile="${workbench.software.build.dir}/build.xml" target="build:all" inheritall="false" inheritrefs="false"/>
	</target>

	<target name="-copy-project-properties">
		<copy todir="${dist.exploded.dir}" overwrite="true">
			<fileset dir="${project.build.home}" includes="*.properties" />
		</copy>
		<copy todir="${dist.exploded.dir}/common">
			<fileset dir="${project.common.dir}" />
		</copy>
		<copy todir="${dist.exploded.common.sdk.dist.dir}">
			<fileset dir="${workbench.common.sdk.dist.dir}" />
		</copy>
		<replace dir="${dist.exploded.dir}/common">
			<replacefilter token="@PROJECT_NAME@" value="${PROJECT_NAME}" />
			<replacefilter token="@SERVER_HOSTNAME@" value="${tomcat.hostname}" />
			<replacefilter token="@SERVER_PORT@" value="${tomcat.port.http}" />
			<replacefilter token="@SDK_SRC_FILE@" value="${sdk.src.file}" />
		</replace>
	</target>

	<target name="clean">
		<delete dir="${dist.dir}" failonerror="false"/>
		<delete dir="${temp.dir}" />
	</target>
<commit_msg>Now using tomcat external http host property within the Workbench Webstart JNLP file.  Needed for remote deployment.<commit_after><!-- ======================================================================= -->
<!-- caCore Workbench Portal build file                                  -->
<!-- ======================================================================= -->
<project name="caCORE Workbench Webstart" basedir="." default="deploy:local:install">

	<!--***********************************************************************
	*** Define the Environment Variable
	*********************************************************************** -->
	<property environment="env"/>

	<!--***********************************************************************
	*** Load the build properties for the project
	*********************************************************************** -->

	<property file="project.properties" />
	<property file="build.properties" />

	<property name="software.dir" location=".." />
	<property name="target.dir" location="${software.dir}/target" />
	<property name="shared.local.repo.dir" location="${target.dir}/shared-local-ivy-repo" />
	<property name="bda-blueprints-webapp.install.zip.file" value="${project-webapp.install.name}"/>
	<property name="bda-blueprints-webapp.upgrade.zip.file" value="${project-webapp.upgrade.name}"/>
	<property name="bda-download.dir" location="${target.dir}/bda-download" />

	<property name="ivy.settings.dir" value="${basedir}/../common" />
	<property name="ivy.settings.file" value="ivysettings.xml" />

	<import file="bda-master-build.xml"/>
	<import file="build-util-macros.xml"/>

	<property name="project.home" location="${basedir}/.." />
	<property name="project.build.home" location="${project.home}/build" />
	<property name="project.common.dir" location="${project.home}/common" />

	<property name="workbench.project.dir" value="../../../workbench-project" />
	<property name="workbench.software.build.dir" location="${workbench.project.dir}/software/build" />
	<property name="workbench.dist.dir" value="${workbench.project.dir}/software/target/dist/exploded" />
	<property name="workbench.common.sdk.dist.dir" value="${workbench.project.dir}/software/common/resources/sdk-dist" />

	<property name="dist.exploded.dir" value="${dist.dir}/exploded"/>
	<property name="dist.exploded.common.dir" value="${dist.exploded.dir}/common"/>
	<property name="dist.exploded.common.sdk.dist.dir" value="${dist.exploded.common.dir}/resources/sdk-dist"/>

	<property name="keystore.dir" value="${dist.exploded.dir}/keystore"/>
	<property name="keystore.lib.dir" value="${keystore.dir}/lib"/>

	<property name="webstart.dir" value="${dist.exploded.dir}/common/resources/web"/>
	<property name="webstart.webinf.dir" value="${webstart.dir}/WEB-INF"/>


	<property name="output.war.dir" value="${dist.exploded.dir}/output/${PROJECT_NAME}/package/server/tomcat/webapps"/>


	<property name="sdk.src.file" value="SDK-src.zip" />

	<!--***********************************************************************
	*** Packages the caCORE Workbench into a WebStart application
	*********************************************************************** -->
	<target name="package:webstart" depends="build:workbench-modules,-copy-webstart-jars,-create-webstart-keystore,-sign-webstart-jars,-package-webstart-webapp">
		<SDKecho message="${ant.project.name}: Completed Packaging the caCORE Workbench into a WebStart application"/>
	</target>

	<!--***********************************************************************
	*** Copies the Jar files required in the Workbench WebStart application
	*********************************************************************** -->
	<target name="-copy-webstart-jars">
		<delete dir="${keystore.dir}" failonerror=""/>
		<mkdir dir="${keystore.lib.dir}" />
		<copy toDir="${keystore.lib.dir}">
			<fileset dir="${workbench.dist.dir}" includes="**/*.jar" />
		</copy>
	</target>

	<!--***********************************************************************
	*** Make Workbench Workbench WebStart Application jars; required for full access
	*********************************************************************** -->
	<target name="-create-webstart-keystore">
		<SDKecho message="${ant.project.name}: Creating Workbench WebStart Keystore; Required for Signing Jars"/>
		<generate-jar-signing-keystore />
	</target>

	<!--***********************************************************************
	*** Sign Workbench WebStart Application jars; required for full access
	*********************************************************************** -->
	<target name="-sign-webstart-jars">
		<SDKecho message="${ant.project.name}: Sign Workbench WebStart Application jars; required for full client system access"/>
		<echoproperties prefix="jar-signing"/>
		<if>
			<equals arg1="${jar-signing.execution.time}" arg2="build"/>
			<then>
				<echo message="jar-signing.execution.time set to build, signing jars"/>
				<sign-jars jars.dir="${keystore.lib.dir}"
				/>
			</then>
			<else>
				<echo message="jar-signing.execution.time not set to build, not signing jars"/>
			</else>
		</if>
		<flattenmapper/>
	</target>

	<!--***********************************************************************
	*** Package the Workbench files into WebStart Web Application
	*********************************************************************** -->
	<target name="-package-webstart-webapp">
		<SDKecho message="${ant.project.name}: Packaging the Workbench into WebStart Web Application" />
		<mkdir dir="${output.war.dir}" />
		<war destfile="${output.war.dir}\${workbench.webstart.war.file}" webxml="${webstart.webinf.dir}\web.xml">
			<manifest>
				<attribute name="Generated-By" value="caCORE caCORE Workbench" />
				<attribute name="Version" value="${VERSION}" />
			</manifest>
			<fileset dir="${keystore.dir}">
				<include name="**/*.jar" />
			</fileset>
			<fileset dir="${webstart.dir}">
				<include name="*" />
			</fileset>
			<fileset dir="${dist.exploded.common.sdk.dist.dir}">
				<include name="*" />
			</fileset>
		</war>
	</target>


	<target name="init" description="Sets up build are and initalizes variables">
		<echo message=" ______   ______   _______ " />
		<mkdir dir="${target.dir}" />
		<mkdir dir="${dist.dir}" />
		<mkdir dir="${dist.exploded.dir}" />
		<mkdir dir="${common.dist.dir}" />
		<mkdir dir="${tools.dist.dir}" />
		<mkdir dir="${temp.dir}" />
		<mkdir dir="${download.dir}" />

		<available file="${tomcat.dest.file}" property="tomcat.tools.exists" />
	</target>

	<!-- Wrapper build target, calls appropriate builds for sub-projects -->
	<target name="build:all" description="Builds all the sub projects, putting artifacts in the project level target directory, used by distribution targets to make distributions" depends="
		clean,
		init,
		-copy-project-properties,
		package:webstart
		" />

	<target name="build:workbench-modules" description="Call workbench modules build target to produce artifacts">
		<SDKecho message="${ant.project.name}: Building the workbench source"/>
		<ant antfile="${workbench.software.build.dir}/build.xml" target="build:all" inheritall="false" inheritrefs="false"/>
	</target>

	<target name="-copy-project-properties">
		<copy todir="${dist.exploded.dir}" overwrite="true">
			<fileset dir="${project.build.home}" includes="*.properties" />
		</copy>
		<copy todir="${dist.exploded.dir}/common">
			<fileset dir="${project.common.dir}" />
		</copy>
		<copy todir="${dist.exploded.common.sdk.dist.dir}">
			<fileset dir="${workbench.common.sdk.dist.dir}" />
		</copy>
		<replace dir="${dist.exploded.dir}/common">
			<replacefilter token="@PROJECT_NAME@" value="${PROJECT_NAME}" />
			<replacefilter token="@SERVER_HOSTNAME@" value="${tomcat.hostname}" />
			<replacefilter token="@SERVER_PORT@" value="${tomcat.port.http}" />
			<replacefilter token="@SDK_SRC_FILE@" value="${sdk.src.file}" />
			<replacefilter token="@TOMCAT_EXTERNAL_HTTP_HOST@" value="${tomcat.external.http.host}" />
		</replace>
	</target>

	<target name="clean">
		<delete dir="${dist.dir}" failonerror="false"/>
		<delete dir="${temp.dir}" />
	</target>

{'fraction_non_alphanumeric': 0.31012893627572524, 'fraction_numerical': 0.0002479543763947434, 'mean_word_length': 5.386777513855899, 'pattern_counts': {'":': 0, '<': 256, '<?xml version=': 0, '>': 256, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '984496', 'n_tokens_mistral': 4906, 'n_tokens_neox': 4389, 'n_words': 841}