<?xml version="1.0" encoding="UTF-8"?>
<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.exoplatform.platform</groupId>
    <artifactId>exo.platform.doc</artifactId>
    <version>3.5.2</version>
  </parent>
  <artifactId>exo.platform.doc.bundle</artifactId>
  <packaging>pom</packaging>
  <name>eXo Platform - Docs package</name>
  <profiles>
    <profile>
      <id>distrib</id>
      <dependencies>
        <!-- Admin guide -->
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>exo.platform.doc.admin</artifactId>
          <version>${project.version}</version>
          <classifier>html</classifier>
          <type>zip</type>
        </dependency>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>exo.platform.doc.admin</artifactId>
          <version>${project.version}</version>
          <type>pdf</type>
        </dependency>
        <!-- Dev guide -->
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>exo.platform.doc.developer</artifactId>
          <version>${project.version}</version>
          <classifier>html</classifier>
          <type>zip</type>
        </dependency>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>exo.platform.doc.developer</artifactId>
          <version>${project.version}</version>
          <type>pdf</type>
        </dependency>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>exo.platform.doc.developer</artifactId>
          <version>${project.version}</version>
          <type>pdf</type>
          <classifier>ide</classifier>
        </dependency>
        <!-- Ref guide -->
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>exo.platform.doc.refguide</artifactId>
          <version>${project.version}</version>
          <classifier>html</classifier>
          <type>zip</type>
        </dependency>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>exo.platform.doc.refguide</artifactId>
          <version>${project.version}</version>
          <type>pdf</type>
        </dependency>
        <!-- User Guide -->
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>exo.platform.doc.user.platform</artifactId>
          <version>${project.version}</version>
          <classifier>html</classifier>
          <type>zip</type>
        </dependency>
      </dependencies>
      <build>
        <finalName>eXo-Platform-docs-${project.version}</finalName>
        <plugins>
          <!--
            1) Unpack the Zip archives that contain HTML files
           -->
		  <plugin>
		    <groupId>org.apache.maven.plugins</groupId>
		    <artifactId>maven-dependency-plugin</artifactId>
		    <executions>
		       <execution>
		         <id>01-unpack</id>
		         <phase>prepare-package</phase>
		         <goals>
		           <goal>unpack</goal>
		         </goals>
		         <configuration>
		           <artifactItems>
                     <!-- Admin Guide -->
		             <artifactItem>
                       <groupId>${project.groupId}</groupId>
                       <artifactId>exo.platform.doc.admin</artifactId>
                       <version>${project.version}</version>
                       <classifier>html</classifier>
                       <type>zip</type>
		               <outputDirectory>${project.build.directory}/work/admin-guide/html</outputDirectory>
		             </artifactItem>
                     <!-- Developers Guide -->
		             <artifactItem>
                       <groupId>${project.groupId}</groupId>
                       <artifactId>exo.platform.doc.developer</artifactId>
                       <version>${project.version}</version>
                       <classifier>html</classifier>
                       <type>zip</type>
		               <outputDirectory>${project.build.directory}/work/developer-guide/html</outputDirectory>
		             </artifactItem>
                     <!-- Reference Guide -->
		             <artifactItem>
                       <groupId>${project.groupId}</groupId>
                       <artifactId>exo.platform.doc.refguide</artifactId>
                       <version>${project.version}</version>
                       <classifier>html</classifier>
                       <type>zip</type>
		               <outputDirectory>${project.build.directory}/work/reference/html</outputDirectory>
		             </artifactItem>
                     <!-- User Guide -->
                     <artifactItem>
		               <groupId>${project.groupId}</groupId>
		               <artifactId>exo.platform.doc.user.platform</artifactId>
		               <version>${project.version}</version>
                       <classifier>html</classifier>
		               <type>zip</type>
		               <outputDirectory>${project.build.directory}/work/user-guide/html</outputDirectory>
		             </artifactItem>
		           </artifactItems>
		         </configuration>
		       </execution>
          <!--
            2) Copy the PDFs files
           -->
		      <execution>
		        <id>02-copy</id>
		        <phase>prepare-package</phase>
		        <goals>
		          <goal>copy</goal>
		        </goals>
		        <configuration>
		          <artifactItems>
                     <!-- Admin Guide -->
		             <artifactItem>
                       <groupId>${project.groupId}</groupId>
                       <artifactId>exo.platform.doc.admin</artifactId>
                       <version>${project.version}</version>
                       <type>pdf</type>
		               <outputDirectory>${project.build.directory}/work/admin-guide/pdf</outputDirectory>
		               <destFileName>eXo-Administration-Guide.pdf</destFileName>
		             </artifactItem>
                     <!-- Developers Guide -->
		             <artifactItem>
                       <groupId>${project.groupId}</groupId>
                       <artifactId>exo.platform.doc.developer</artifactId>
                       <version>${project.version}</version>
                       <type>pdf</type>
		               <outputDirectory>${project.build.directory}/work/developer-guide/pdf</outputDirectory>
		              <destFileName>eXo-Developers-Guide.pdf</destFileName>
		             </artifactItem>
		             <artifactItem>
                       <groupId>${project.groupId}</groupId>
                       <artifactId>exo.platform.doc.developer</artifactId>
                       <version>${project.version}</version>
                       <type>pdf</type>
                       <classifier>ide</classifier>
		               <outputDirectory>${project.build.directory}/work/developer-guide/pdf</outputDirectory>
		              <destFileName>eXo-IDE-User-Guide.pdf</destFileName>
		             </artifactItem>
                     <!-- Reference Guide -->
		             <artifactItem>
                       <groupId>${project.groupId}</groupId>
                       <artifactId>exo.platform.doc.refguide</artifactId>
                       <version>${project.version}</version>
                       <type>pdf</type>
		               <outputDirectory>${project.build.directory}/work/reference/pdf</outputDirectory>
		              <destFileName>eXo-Reference-Guide.pdf</destFileName>
		             </artifactItem>
                     <!-- User Guide -->
                     <artifactItem>
		               <groupId>${project.groupId}</groupId>
		               <artifactId>exo.platform.doc.user.platform</artifactId>
		               <version>${project.version}</version>
		               <type>pdf</type>
		               <outputDirectory>${project.build.directory}/work/user-guide/pdf</outputDirectory>
		             </artifactItem>
		          </artifactItems>
		        </configuration>
		      </execution>
		    </executions>
		  </plugin>
          <!--
            3) Assemble the final Zip archive
           -->
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
              <execution>
                <id>03-package</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <descriptors>
                    <descriptor>src/main/assembly/docs-archive.xml</descriptor>
                  </descriptors>
                  <appendAssemblyId>false</appendAssemblyId>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
