<?xml version="1.0" encoding="UTF-8"?>
<!--

     Copyright 2005-2016 Red Hat, Inc.

     Red Hat licenses this file to you under the Apache License, version
     2.0 (the "License"); you may not use this file except in compliance
     with the License.  You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
     implied.  See the License for the specific language governing
     permissions and limitations under the License.

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

  <parent>
    <groupId>io.fabric8</groupId>
    <artifactId>components</artifactId>
    <version>2.3.7</version>
  </parent>

  <groupId>io.fabric8</groupId>
  <artifactId>kubernetes-assertions</artifactId>
  <packaging>bundle</packaging>

  <name>Fabric8 :: Kubernetes :: Assertions</name>

  <properties>
  </properties>

  <dependencies>
    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>kubernetes-api</artifactId>
    </dependency>
    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>kubernetes-client</artifactId>
    </dependency>
    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>fabric8-utils</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.fusesource.jansi</groupId>
      <artifactId>jansi</artifactId>
      <version>${jansi.version}</version>
    </dependency>

    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
    </dependency>


    <!-- testing -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-assertions-generator-maven-plugin</artifactId>
        <version>2.0.0</version>
        <dependencies>
          <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj.core.version}</version>
          </dependency>
<!--
          If this PR gets merged we can move to the latest release of this jar:
          https://github.com/joel-costigliola/assertj-assertions-generator/pull/68

          <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-assertions-generator</artifactId>
            <version>2.0.1</version>
          </dependency>

          eventually we can even remove this dependency completely if a new maven plugin is released!

          until then lets use a temporary release:
-->
          <dependency>
            <groupId>io.fabric8.assertj</groupId>
            <artifactId>assertj-assertions-generator</artifactId>
            <version>2.0.1.2</version>
          </dependency>
        </dependencies>
        <configuration>
          <packages>
            <param>io.fabric8.kubernetes.api.model</param>
            <param>io.fabric8.openshift.api.model</param>
          </packages>
          <!--
                        <classes>
                            <param>your.third.package.YourClass</param>
                        </classes>
          -->
          <!-- wether generated assertions classes can be inherited with consistent assertion chaining -->
          <hierarchical>true</hierarchical>
          <!-- where to generate assertions entry point classes -->
          <entryPointClassPackage>io.fabric8.kubernetes.assertions.internal</entryPointClassPackage>
          <!-- restrict classes to generate assertions for with regex -->
          <!--
                       <includes>
                         <param>org\.assertj\.examples\.rpg.*</param>
                       </includes>
          -->
          <!-- excludes with regex classes from generation -->
          <excludes>
            <param>.*Doneable.*</param>
            <param>.*Editable.*</param>
            <param>.*Builder</param>
            <param>.*Fluent</param>
            <param>.*FluentImpl</param>
          </excludes>
          <!-- base directory where to generate assertions -->
          <targetDir>${basedir}/target/generated-sources</targetDir>
          <!-- select which assertions entry point classes to generate -->
          <generateAssertions>true</generateAssertions>
          <generateBddAssertions>false</generateBddAssertions>
          <generateSoftAssertions>false</generateSoftAssertions>
          <generateJUnitSoftAssertions>false</generateJUnitSoftAssertions>

          <templates>
            <templatesDirectory>${basedir}/src/main/assertj-templates</templatesDirectory>
            <!-- TODO is there a way to add a new custom template? -->
            <objectAssertion>navigation_template.txt</objectAssertion>
            <iterableAssertion>has_elements_assertion_template_for_iterable.txt</iterableAssertion>
            <hierarchicalAssertionAbstractClass>custom_abstract_assertion_class_template.txt</hierarchicalAssertionAbstractClass>
          </templates>
        </configuration>

        <executions>
          <execution>
            <id>generate-tests</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>generate-assertions</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${basedir}/target/generated-sources</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>${exec-maven-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>java</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <mainClass>io.fabric8.kubernetes.assertions.Example</mainClass>
          <classpathScope>test</classpathScope>
        </configuration>
      </plugin>

    </plugins>
  </build>

</project>
