<project name="example-dist" basedir="." default="all">

    <target name="all">
        <delete dir="target/examples"/>
        <copy todir="target/examples/cors" overwrite="true">
            <fileset dir="../../examples/cors">
                <exclude name="**/target/**"/>
                <exclude name="**/*.iml"/>
                <exclude name="**/*.unconfigured"/>
                <exclude name="**/subsystem-config.xml"/>
                <exclude name="**/README.md.overview"/>
            </fileset>
        </copy>
        <copy todir="target/examples/cordova" overwrite="true">
            <fileset dir="../../examples/cordova">
                <exclude name="**/target/**"/>
                <exclude name="**/*.iml"/>
                <exclude name="**/*.unconfigured"/>
                <exclude name="**/subsystem-config.xml"/>
                <exclude name="**/README.md.overview"/>
            </fileset>
        </copy>
        <copy todir="target/examples/preconfigured-demo" overwrite="true">
            <fileset dir="../../examples/demo-template">
                <exclude name="**/target/**"/>
                <exclude name="**/*.iml"/>
                <exclude name="**/*.unconfigured"/>
                <exclude name="**/subsystem-config.xml"/>
                <exclude name="**/README.md.overview"/>
            </fileset>
        </copy>
        <copy todir="target/examples/unconfigured-demo" overwrite="true">
            <fileset dir="../../examples/demo-template">
                <exclude name="**/*.wildfly"/>
                <exclude name="**/*.as7"/>
                <exclude name="**/WEB-INF/jboss-web.xml"/>
                <exclude name="**/WEB-INF/keycloak.json"/>
                <exclude name="**/target/**"/>
                <exclude name="**/*.iml"/>
                <exclude name="**/README.md"/>
                <exclude name="**/README.md.overview"/>
            </fileset>
        </copy>
        <copy file="../../examples/demo-template/README.md.overview" tofile="target/examples/README.md"/>
        <move file="target/examples/unconfigured-demo/README.md.unconfigured" tofile="target/examples/unconfigured-demo/README.md"/>
        <move file="target/examples/unconfigured-demo/customer-app/src/main/webapp/WEB-INF/web.xml.unconfigured" tofile="target/examples/unconfigured-demo/customer-app/src/main/webapp/WEB-INF/web.xml"/>
        <move file="target/examples/unconfigured-demo/product-app/src/main/webapp/WEB-INF/web.xml.unconfigured" tofile="target/examples/unconfigured-demo/product-app/src/main/webapp/WEB-INF/web.xml"/>
        <move file="target/examples/unconfigured-demo/database-service/src/main/webapp/WEB-INF/web.xml.unconfigured" tofile="target/examples/unconfigured-demo/database-service/src/main/webapp/WEB-INF/web.xml"/>
    </target>
</project>
