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

  <parent>
    <groupId>org.tentackle</groupId>
    <artifactId>tentackle-parent</artifactId>
    <version>21.16.2.0</version>
  </parent>

  <artifactId>tentackle-fx</artifactId>
  <packaging>jar</packaging>
  <name>Tentackle FX</name>
  <description>UI components based on FX</description>
  <url>https://tentackle.org</url>

  <properties>
    <rootBasedir>${project.parent.basedir}</rootBasedir>
  </properties>

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>tentackle-core</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>    <!-- loads transitive java.xml, javafx.base, javafx.controls, javafx.graphics -->
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-web</artifactId>
    </dependency>
    <dependency>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-fxml</artifactId>
    </dependency>

    <dependency>
      <groupId>org.kordamp.ikonli</groupId>
      <artifactId>ikonli-javafx</artifactId>
    </dependency>
    <dependency>
      <groupId>org.kordamp.ikonli</groupId>
      <artifactId>ikonli-materialdesign2-pack</artifactId>
    </dependency>
  </dependencies>

  <build>

    <resources>
      <!-- workaround:
        SceneBuilder cannot locate the controller if the fxml file is not in the same
        directory as the java file. Hence, we change the convention
        as follows:
        1. each controller and its related fxml, resource-properties and css files go into the same physical folder.
        2. there is only one such folder/package per controller
      -->
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>target/generated-resources</directory>
      </resource>
      <resource>
        <directory>src/main/java</directory>
        <includes>
          <include>**/*.fxml</include>
          <include>**/*.css</include>
          <include>**/*.properties</include>
        </includes>
      </resource>
    </resources>

    <plugins>
      <plugin>
        <groupId>${project.groupId}</groupId>
        <artifactId>tentackle-maven-plugin</artifactId>
        <version>${project.version}</version>
        <executions>
          <execution>
            <id>analyze</id>
            <goals>
              <goal>analyze</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <verbosity>info</verbosity>
          <showCompileOutput>true</showCompileOutput>
          <index>META-INF/RESOURCE-INDEX.LIST</index>
        </configuration>
      </plugin>

      <plugin>
        <groupId>${project.groupId}</groupId>
        <artifactId>tentackle-check-maven-plugin</artifactId>
        <version>${project.version}</version>
        <executions>
          <execution>
            <id>bundles</id>
            <goals>
              <goal>bundles</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <verbosity>info</verbosity>
          <locales>en_US, de_DE</locales>
          <showCompileOutput>true</showCompileOutput>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.wurbelizer</groupId>
        <artifactId>wurbelizer-maven-plugin</artifactId>

        <executions>
          <execution>
            <goals>
              <goal>wurbel</goal>
            </goals>
          </execution>
        </executions>

        <configuration>
          <wurbletDependencies>
            <wurbletDependency>
              <groupId>${project.groupId}</groupId>
              <artifactId>tentackle-wurblets</artifactId>
              <version>${project.version}</version>
            </wurbletDependency>
          </wurbletDependencies>

          <verbosity>info</verbosity>

          <wurbletPaths>
            <param>org.tentackle.wurblet</param>
          </wurbletPaths>

          <wurbletProperties>
            <property>
              <name>guardtype</name>
              <value>netbeans</value>
            </property>
            <property>
              <name>foldtype</name>
              <value>collapsed</value>
            </property>
          </wurbletProperties>

          <filesets>
            <fileset>
              <includes>
                <include>**/component/*.java</include>
                <include>**/container/*.java</include>
              </includes>
              <followSymlinks>false</followSymlinks>
            </fileset>
          </filesets>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <compilerArgs>
            <arg>-Xlint:${javac.lint}</arg>
            <!-- proc:none because of chicken-egg problem with annotation processors in same module -->
            <arg>-proc:none</arg>
          </compilerArgs>
        </configuration>
      </plugin>

    </plugins>
  </build>

</project>
