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

     Copyright 2022 Red Hat

     Licensed 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

         https://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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.jboss.hal</groupId>
        <artifactId>hal-code-parent</artifactId>
        <version>3.7.8.Final</version>
        <relativePath>../code-parent/pom.xml</relativePath>
    </parent>

    <artifactId>hal-testsuite-resources</artifactId>
    <packaging>jar</packaging>
    <name>HAL :: Testsuite Resources</name>
    <description>
        Assembles classes from different HAL modules and makes them available as one dependency for the test suite
    </description>

    <dependencies>
        <dependency>
            <groupId>com.google.elemental2</groupId>
            <artifactId>elemental2-dom</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-generated-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/generated-sources/unpack</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack</id>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <phase>process-sources</phase>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>hal-console</artifactId>
                                    <version>${project.version}</version>
                                    <classifier>sources</classifier>
                                    <outputDirectory>
                                        ${project.build.directory}/generated-sources/unpack
                                    </outputDirectory>
                                    <overWrite>true</overWrite>
                                    <includes>
                                        **/*.mbui.xml,
                                        org/jboss/hal/dmr/ModelDescriptionConstants.java,
                                        org/jboss/hal/meta/token/NameTokens.java,
                                        org/jboss/hal/resources/CSS.java,
                                        org/jboss/hal/resources/Counter.java,
                                        org/jboss/hal/resources/FontAwesomeSize.java,
                                        org/jboss/hal/resources/Ids.java,
                                        org/jboss/hal/resources/Names.java,
                                        org/jboss/hal/resources/Strings.java,
                                        org/jboss/hal/resources/UIConstants.java,
                                        org/jboss/hal/resources/Urls.java
                                    </includes>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>