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

  <modelVersion>4.0.0</modelVersion>
  <groupId>org.openhab</groupId>
  <artifactId>docs</artifactId>
  <version>2.0.0-SNAPSHOT</version>

  <name>openHAB Documentation</name>

  <packaging>pom</packaging>

  <build>
	<plugins>
	  <plugin>
		<artifactId>maven-clean-plugin</artifactId>
		<configuration>
		  <filesets>
			<fileset>
			  <directory>${basedir}/_actions/</directory>
			</fileset>
			<fileset>
			  <directory>${basedir}/_bindings/</directory>
			</fileset>
			<fileset>
			  <directory>${basedir}/_persistence/</directory>
			</fileset>
			<fileset>
			  <directory>${basedir}/_transformations/</directory>
			</fileset>
			<fileset>
			  <directory>${basedir}/_voice/</directory>
			</fileset>
			<fileset>
			  <directory>${basedir}/_uis/</directory>
			</fileset>
			<fileset>
			  <directory>${basedir}/_io/</directory>
			</fileset>
			<fileset>
			  <directory>${basedir}/_iconsets/</directory>
			</fileset>
			<fileset>
			  <directory>${basedir}/concepts/</directory>
			</fileset>
		  </filesets>
		</configuration>
	  </plugin>
	  <plugin>
		<artifactId>maven-resources-plugin</artifactId>
		<executions>
		  <execution>
			<id>copy-esh-docs</id>
			<phase>process-resources</phase>
			<goals>
			  <goal>copy-resources</goal>
			</goals>
			<configuration>
			  <outputDirectory>${basedir}/concepts/</outputDirectory>
			  <resources>
				<resource>
				  <directory>${basedir}/_repos/smarthome/docs/documentation/concepts</directory>
				  <includes>
					<include>**/*.md</include>
					<include>**/*.png</include>
				  </includes>
				</resource>
				<resource>
				  <directory>${basedir}/_repos/smarthome/docs/documentation/development</directory>
				  <includes>
					<include>**/guidelines.md</include>
				  </includes>
				</resource>
			  </resources>
			</configuration>
		  </execution>
		  <execution>
			<id>copy-oh1-binding-docs</id>
			<phase>process-resources</phase>
			<goals>
			  <goal>copy-resources</goal>
			</goals>
			<configuration>
			  <outputDirectory>${basedir}/_bindings/oh1</outputDirectory>
			  <resources>
				<resource>
				  <directory>${basedir}/_repos/openhab/bundles/binding</directory>
				  <includes>
					<include>**/README.md</include>
					<include>**/doc/**</include>
					<include>**/cfg/**</include>
				  </includes>
				</resource>
			  </resources>
			</configuration>
		  </execution>
		  <execution>
			<id>copy-oh1-action-docs</id>
			<phase>process-resources</phase>
			<goals>
			  <goal>copy-resources</goal>
			</goals>
			<configuration>
			  <outputDirectory>${basedir}/_actions/oh1</outputDirectory>
			  <resources>
				<resource>
				  <directory>${basedir}/_repos/openhab/bundles/action</directory>
				  <includes>
					<include>**/README.md</include>
					<include>**/doc/**</include>
					<include>**/cfg/**</include>
				  </includes>
				</resource>
			  </resources>
			</configuration>
		  </execution>
		  <execution>
			<id>copy-oh1-persistence-docs</id>
			<phase>process-resources</phase>
			<goals>
			  <goal>copy-resources</goal>
			</goals>
			<configuration>
			  <outputDirectory>${basedir}/_persistence/oh1</outputDirectory>
			  <resources>
				<resource>
				  <directory>${basedir}/_repos/openhab/bundles/persistence</directory>
				  <includes>
					<include>**/README.md</include>
					<include>**/doc/**</include>
					<include>**/cfg/**</include>
				  </includes>
				</resource>
			  </resources>
			</configuration>
		  </execution>
		  <execution>
			<id>copy-oh2-binding-docs</id>
			<phase>process-resources</phase>
			<goals>
			  <goal>copy-resources</goal>
			</goals>
			<configuration>
			  <outputDirectory>${basedir}/_bindings/oh2</outputDirectory>
			  <resources>
				<resource>
				  <directory>${basedir}/_repos/openhab2-addons/addons/binding</directory>
				  <includes>
					<include>**/README.md</include>
					<include>**/doc/**</include>
					<include>**/cfg/**</include>
				  </includes>
				</resource>
				<resource>
				  <directory>${basedir}/_repos/openhab-bundles/bindings</directory>
				  <includes>
					<include>**/README.md</include>
					<include>**/doc/**</include>
					<include>**/cfg/**</include>
				  </includes>
				</resource>
			  </resources>
			</configuration>
		  </execution>
		  <execution>
			<id>copy-esh-binding-docs</id>
			<phase>process-resources</phase>
			<goals>
			  <goal>copy-resources</goal>
			</goals>
			<configuration>
			  <outputDirectory>${basedir}/_bindings/oh2</outputDirectory>
			  <resources>
				<resource>
				  <directory>${basedir}/_repos/smarthome/extensions/binding</directory>
				  <includes>
					<include>**/README.md</include>
					<include>**/doc/**</include>
					<include>**/cfg/**</include>
				  </includes>
				</resource>
			  </resources>
			</configuration>
		  </execution>
		  <execution>
			<id>copy-esh-transform-docs</id>
			<phase>process-resources</phase>
			<goals>
			  <goal>copy-resources</goal>
			</goals>
			<configuration>
			  <outputDirectory>${basedir}/_transformations/oh2</outputDirectory>
			  <resources>
				<resource>
				  <directory>${basedir}/_repos/smarthome/extensions/transform</directory>
				  <includes>
					<include>**/README.md</include>
					<include>**/doc/**</include>
					<include>**/cfg/**</include>
				  </includes>
				</resource>
			  </resources>
			</configuration>
		  </execution>
		  <execution>
			<id>copy-iconset-docs</id>
			<phase>process-resources</phase>
			<goals>
			  <goal>copy-resources</goal>
			</goals>
			<configuration>
			  <outputDirectory>${basedir}/_iconsets/oh2</outputDirectory>
			  <resources>
				<resource>
				  <directory>${basedir}/_repos/smarthome/extensions/ui/iconset</directory>
				  <includes>
					<include>**/README.md</include>
					<include>**/icons/**</include>
				  </includes>
				</resource>
			  </resources>
			</configuration>
		  </execution>
		  <execution>
			<id>copy-ui-docs</id>
			<phase>process-resources</phase>
			<goals>
			  <goal>copy-resources</goal>
			</goals>
			<configuration>
			  <outputDirectory>${basedir}/_uis/oh2</outputDirectory>
			  <resources>
				<resource>
				  <directory>${basedir}/_repos/smarthome/extensions/ui</directory>
				  <includes>
					<include>**/README.md</include>
					<include>**/doc/**</include>
					<include>**/cfg/**</include>
				  </includes>
				  <excludes>
					<exclude>**/iconset/**</exclude>
				  </excludes>
				</resource>
				<resource>
				  <directory>${basedir}/_repos/openhab-bundles/uis</directory>
				  <includes>
					<include>**/README.md</include>
					<include>**/doc/**</include>
					<include>**/cfg/**</include>
				  </includes>
				</resource>
			  </resources>
			</configuration>
		  </execution>
		  <execution>
			<id>copy-voice-docs</id>
			<phase>process-resources</phase>
			<goals>
			  <goal>copy-resources</goal>
			</goals>
			<configuration>
			  <outputDirectory>${basedir}/_voice/oh2</outputDirectory>
			  <resources>
				<resource>
				  <directory>${basedir}/_repos/smarthome/extensions/voice</directory>
				  <includes>
					<include>**/README.md</include>
					<include>**/doc/**</include>
					<include>**/cfg/**</include>
				  </includes>
				</resource>
				<resource>
				  <directory>${basedir}/_repos/openhab2-addons/addons/voice</directory>
				  <includes>
					<include>**/README.md</include>
					<include>**/doc/**</include>
					<include>**/cfg/**</include>
				  </includes>
				</resource>
			  </resources>
			</configuration>
		  </execution>
		  <execution>
			<id>copy-oh1-io-docs</id>
			<phase>process-resources</phase>
			<goals>
			  <goal>copy-resources</goal>
			</goals>
			<configuration>
			  <outputDirectory>${basedir}/_io/oh1</outputDirectory>
			  <resources>
				<resource>
				  <directory>${basedir}/_repos/openhab/bundles/io</directory>
				  <includes>
					<include>**/README.md</include>
					<include>**/doc/**</include>
					<include>**/cfg/**</include>
				  </includes>
				  <excludes>
				  	<exclude>**/org.openhab.io.caldav/**</exclude>
				  </excludes>
				</resource>
			  </resources>
			</configuration>
		  </execution>
		  <execution>
			<id>copy-oh2-io-docs</id>
			<phase>process-resources</phase>
			<goals>
			  <goal>copy-resources</goal>
			</goals>
			<configuration>
			  <outputDirectory>${basedir}/_io/oh2</outputDirectory>
			  <resources>
				<resource>
				  <directory>${basedir}/_repos/openhab2-addons/addons/io</directory>
				  <includes>
					<include>**/README.md</include>
					<include>**/doc/**</include>
					<include>**/cfg/**</include>
				  </includes>
				</resource>
			  </resources>
			</configuration>
		  </execution>
		</executions>
	  </plugin>
	  <plugin>
		<groupId>org.codehaus.groovy.maven</groupId>
		<artifactId>gmaven-plugin</artifactId>
		<executions>
		  <execution>
			<id>process-addon-files</id>
			<phase>process-resources</phase>
			<goals>
			  <goal>execute</goal>
			</goals>
			<configuration>
			  <source>${project.basedir}/process_addons.groovy</source>
			</configuration>
		  </execution>
		</executions>
	  </plugin>
	</plugins>
  </build>

</project>
