<!--
  ~ 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.bouncycastle">
            <maven-resource group="org.bouncycastle" artifact="bcprov-jdk15on"/>
            <maven-resource group="org.bouncycastle" artifact="bcpkix-jdk15on"/>
        </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-tomcat-adapter-spi"/>
            <maven-resource group="org.keycloak" artifact="keycloak-as7-adapter-spi"/>
        </module-def>

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

        <module-def name="org.keycloak.keycloak-saml-adapter-core">
            <maven-resource group="org.keycloak" artifact="keycloak-saml-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-saml-as7-adapter">
            <maven-resource group="org.keycloak" artifact="keycloak-saml-as7-adapter"/>
            <maven-resource group="org.keycloak" artifact="keycloak-saml-tomcat-adapter-core"/>
        </module-def>

        <module-def name="org.keycloak.keycloak-saml-as7-subsystem">
            <maven-resource group="org.keycloak" artifact="keycloak-saml-as7-subsystem"/>
        </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>
