<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>

	<artifactId>de.rcenvironment.documentation.core.win32.feature</artifactId>
	<name>RCE Documentation (Core) Deployment Feature - Win32</name>
	<version>10.2.1-SNAPSHOT</version>
	<packaging>eclipse-feature</packaging>

	<parent>
		<groupId>de.rcenvironment</groupId>
		<artifactId>de.rcenvironment.documentation.core.defaultParent</artifactId>
		<version>1.0.0</version>
		<relativePath>../de.rcenvironment.documentation.core/maven/parent</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>

	<profiles>
		<profile>
			<id>copyDocumentation</id>
			<activation>
				<property>
					<name>!rce.maven.skipDocumentation</name>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-antrun-plugin</artifactId>
						<executions>
							<execution>
								<phase>initialize</phase>
								<configuration>
									<tasks>
										<mkdir dir="target/root_files/documentation" />
										<copy todir="target/root_files/documentation">
											<fileset
												dir="../de.rcenvironment.documentation.core/target/docbkx/pdf/windows">
												<include name="*.pdf" />
											</fileset>
										</copy>
										<!-- <echo message="generated" file="target/root_files/documentation/test.txt"/> -->
									</tasks>
								</configuration>
								<goals>
									<goal>run</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>createDocumentationPlaceholder</id>
			<activation>
				<property>
					<name>rce.maven.skipDocumentation</name>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-antrun-plugin</artifactId>
						<executions>
							<execution>
								<phase>initialize</phase>
								<configuration>
									<tasks>
										<mkdir dir="target/root_files/documentation" />
										<echo message="documentation was skipped during the build process"
											file="target/root_files/documentation/not_generated.txt" />
									</tasks>
								</configuration>
								<goals>
									<goal>run</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<!-- TODO move into parent POM -->
	<build>
		<pluginManagement>
			<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>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

</project>
