<?xml version="1.0" encoding="UTF-8"?>
<!--
  #%L
  Nuiton Matrix :: GUI
  %%
  Copyright (C) 2004 - 2023 CodeLutin
  %%
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU Lesser General Public License as
  published by the Free Software Foundation, either version 3 of the
  License, or (at your option) any later version.
  
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Lesser Public License for more details.
  
  You should have received a copy of the GNU General Lesser Public
  License along with this program.  If not, see
  <http://www.gnu.org/licenses/lgpl-3.0.html>.
  #L%
  -->

<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.nuiton</groupId>
    <artifactId>matrix</artifactId>
    <version>2.8.3-SNAPSHOT</version>
  </parent>

  <groupId>org.nuiton.matrix</groupId>
  <artifactId>nuiton-matrix-gui</artifactId>

  <name>Nuiton Matrix :: GUI</name>
  <description>Matrix gui module</description>

  <dependencies>

    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>nuiton-matrix</artifactId>
      <version>${project.version}</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>

    <dependency>
      <groupId>org.nuiton</groupId>
      <artifactId>nuiton-utils</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
    </dependency>

    <dependency>
      <groupId>org.nuiton.i18n</groupId>
      <artifactId>nuiton-i18n</artifactId>
    </dependency>

    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
    </dependency>

    <dependency>
      <groupId>org.nuiton.jaxx</groupId>
      <artifactId>jaxx-runtime</artifactId>
    </dependency>

    <dependency>
      <groupId>org.jfree</groupId>
      <artifactId>jfreechart</artifactId>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.nuiton.jaxx</groupId>
        <artifactId>jaxx-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
            <id>generate-ui</id>
            <configuration>
              <extraImportList>
                jaxx.runtime.SwingUtil,
                static jaxx.runtime.JAXXUtil.getStringValue
              </extraImportList>
              <addSourcesToClassPath>true</addSourcesToClassPath>
              <addProjectClassPath>true</addProjectClassPath>
            </configuration>
          </execution>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
            <id>generate-tests</id>
            <phase>generate-test-sources</phase>
            <configuration>
              <testPhase>true</testPhase>
              <src>src/test/java</src>
              <outJava>target/generated-sources/test-java</outJava>
              <addProjectClassPath>true</addProjectClassPath>
              <addCompileClassPath>true</addCompileClassPath>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.nuiton.i18n</groupId>
        <artifactId>i18n-maven-plugin</artifactId>
        <configuration>
          <entries>
            <entry>
              <basedir>${project.build.directory}/generated-sources/java/
              </basedir>
            </entry>
          </entries>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>parserJava</goal>
              <goal>gen</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>

    <!-- create assemblies only at release time -->
    <profile>
      <id>assembly-profile</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <!-- launch in a release the assembly automatically -->
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
              <execution>
                <id>create-assemblies</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <attach>false</attach>
              <descriptorRefs>
                <descriptorRef>deps</descriptorRef>
                <descriptorRef>full</descriptorRef>
              </descriptorRefs>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
