<?xml version="1.0" encoding="UTF-8"?>
<!--
 *******************************************************************************
 * Copyright (c) 2021 Contributors to the Eclipse Foundation
 * 
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * https://www.eclipse.org/legal/epl-2.0/.
 * 
 * SPDX-License-Identifier: EPL-2.0
 * 
 * Contributors:
 *   See git history
 *******************************************************************************
-->
<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.eclipse.birt.build.package</groupId>
		<artifactId>org.eclipse.birt.build.package-parent</artifactId>
		<version>4.9.0</version>
		<relativePath>../..</relativePath>
	</parent>

	<groupId>org.eclipse.birt.birt-packages.birt-charts</groupId>
	<artifactId>DeploymentRuntime</artifactId>
	<packaging>eclipse-repository</packaging>

	<!-- http://codeandme.blogspot.com/2012/12/tycho-build-5-building-p2-update-sites.html -->
	<build>
		<extensions>
			<extension>
				<groupId>org.apache.maven.wagon</groupId>
				<artifactId>wagon-ssh</artifactId>
				<version>1.0-beta-6</version>
			</extension>
		</extensions>
		<plugins>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-p2-repository-plugin</artifactId>
				<version>${tycho.version}</version>
				<configuration>
					<includeAllDependencies>false</includeAllDependencies>
				</configuration>
			</plugin>

			<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>${antrun.version}</version>
				<executions>
					<execution>
						<id>re-package</id>
						<phase>package</phase>
						<configuration>
							<target>
								<copy todir="target/DeploymentRuntime/ChartEngine">
									<fileset dir="target/repository/plugins" />
									<fileset dir="." includes="*.txt" />
								</copy>
								<copy todir="target/DeploymentRuntime/ChartEngine/docs">
									<fileset dir="." includes="*.doc" />
								</copy>
								<copy todir="target/DeploymentRuntime/chart-viewer-sample">
									<fileset dir="../../../../chart/org.eclipse.birt.chart.viewer/WebContent" />
								</copy>
								<copy todir="target/DeploymentRuntime/chart-viewer-sample/WEB-INF/lib">
									<fileset dir="../../../../chart/org.eclipse.birt.chart.viewer" includes="chart-viewer.jar" />
								</copy>
								<copy todir="target/DeploymentRuntime/chart-viewer-sample/WEB-INF/lib">
									<fileset dir="target/DeploymentRuntime/ChartEngine" includes="*.*" />
								</copy>
								<war destfile="target/DeploymentRuntime/chart-viewer-sample.war" basedir="target/DeploymentRuntime/chart-viewer-sample" />
								<delete dir="target/DeploymentRuntime/chart-viewer-sample" />
							</target>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
