<?xml version='1.0' encoding='UTF-8'?>
<!--
  ~ JBoss, Home of Professional Open Source
  ~ Copyright 2010, Red Hat, Inc. and/or its affiliates, and individual contributors
  ~ by the @authors tag. See the copyright.txt in the distribution for a
  ~ full listing of individual contributors.
  ~
  ~ 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
  ~ http://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.
  -->

<assembly>
    <id>dist</id>
    <formats>
        <format>tar.gz</format>
        <format>zip</format>
    </formats>

    <!-- Configure the artifacts to include  -->
    <dependencySets>
        <!-- first the actual project artifacts -->
        <dependencySet>
            <outputDirectory>dist</outputDirectory>
            <includes>
                <include>org.hibernate:hibernate-validator-annotation-processor</include>
            </includes>
        </dependencySet>
        <dependencySet>
            <outputDirectory>dist</outputDirectory>
            <includes>
                <include>org.hibernate:hibernate-validator</include>
            </includes>
        </dependencySet>

        <!-- Now we take care of the transitive dependencies -->
        <dependencySet>
            <outputDirectory>dist/lib/required</outputDirectory>
            <includes>
                <include>javax.validation:validation-api</include>
                <include>org.jboss.logging:jboss-logging</include>
            </includes>
        </dependencySet>
        <dependencySet>
            <outputDirectory>dist/lib/optional</outputDirectory>
            <includes>
                <include>log4j:log4j</include>
                <include>joda-time:joda-time</include>
                <include>org.hibernate.javax.persistence:hibernate-jpa-2.0-api</include>
                <include>org.jsoup:jsoup</include>
            </includes>
        </dependencySet>
    </dependencySets>

    <files>
        <file>
            <source>../README.md</source>
            <outputDirectory>/</outputDirectory>
        </file>
        <file>
            <source>../changelog.txt</source>
            <outputDirectory>/</outputDirectory>
        </file>
        <file>
            <source>../copyright.txt</source>
            <outputDirectory>/</outputDirectory>
        </file>
        <file>
            <source>../license.txt</source>
            <outputDirectory>/</outputDirectory>
        </file>
    </files>

    <fileSets>
        <!-- Include all sources  -->
        <fileSet>
            <directory>..</directory>
            <outputDirectory>project</outputDirectory>
            <useDefaultExcludes>true</useDefaultExcludes>
            <excludes>
                <!-- we already have these files at the top level of the distribution -->
                <exclude>README.md</exclude>
                <exclude>changelog.txt</exclude>
                <exclude>copyright.txt</exclude>
                <exclude>license.txt</exclude>

                <!-- only needed for documentation and helper scripts, no need to include them -->
                <exclude>**/zanata.sh</exclude>
                <exclude>**/zanata.xml</exclude>
                <exclude>src/main/scripts/**</exclude>

                <!-- actual files which should be ignored -->
                <exclude>.git</exclude>
                <exclude>.gitignore</exclude>
                <exclude>**/target/**</exclude>
                <exclude>**/.idea/**</exclude>
                <exclude>.sonar-ide.properties</exclude>
                <exclude>**/*.iml</exclude>
                <exclude>**/*.ipr</exclude>
                <exclude>**/*.iws</exclude>
            </excludes>
        </fileSet>

        <!-- Include documentation -->
        <fileSet>
            <directory>target/site/apidocs</directory>
            <outputDirectory>docs/api</outputDirectory>
        </fileSet>
        <fileSet>
            <directory>../documentation/target/docbook/publish</directory>
            <outputDirectory>docs/reference</outputDirectory>
        </fileSet>

    </fileSets>

</assembly>
