<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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<artifactId>de.rcenvironment.core.gui.help.win32</artifactId>
	<name>RCE Core GUI Help Win32 Bundle</name>
	<version>10.2.1-SNAPSHOT</version>
	<packaging>eclipse-plugin</packaging>

	<parent>
		<groupId>de.rcenvironment</groupId>
		<artifactId>de.rcenvironment.core.parent</artifactId>
		<version>1.0.0</version>
		<relativePath>../de.rcenvironment.core/maven/coreParent.pom</relativePath>
	</parent>

	<!-- Maven dependency to ensure correct build order -->
	<dependencies>
		<dependency>
			<artifactId>de.rcenvironment.documentation.core</artifactId>
			<groupId>de.rcenvironment</groupId>
			<type>pom</type>
			<version>10.2.1-SNAPSHOT</version>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<artifactId>maven-clean-plugin</artifactId>
				<executions>
					<execution>
						<id>clean-generated-help-files</id>
						<goals>
							<goal>clean</goal>
						</goals>
						<phase>clean</phase>
						<configuration>
							<filesets>
								<fileset>
									<directory>${basedir}/help/generated</directory>
									<followSymlinks>false</followSymlinks>
								</fileset>
							</filesets>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>copyDocumentation</id>
			<activation>
				<property>
					<name>!rce.maven.skipDocumentation</name>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-antrun-plugin</artifactId>
						<version>1.3</version>
						<dependencies>
							<dependency>
								<groupId>ant</groupId>
								<artifactId>ant-nodeps</artifactId>
								<version>1.6.5</version>
							</dependency>
							<dependency>
								<groupId>ant</groupId>
								<artifactId>ant-optional</artifactId>
								<version>1.5.3-1</version>
							</dependency>
							<dependency>
								<groupId>xalan</groupId>
								<artifactId>xalan</artifactId>
								<version>2.7.1</version>
							</dependency>
						</dependencies>
						<executions>
							<execution>
								<phase>generate-resources</phase>
								<configuration>
									<tasks>
										<copy todir="${basedir}" overwrite="true">
											<fileset
												dir="../de.rcenvironment.documentation.core/target/docbkx/eclipse/windows">
												<include name="doc.zip" />
											</fileset>
										</copy>
										<mkdir dir="${basedir}/help/generated" />
										<copy todir="${basedir}/help/generated" overwrite="true">
											<fileset
												dir="../de.rcenvironment.documentation.core/target/docbkx/eclipse/windows">
												<include name="*_toc.xml" />
											</fileset>
										</copy>
									</tasks>
								</configuration>
								<goals>
									<goal>run</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>
