<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="../etc/wfrant2html.xsl"?>
<!-- version 2005/08/23 -->
<!-- author Bill Rich, bill@wilandra.com, Wilandra Consulting LLC. Copyright (C) 2004-2005, Wilandra Consulting LLC. All rights reserved. -->
<!-- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -->
<!--See http://g11ntoolkit.sourceforge.net/licenseGPL.html for the License Agreement. -->
<!-- =================================================================== -->
<project	name="L10NProcess"
					basedir="."
					default="init"
					xmlns:ac="antlib:net.sf.antcontrib">
	<description>
		L10N project for a product. This is intended to be imported into a project for a product or part of a product. The targets in this file will be accessible via the product project. The product project will contain the properties that are specific to that project. This project relies on the product properties being set before any of the targets can be used.
	</description>
<!-- =================================================================== -->
	<!-- Load the macros and support tasks files. -->
	<import file="${env.G11NTOOLKIT_DIR}/L10NProcess/L10NProcess-macros.xml"/>
	<import file="${env.G11NTOOLKIT_DIR}/L10NProcess/L10NProcess-tasks.xml"/>
<!-- =================================================================== -->
	<!-- Load the extensions targets. -->
	<import file="${env.G11NTOOLKIT_DIR}/extensions/L10NProcess/L10NProcess-extensions.xml"/>
<!-- =================================================================== -->
	<target	name="init"
					description="Set up properties needed throughout this project. Since properties are immutable the values set in the init target are the lowest priority and considered the default values if they are not set somewhere else. Property values set on the command line are the highest priority with user, project, and language properties in between. This list is: 1) command line, 2) user properties, 3) project properties, 4) language properties, and 5) init target properties.">
		<!-- Set up default values for the user. The USER value should come from the command line since it is used to load the user specific properties. If it is not provided, no user properties will be loaded. -->
		<property	name="USER"
							value="user"/>
		<echo	message="Loading ${USER}.properties."/>
		<property	file="${USER}.properties"/>

		<!-- Set up some project properties by loading the project.properties file. If no project.properties file is provided then it is implied that there are no project level overrides for the properties. -->
		<property	name="PROJECT"
							value="${ant.project.name}"/>
		<echo	message="Loading ${PROJECT}.properties."/>
		<property	file="${PROJECT}.properties"/>

		<!-- Set up default values for directory information. -->
		<property	name="G11NTOOLKIT-DIR"
							value="${env.G11NTOOLKIT_DIR}"/>

		<!-- Set up default values for the language. -->
		<property	name="LANGUAGE"
							value="ja"/>

		<!-- Load the language specific properties. -->
		<echo	message="Loading ${G11NTOOLKIT-DIR}/L10NProcess/Language_${LANGUAGE}.properties."/>
		<property	file="${G11NTOOLKIT-DIR}/L10NProcess/Language_${LANGUAGE}.properties"/>

		<!-- Load the process properties. -->
		<echo	message="Loading ${G11NTOOLKIT-DIR}/L10NProcess/process.properties."/>
		<property	file="${G11NTOOLKIT-DIR}/L10NProcess/process.properties"/>

		<!-- Tell the user what property values we are using. -->
		<echo	message="G11NTOOLKIT-DIR = ${G11NTOOLKIT-DIR}"/>
		<echo	message="USER = ${USER}"/>
		<echo	message="PROJECT = ${PROJECT}"/>
		<echo	message="PROJECTWORKDIR = ${PROJECTWORKDIR}" />
		<echo	message="LANGUAGE = ${LANGUAGE}"/>
		<echo	message="PRODUCT = ${PRODUCT}"/>
		<echo	message="PRODUCT-VERSION = ${PRODUCT-VERSION}"/>
		<echo	message="PRODUCTWORKDIR = ${PRODUCTWORKDIR}"/>
		<echo	message="SOURCELOCALE = ${SOURCELOCALE}"/>
		<echo	message="TARGETLOCALE = ${TARGETLOCALE}"/>
		<echo	message="TARGETLANG = ${TARGETLANG}"/>
		<echo	message="PROJECTFILE = ${PROJECTFILE}"/>
		<echo	message="XMLPROPFILE = ${XMLPROPFILE}"/>
		<echo	message="XSLTDIR = ${XSLTDIR}"/>
		<echo	message="SOURCEFILESDIR = ${SOURCEFILESDIR}"/>
		<echo	message="TARGETFILESDIR = ${TARGETFILESDIR}"/>

		<!-- Set up the classpath for the g11ntoolkit classes. -->
		<path	id="project.class.path">
			<pathelement	location="."/>
			<pathelement	location="${G11NTOOLKIT-DIR}/lib"/>
			<fileset	dir="${G11NTOOLKIT-DIR}/lib">
				<include	name="*.jar"/>
			</fileset>
			<pathelement	location="${G11NTOOLKIT-DIR}/extensions/lib"/>
			<fileset	dir="${G11NTOOLKIT-DIR}/extensions/lib">
				<include	name="*.jar"/>
			</fileset>
		</path>
		<path	id="project.class.path.neko">
			<pathelement	location="${G11NTOOLKIT-DIR}/lib"/>
			<fileset	dir="${G11NTOOLKIT-DIR}/lib">
				<include	name="HTMLParser.jar"/>
				<include	name="g11ntoolkit.jar"/>
				<include	name="nekohtml.jar"/>
				<include	name="xercesImpl.jar"/>
				<include	name="xmlParserAPIs.jar"/>
			</fileset>
			<pathelement	location="${G11NTOOLKIT-DIR}/extensions/lib"/>
			<fileset	dir="${G11NTOOLKIT-DIR}/extensions/lib">
				<include	name="*.jar"/>
			</fileset>
		</path>

		<!-- Set up the task used to make the file lists from the file list in the project control file (.slpd). -->
		<taskdef name="makeFileLists" classpath="${G11NTOOLKIT-DIR}/lib/g11ntoolkit.jar" classname="com.g11ntoolkit.antutil.MakeFileLists"/>

		<!-- Set up the tasks that will be needed from the ant-Contrib package. -->
		<taskdef resource="net/sf/antcontrib/antlib.xml"/>
	</target>
