<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>com.github.davidmoten</groupId>
        <artifactId>flatbuffers-parent</artifactId>
        <version>2.0.8</version>
    </parent>
    <artifactId>flatbuffers-compiler</artifactId>
    <packaging>pom</packaging>
    <description>Compressed archive of binaries for flatbuffers particularly flatc for generating classes. Multiple platforms supported vi different classifications.</description>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <phase>generate-resources</phase>
                        <configuration>
                            <target>
                                <echo message="unzipping linux binary for inclusion by assembly" />
                                <unzip src="bin/linux/flatc.zip" dest="${project.build.directory}/linux/" />
                                <unzip src="bin/osx/flatc.zip" dest="${project.build.directory}/osx/" />
                                <unzip src="bin/windows/flatc.zip" dest="${project.build.directory}/windows/" />
                                <chmod file="${project.build.directory}/linux/flatc" perm="+x" />
                                <chmod file="${project.build.directory}/osx/flatc" perm="+x" />
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.4.2</version>
                <configuration>
                    <descriptors>
                        <descriptor>src/assembly/linux.xml</descriptor>
                        <descriptor>src/assembly/osx.xml</descriptor>
                        <descriptor>src/assembly/windows.xml</descriptor>
                    </descriptors>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id> <!-- this is used for inheritance merges -->
                        <phase>package</phase> <!-- bind to the packaging phase -->
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
