<?xml version="1.0" ?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.jpmml</groupId>
		<artifactId>jpmml-python</artifactId>
		<version>1.3.9</version>
	</parent>

	<groupId>org.jpmml</groupId>
	<artifactId>pmml-python</artifactId>
	<packaging>jar</packaging>

	<name>JPMML Python converter</name>
	<description>JPMML Python to PMML converter</description>

	<licenses>
		<license>
			<name>GNU Affero General Public License (AGPL) version 3.0</name>
			<url>http://www.gnu.org/licenses/agpl-3.0.html</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<dependencies>
		<dependency>
			<groupId>org.jpmml</groupId>
			<artifactId>pmml-converter</artifactId>
		</dependency>

		<dependency>
			<groupId>net.razorvine</groupId>
			<artifactId>pickle</artifactId>
		</dependency>
		<dependency>
			<groupId>net.razorvine</groupId>
			<artifactId>serpent</artifactId>
		</dependency>

		<dependency>
			<groupId>org.jpmml</groupId>
			<artifactId>pmml-evaluator</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>failureaccess</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<archive>
						<manifestEntries>
							<Implementation-Title>JPMML-Python library</Implementation-Title>
							<Implementation-Version>${project.version}</Implementation-Version>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>3.2.0</version>
				<executions>
					<execution>
						<id>generate-grammar</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<target>
								<loadfile property="python.tokens.content" srcFile="src/main/javacc/python.tokens" />
								<loadfile property="python.productions.content" srcFile="src/main/javacc/python.productions" />
								<copy todir="${project.build.directory}/transformed-grammar">
									<fileset dir="src/main/javacc/">
										<include name="*.jj" />
									</fileset>
									<filterset>
										<filter token="python.tokens" value="${python.tokens.content}" />
										<filter token="python.productions" value="${python.productions.content}" />
									</filterset>
								</copy>
							</target>
						</configuration>
					</execution>
					<execution>
						<id>process-sources</id>
						<phase>process-sources</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<target>
								<delete>
									<fileset dir="${basedir}/target/generated-sources/javacc/org/jpmml/python/">
										<include name="**/*TranslatorConstants.java" />
										<include name="**/FunctionDefParserConstants.java" />
									</fileset>
								</delete>
								<replaceregexp match="(Expression|Predicate)TranslatorConstants" replace="PythonParserConstants" byline="true">
									<fileset dir="${basedir}/target/generated-sources/javacc/org/jpmml/python/">
										<filename name="*Translator.java" />
									</fileset>
								</replaceregexp>
								<replaceregexp match="FunctionDefParserConstants" replace="PythonParserConstants" byline="true">
									<fileset dir="${basedir}/target/generated-sources/javacc/org/jpmml/python/">
										<filename name="FunctionDefParser.java" />
									</fileset>
								</replaceregexp>
								<replaceregexp match="(Expression|Predicate)TranslatorTokenManager" replace="PythonParserTokenManager" byline="true">
									<fileset dir="${basedir}/target/generated-sources/javacc/org/jpmml/python/">
										<filename name="*Translator.java" />
									</fileset>
								</replaceregexp>
								<replaceregexp match="FunctionDefParserTokenManager" replace="PythonParserTokenManager" byline="true">
									<fileset dir="${basedir}/target/generated-sources/javacc/org/jpmml/python/">
										<filename name="FunctionDefParser.java" />
									</fileset>
								</replaceregexp>
							</target>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>javacc-maven-plugin</artifactId>
				<version>3.1.1</version>
				<executions>
					<execution>
						<phase>generate-sources</phase>
						<goals>
							<goal>javacc</goal>
						</goals>
						<configuration>
							<sourceDirectory>${project.build.directory}/transformed-grammar</sourceDirectory>
						</configuration>
					</execution>
				</executions>
				<dependencies>
					<dependency>
						<groupId>net.java.dev.javacc</groupId>
						<artifactId>javacc</artifactId>
						<version>7.0.13</version>
					</dependency>
				</dependencies>
			</plugin>
		</plugins>
	</build>
</project>