<!-- =================================================================== -->
	<target	name="getsourcefiles"
					depends="loadprojxlfilelist"
					if="projXLFileList"
					description="Copy the source files from the SOURCEFILESDIR directory to the product work directory based on the list of files in the project file. The SOURCEFILESDIR property is set on the command line when requesting that the get target to run.">
		<ac:for	list="${projXLFileList}"
					delimiter=";"
					param="srcfile">
			<sequential>
				<getsrcname	listitem="@{srcfile}"
										property="file.csf.@{srcfile}"/>
				<copy	file="${SOURCEFILESDIR}/${PRODUCT}/${file.csf.@{srcfile}}"
							tofile="${PRODUCT}/${file.csf.@{srcfile}}"
							overwrite="true"/>
			</sequential>
		</ac:for>
	</target>
<!-- =================================================================== -->
	<target	name="puttargetfiles"
					depends="loadprojxlfilelist"
					if="projXLFileList"
					description="Copy the target files from the product work area directory to the directory pointed to by the TARGETFILESDIR property based on the list of files in the project file. The TARGETFILESDIR property must be specified on the command line, in the user properties file, or in the project properties file when this target is requested.">
		<ac:for	list="${projXLFileList}"
					delimiter=";"
					param="targetfile">
			<sequential>
				<getoutputname	listitem="@{targetfile}"
												property="file.ci.@{targetfile}"/>
				<copy	tofile="${TARGETFILESDIR}/${PRODUCT}/${file.ci.@{targetfile}}"
							file="${PRODUCT}/${file.ci.@{targetfile}}"/>
			</sequential>
		</ac:for>
	</target>
<!-- =================================================================== -->
	<target	name="copysrctar"
					depends="loadprojxlfilelist, csthtmlfiles, cstjsfiles, cstcssfiles, cstjspfiles, cstlrbfiles, cstmcfiles, cstprbfiles, cstsqlfiles, cstxmlfiles, cstxslfiles, copysrctar-ext"
					if="projXLFileList"
					description="Copy each project source file to its corresponding target file. This will make each file available in the target language with its source content. File names will be changed to the target file names.">
	</target>
<!-- =================================================================== -->
	<target	name="tok"
					depends="loadprojxlfilelist, tokresfiles, tokxmlfiles, toksqlfiles, tokxslfiles, tokscriptfiles, tokdisplayfiles, tok-ext"
					if="projXLFileList"
					description="Tokenize the source files listed in the project file to create the STR files to be used later in the project.">
		<delete	verbose="false" quiet="true" failonerror="false">
			<fileset	dir=".">
				<include	name="null*.txt"/>
			</fileset>
		</delete>
	</target>
<!-- =================================================================== -->
	<target	name="detok"
					depends="loadprojxlfilelist, detokhtmlfiles, detokjsfiles, detokcssfiles, detokjspfiles, detoklrbfiles, detokmcfiles, detokprbfiles, detoksqlfiles, detokxmlfiles, detokxslfiles, detok-ext"
					if="projXLFileList"
					description="Detokenize all the files listed in the project file to create the target files and prepare them for check in. Detok processing may be different for different types of files so each type of file is handled separately.">
	</target>
<!-- =================================================================== -->
</project>
