<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">

    <id>mac</id>
    <formats>
        <format>dir</format>
        <format>zip</format>
    </formats>
    <baseDirectory>Protege-${project.version}</baseDirectory>


    <dependencySets>

        <dependencySet>
            <outputDirectory>${osx.bundle.name}/Contents/bundles</outputDirectory>
            <includes>
                <include>org.neo4j.driver:neo4j-java-driver:jar</include>
                <include>org.reactivestreams:reactive-streams:jar</include>

                <include>edu.stanford.protege:protege-common:jar</include>
                <include>edu.stanford.protege:protege-editor-core:jar</include>
                <include>org.eclipse.equinox:org.eclipse.equinox.registry:jar</include>
                <include>org.eclipse.equinox:org.eclipse.equinox.supplement:jar</include>
                <include>org.eclipse.equinox:org.eclipse.equinox.common:jar</include>
                <include>net.sourceforge.owlapi:owlapi-osgidistribution:jar</include>
                <include>edu.stanford.protege:protege-editor-owl:jar</include>
                <include>com.google.code.findbugs:jsr305</include>
                <include>ch.qos.logback:logback-core:jar</include>
                <include>ch.qos.logback:logback-classic:jar</include>
                <include>com.google.guava:guava:jar</include>
                <include>org.slf4j:slf4j-api:jar</include>
                <include>org.slf4j:log4j-over-slf4j:jar</include>
                <include>org.slf4j:jul-to-slf4j:jar</include>
                <include>commons-io:commons-io:jar</include>
                <include>org.apache.servicemix.bundles:org.apache.servicemix.bundles.javax-inject:jar</include>
                <include>org.eclipse.jgit:org.eclipse.jgit:jar</include>
                <include>com.googlecode.javaewah:JavaEWAH:jar</include>
                <include>javax.xml.bind:jaxb-api:jar</include>
                <include>com.sun.xml.bind:jaxb-core:jar</include>
                <include>com.sun.xml.bind:jaxb-impl:jar</include>
                <include>com.sun.activation:javax.activation</include>
                <!-- CORBA dependencies -->
                <include>org.glassfish.corba:glassfish-corba-orb:jar</include>
                <include>org.glassfish.corba:glassfish-corba-internal-api:jar</include>
                <include>org.glassfish.corba:glassfish-corba-omgapi:jar</include>
                <include>org.glassfish.gmbal:gmbal:jar</include>
                <include>org.glassfish.external:management-api:jar</include>
                <include>org.glassfish.pfl:pfl-basic:jar</include>
                <include>org.glassfish.pfl:pfl-tf:jar</include>
                <include>org.glassfish.pfl:pfl-dynamic:jar</include>
                <include>org.ow2.asm:asm:jar</include>
                <include>org.ow2.asm:asm-util:jar</include>
                <include>org.ow2.asm:asm-tree:jar</include>
                <include>org.ow2.asm:asm-analysis:jar</include>
                <include>edu.stanford.protege:protege-launcher:jar</include>
                <include>org.apache.felix:org.apache.felix.main:jar</include>
                <include>org.apache.maven:maven-artifact</include>
            </includes>
            <useStrictFiltering>true</useStrictFiltering>
            <outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
        </dependencySet>

        <dependencySet>
            <outputDirectory>${osx.bundle.name}/Contents</outputDirectory>
            <includes>
                <include>edu.stanford.protege:jre.os-x:jar</include>
            </includes>
            <unpack>true</unpack>
            <unpackOptions>
                <excludes>
                    <exclude>META-INF</exclude>
                    <exclude>META-INF/**/*</exclude>
                </excludes>
            </unpackOptions>
            <fileMode>0755</fileMode>
            <directoryMode>0755</directoryMode>
        </dependencySet>

    </dependencySets>

    <fileSets>

        <fileSet>
            <directory>src/main/felix</directory>
            <outputDirectory>${osx.bundle.name}/Contents</outputDirectory>
            <includes>
                <include>**/*</include>
            </includes>
        </fileSet>

        <fileSet>
            <directory>src/main/logging</directory>
            <outputDirectory>${osx.bundle.name}/Contents</outputDirectory>
            <includes>
                <include>**/*</include>
            </includes>
        </fileSet>

        <fileSet>
            <directory>src/main/resources</directory>
            <outputDirectory>${osx.bundle.name}/Contents</outputDirectory>
            <includes>
                <include>conf/**</include>
            </includes>
        </fileSet>


        <fileSet>
            <directory>src/main/env/os-x</directory>
            <outputDirectory>${osx.bundle.name}/Contents/</outputDirectory>
            <excludes>
                <exclude>Info.plist</exclude>
            </excludes>
        </fileSet>

    </fileSets>

    <files>
        <file>
            <source>src/main/env/os-x/Info.plist</source>
            <outputDirectory>${osx.bundle.name}/Contents/</outputDirectory>
            <filtered>true</filtered>
        </file>
    </files>

</assembly>
