<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"/>
            </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"/>
            </fileset>
        </copy>
        <copy todir="target/examples/providers" overwrite="true">
            <fileset dir="../../examples/providers">
                <exclude name="**/target/**"/>
                <exclude name="**/*.iml"/>
                <exclude name="**/*.unconfigured"/>
                <exclude name="**/subsystem-config.xml"/>
            </fileset>
        </copy>
        <copy todir="target/examples/saml" overwrite="true">
            <fileset dir="../../examples/saml">
                <exclude name="**/target/**"/>
                <exclude name="**/*.iml"/>
                <exclude name="**/*.unconfigured"/>
                <exclude name="**/subsystem-config.xml"/>
            </fileset>
        </copy>
        <copy todir="target/examples/broker" overwrite="true">
            <fileset dir="../../examples/broker">
                <exclude name="**/target/**"/>
                <exclude name="**/*.iml"/>
                <exclude name="**/*.unconfigured"/>
                <exclude name="**/subsystem-config.xml"/>
            </fileset>
        </copy>
        <copy todir="target/examples/js-console" overwrite="true">
            <fileset dir="../../examples/js-console">
                <exclude name="**/target/**"/>
                <exclude name="**/*.iml"/>
                <exclude name="**/*.unconfigured"/>
                <exclude name="**/subsystem-config.xml"/>
            </fileset>
        </copy>
        <copy todir="target/examples/multi-tenant" overwrite="true">
            <fileset dir="../../examples/multi-tenant">
                <exclude name="**/target/**"/>
                <exclude name="**/*.iml"/>
                <exclude name="**/*.unconfigured"/>
                <exclude name="**/subsystem-config.xml"/>
            </fileset>
        </copy>
        <copy todir="target/examples/basic-auth" overwrite="true">
            <fileset dir="../../examples/basic-auth">
                <exclude name="**/target/**"/>
                <exclude name="**/*.iml"/>
                <exclude name="**/*.unconfigured"/>
                <exclude name="**/subsystem-config.xml"/>
            </fileset>
        </copy>
        <copy todir="target/examples/admin-client" overwrite="true">
            <fileset dir="../../examples/admin-client">
                <exclude name="**/target/**"/>
                <exclude name="**/*.iml"/>
                <exclude name="**/*.unconfigured"/>
                <exclude name="**/subsystem-config.xml"/>
            </fileset>
        </copy>
        <copy todir="target/examples/themes" overwrite="true">
            <fileset dir="../../examples/themes">
                <exclude name="**/target/**"/>
                <exclude name="**/*.iml"/>
                <exclude name="**/*.unconfigured"/>
                <exclude name="**/subsystem-config.xml"/>
            </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"/>
            </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="**/keycloak.json"/>
                <exclude name="**/target/**"/>
                <exclude name="**/*.iml"/>
                <exclude name="**/README.md"/>
            </fileset>
        </copy>
        <copy todir="target/examples/fuse" overwrite="true">
            <fileset dir="../../examples/fuse">
                <exclude name="**/target/**"/>
                <exclude name="**/*.iml"/>
            </fileset>
        </copy>
        <copy todir="target/examples/kerberos" overwrite="true">
            <fileset dir="../../examples/kerberos">
                <exclude name="**/target/**"/>
                <exclude name="**/*.iml"/>
            </fileset>
        </copy>
        <copy file="../../examples/README.md" 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>
