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

    <parent>
        <groupId>com.github.martinpaljak</groupId>
        <artifactId>gppro</artifactId>
        <version>19.06.16</version>
    </parent>

    <artifactId>gptool</artifactId>

    <dependencies>
        <!-- For PC/SC reader access -->
        <dependency>
            <groupId>com.github.martinpaljak</groupId>
            <artifactId>apdu4j-pcsc</artifactId>
            <version>19.05.08</version>
        </dependency>
        <!-- Library -->
        <dependency>
            <groupId>com.github.martinpaljak</groupId>
            <artifactId>globalplatformpro</artifactId>
            <version>19.06.16</version>
        </dependency>
        <!-- For JSON handling -->
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.8.5</version>
        </dependency>
        <!-- For HTTP handling -->
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.5.8</version>
        </dependency>
        <!-- For logging in the command line tool -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>1.7.25</version>
            <optional>true</optional>
        </dependency>
        <!-- For logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.25</version>
        </dependency>
        <!-- For command line parsing -->
        <dependency>
            <groupId>net.sf.jopt-simple</groupId>
            <artifactId>jopt-simple</artifactId>
            <version>5.0.4</version>
        </dependency>
        <!-- For tests  -->
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.14.3</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <finalName>gp</finalName>
                            <transformers>
                                <transformer
                                        implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <mainClass>pro.javacard.gp.GPTool</mainClass>
                                </transformer>
                            </transformers>
                            <filters>
                                <filter>
                                    <artifact>*:*</artifact>
                                    <excludes>
                                        <exclude>META-INF/*.SF</exclude>
                                        <exclude>META-INF/*.DSA</exclude>
                                        <exclude>META-INF/*.RSA</exclude>
                                        <exclude>META-INF/maven/**</exclude>
                                    </excludes>
                                </filter>
                            </filters>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- Package for Windows -->
            <plugin>
                <groupId>com.akathist.maven.plugins.launch4j</groupId>
                <artifactId>launch4j-maven-plugin</artifactId>
                <version>1.7.25</version>
                <executions>
                    <execution>
                        <id>gp-exe</id>
                        <phase>package</phase>
                        <goals>
                            <goal>launch4j</goal>
                        </goals>
                        <configuration>
                            <headerType>console</headerType>
                            <outfile>target/gp.exe</outfile>
                            <jar>target/gp.jar</jar>
                            <errTitle>GlobalPlatformPro</errTitle>
                            <classPath>
                                <mainClass>pro.javacard.gp.GPTool</mainClass>
                            </classPath>
                            <jre>
                                <minVersion>1.8.0</minVersion>
                            </jre>
                            <versionInfo>
                                <fileVersion>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${parsedVersion.buildNumber}</fileVersion>
                                <txtFileVersion>${project.version}</txtFileVersion>
                                <fileDescription>GlobalPlatformPro</fileDescription>
                                <copyright>(C) 2015 - 2019 Martin Paljak and contributors (LGPL+MIT)</copyright>
                                <productVersion>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${parsedVersion.buildNumber}</productVersion>
                                <txtProductVersion>${project.version}</txtProductVersion>
                                <productName>GlobalPlatformPro</productName>
                                <internalName>gppro</internalName>
                                <originalFilename>gp.exe</originalFilename>
                            </versionInfo>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>
</project>