<!--
  ~ Copyright 2016 Red Hat, Inc. and/or its affiliates
  ~ and other contributors as indicated by the @author tags.
  ~
  ~ 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.
  -->

<project name="module-repository" basedir="." default="all">

    <import file="lib.xml"/>

    <property name="output.dir" value="target"/>

    <target name="all">
        <antcall target="modules">
            <param name="mavenized.modules" value="false"/>
            <param name="output.dir" value="target"/>
        </antcall>
    </target>


    <target name="modules">

        <!-- server min dependencies -->

        <module-def name="org.keycloak.keycloak-common">
            <maven-resource group="org.keycloak" artifact="keycloak-common"/>
        </module-def>

        <module-def name="org.keycloak.keycloak-core">
            <maven-resource group="org.keycloak" artifact="keycloak-core"/>
        </module-def>


        <!-- subsystems -->

        <module-def name="org.keycloak.keycloak-adapter-spi">
            <maven-resource group="org.keycloak" artifact="keycloak-adapter-spi"/>
            <maven-resource group="org.keycloak" artifact="keycloak-undertow-adapter-spi"/>
        </module-def>

        <module-def name="org.keycloak.keycloak-adapter-core">
            <maven-resource group="org.keycloak" artifact="keycloak-adapter-core"/>
        </module-def>

        <module-def name="org.keycloak.keycloak-jboss-adapter-core">
            <maven-resource group="org.keycloak" artifact="keycloak-jboss-adapter-core"/>
        </module-def>

        <module-def name="org.keycloak.keycloak-undertow-adapter">
            <maven-resource group="org.keycloak" artifact="keycloak-undertow-adapter"/>
        </module-def>

        <module-def name="org.keycloak.keycloak-wildfly-adapter">
            <maven-resource group="org.keycloak" artifact="keycloak-wildfly-adapter"/>
        </module-def>

        <module-def name="org.keycloak.keycloak-wildfly-subsystem">
            <maven-resource group="org.keycloak" artifact="keycloak-wildfly-subsystem"/>
        </module-def>

        <module-def name="org.keycloak.keycloak-servlet-oauth-client">
            <maven-resource group="org.keycloak" artifact="keycloak-servlet-oauth-client"/>
        </module-def>

    </target>

    <target name="clean-target">
        <delete dir="${output.dir}"/>
    </target>

    <target name="clean" depends="clean-target">
        <delete file="maven-ant-tasks.jar"/>
    </target>

</project>
