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

   <modelVersion>4.0.0</modelVersion>
   <packaging>jar</packaging>

   <parent>
      <groupId>org.codehaus.castor</groupId>
      <artifactId>castor-parent</artifactId>
      <version>1.4.1-SNAPSHOT</version>
      <relativePath>../parent/pom.xml</relativePath>
   </parent>

   <groupId>org.codehaus.castor</groupId>
   <artifactId>castor-docs</artifactId>
   <name>Castor: Documentation</name>
   <description>Castor Documentation - Reference guide and user manuals.</description>

   <!-- <properties> <docs.name>Cocoon Corona</docs.name> <docs.urlRelativizer>../</docs.urlRelativizer> <docs.mode>online</docs.mode> 
      <docs.breadcrumb>corona</docs.breadcrumb> </properties> -->


   <pluginRepositories>
      <pluginRepository>
         <id>agilejava</id>
         <url>http://agilejava.com/maven</url>
      </pluginRepository>
   </pluginRepositories>

   <build>
      <plugins>
         <plugin>
            <groupId>com.agilejava.docbkx</groupId>
            <artifactId>docbkx-maven-plugin</artifactId>
            <version>2.0.7</version>
            <executions>
               <execution>
                  <id>single-page</id>
                  <goals>
                     <goal>generate-html</goal>
                     <goal>generate-pdf</goal>
                  </goals>
                  <configuration>
                     <includes>index.xml</includes>
                     <chunkedOutput>false</chunkedOutput>
                     <htmlCustomization>src/docbkx/resources/xsl/html.xsl</htmlCustomization>
                     <foCustomization>src/docbkx/resources/xsl/fopdf.xsl</foCustomization>
                     <postProcess>
                        <copy todir="${basedir}/target/site/reference">
                           <fileset dir="${basedir}/target/docbkx">
                              <include name="**/*.pdf" />
                           </fileset>
                        </copy>
                        <copy todir="${basedir}/target/site/reference/html-single">
                           <fileset dir="${basedir}/target/docbkx/html">
                              <include name="**/*.html" />
                           </fileset>
                        </copy>
                        <copy todir="${basedir}/target/site/reference/html-single">
                           <fileset dir="${basedir}/src/docbkx/resources">
                              <include name="**/*.css" />
                              <include name="**/*.png" />
                              <include name="**/*.gif" />
                              <include name="**/*.jpg" />
                           </fileset>
                        </copy>
                        <move file="target/site/reference/pdf/index.pdf" tofile="target/site/reference/pdf/castor-reference-guide-1.4.0.pdf"
                           failonerror="false" />
                     </postProcess>
                  </configuration>
                  <phase>pre-site</phase>
               </execution>
            </executions>
            <dependencies>
               <dependency>
                  <groupId>org.docbook</groupId>
                  <artifactId>docbook-xml</artifactId>
                  <version>5.0</version>
                  <scope>runtime</scope>
               </dependency>
            </dependencies>
            <configuration>
               <!-- <includes>index.xml</includes> -->
               <!-- <includes>jdo-index.xml</includes> -->
               <htmlStylesheet>css/html.css</htmlStylesheet>
               <xincludeSupported>true</xincludeSupported>
               <sourceDirectory>${basedir}/src/docbkx</sourceDirectory>
               <!-- use extensions -->
               <useExtensions>1</useExtensions>
               <highlightSource>1</highlightSource>
               <highlightDefaultLanguage></highlightDefaultLanguage>
               <!-- callouts -->
               <calloutsExtension>1</calloutsExtension>
               <entities>
                  <entity>
                     <name>version</name>
                     <value>${project.version}</value>
                  </entity>
               </entities>
            </configuration>
         </plugin>
      </plugins>
   </build>

   <profiles>
      <profile>
         <id>html</id>
         <build>
            <plugins>
               <plugin>
                  <groupId>com.agilejava.docbkx</groupId>
                  <artifactId>docbkx-maven-plugin</artifactId>
                  <version>2.0.7</version>
                  <executions>
                     <execution>
                        <id>multi-page</id>
                        <goals>
                           <goal>generate-html</goal>
                        </goals>
                        <configuration>
                           <chunkedOutput>true</chunkedOutput>
                           <htmlCustomization>src/docbkx/resources/xsl/html_chunk.xsl</htmlCustomization>
                           <postProcess>
                              <copy todir="${basedir}/target/site/reference">
                                 <fileset dir="${basedir}/target/docbkx">
                                    <include name="**/*.html" />
                                 </fileset>
                              </copy>
                              <copy todir="${basedir}/target/site/reference/html">
                                 <fileset dir="${basedir}/src/docbkx/resources">
                                    <include name="**/*.css" />
                                    <include name="**/*.png" />
                                    <include name="**/*.gif" />
                                    <include name="**/*.jpg" />
                                 </fileset>
                              </copy>
                           </postProcess>
                        </configuration>
                        <phase>pre-site</phase>
                     </execution>
                  </executions>
                  <dependencies>
                     <dependency>
                        <groupId>org.docbook</groupId>
                        <artifactId>docbook-xml</artifactId>
                        <version>5.0</version>
                        <scope>runtime</scope>
                     </dependency>
                  </dependencies>
                  <configuration>
                     <!-- <includes>index.xml</includes> -->
                     <!-- <includes>jdo-index.xml</includes> -->
                     <htmlStylesheet>css/html.css</htmlStylesheet>
                     <xincludeSupported>true</xincludeSupported>
                     <sourceDirectory>${basedir}/src/docbkx</sourceDirectory>
                     <!-- use extensions -->
                     <useExtensions>1</useExtensions>
                     <highlightSource>1</highlightSource>
                     <highlightDefaultLanguage></highlightDefaultLanguage>
                     <!-- callouts -->
                     <calloutsExtension>1</calloutsExtension>
                     <entities>
                        <entity>
                           <name>version</name>
                           <value>${project.version}</value>
                        </entity>
                     </entities>
                  </configuration>
               </plugin>
            </plugins>
         </build>

      </profile>

      <profile>
         <id>jdo</id>

         <build>
            <plugins>
               <plugin>
                  <groupId>com.agilejava.docbkx</groupId>
                  <artifactId>docbkx-maven-plugin</artifactId>
                  <version>2.0.7</version>
                  <executions>
                     <execution>
                        <id>single-page-jdo</id>
                        <goals>
                           <goal>generate-html</goal>
                           <!-- <goal>generate-pdf</goal> -->
                        </goals>
                        <configuration>
                           <includes>jdo-index.xml</includes>
                           <chunkedOutput>false</chunkedOutput>
                           <htmlCustomization>src/docbkx/resources/xsl/html.xsl</htmlCustomization>
                           <foCustomization>src/docbkx/resources/xsl/fopdf.xsl</foCustomization>
                           <postProcess>
                              <copy todir="${basedir}/target/site/reference/jdo">
                                 <fileset dir="${basedir}/target/docbkx">
                                    <include name="**/*.pdf" />
                                 </fileset>
                              </copy>
                              <copy todir="${basedir}/target/site/reference/jdo/html-single">
                                 <fileset dir="${basedir}/target/docbkx/html">
                                    <include name="**/*.html" />
                                 </fileset>
                              </copy>
                              <copy todir="${basedir}/target/site/reference/Jdo/html-single">
                                 <fileset dir="${basedir}/src/docbkx/resources">
                                    <include name="**/*.css" />
                                    <include name="**/*.png" />
                                    <include name="**/*.gif" />
                                    <include name="**/*.jpg" />
                                 </fileset>
                              </copy>
                              <move file="target/site/reference/pdf/jdo/index.pdf" tofile="target/site/reference/pdf/jdo/castor-jdo-reference-guide-1.4.0.pdf"
                                 failonerror="false" />
                           </postProcess>
                        </configuration>
                        <phase>pre-site</phase>
                     </execution>
                  </executions>
                  <dependencies>
                     <dependency>
                        <groupId>org.docbook</groupId>
                        <artifactId>docbook-xml</artifactId>
                        <version>5.0</version>
                        <scope>runtime</scope>
                     </dependency>
                  </dependencies>
                  <configuration>
                     <!-- <includes>index.xml</includes> -->
                     <!-- <includes>jdo-index.xml</includes> -->
                     <htmlStylesheet>css/html.css</htmlStylesheet>
                     <xincludeSupported>true</xincludeSupported>
                     <sourceDirectory>${basedir}/src/docbkx</sourceDirectory>
                     <!-- use extensions -->
                     <useExtensions>1</useExtensions>
                     <highlightSource>1</highlightSource>
                     <highlightDefaultLanguage></highlightDefaultLanguage>
                     <!-- callouts -->
                     <calloutsExtension>1</calloutsExtension>
                     <entities>
                        <entity>
                           <name>version</name>
                           <value>${project.version}</value>
                        </entity>
                     </entities>
                  </configuration>
               </plugin>
            </plugins>
         </build>
      </profile>

   </profiles>
</project>
