<?xml version="1.0" encoding="UTF-8"?>

<!--
 ~ Copyright (c) 2010, 2014 Sonatype, Inc.
 ~ All rights reserved. This program and the accompanying materials
 ~ are made available under the terms of the Eclipse Public License v1.0
 ~ which accompanies this distribution, and is available at
 ~ http://www.eclipse.org/legal/epl-v10.html
 ~
 ~ Contributors:
 ~    Sonatype, Inc. - initial API and implementation
-->

<!DOCTYPE project [
       <!ENTITY common SYSTEM "../common.xml">
]>

<project xmlns:repo="antlib:org.eclipse.aether.ant">

  &common;

  <repo:pom file="${project.dir}/dummy-pom.xml" id="pom"/>
  <repo:artifact classifier="ant" file="${project.dir}/ant.xml" id="ant"/>

  <target name="setUp">
    <touch file="${project.dir}/dummy-pom.xml"/>
    <touch file="${project.dir}/other-pom.xml"/>
    <touch file="${project.dir}/ant.xml"/>
  </target>

  <target name="testInstallGlobalPom" depends="setUp">
    <repo:pom file="${project.dir}/dummy-pom.xml"/>
    <repo:install/>
  </target>

  <target name="testInstallOverrideGlobalPom" depends="setUp">
    <repo:pom file="${project.dir}/dummy-pom.xml"/>
    <repo:install>
      <pom file="${project.dir}/other-pom.xml"/>
    </repo:install>
  </target>

  <target name="testInstallOverrideGlobalPomByRef" depends="setUp">
    <repo:pom file="${project.dir}/dummy-pom.xml"/>
    <repo:pom file="${project.dir}/other-pom.xml" id="other"/>
    <repo:install/>
    <repo:install pomref="other"/>
  </target>

  <target name="testDefaultRepo" depends="setUp">
    <repo:install pomref="pom">
      <repo:artifact refid="ant"/>
    </repo:install>
  </target>

  <target name="testCustomRepo" depends="setUp">
    <repo:localrepo dir="${build.dir}/local-repo-custom" />
    <repo:install pomref="pom">
      <repo:artifact refid="ant"/>
    </repo:install>
  </target>

</project>
