| <?xml version="1.0"?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you 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="ivy"> |
| <description>Targets for ivy.xml creation/handling</description> |
| |
| <dirname property="common.basedir" file="${ant.file.ivy}"/> |
| <import file="${common.basedir}/common-tasks.xml"/> |
| |
| <!-- ========================================================== --> |
| <!-- init all the Ivy support --> |
| <!-- ========================================================== --> |
| <target name="ivy-init" |
| depends="setup"> |
| <property name="ivy.organization" value="apache"/> |
| <property name="target.ivy.xml" |
| location="${build.lib}/${artifact.stub}-ivy.xml"/> |
| <tstamp> |
| <format property="publication.datetime" pattern="yyyyMMddHHmmss"/> |
| </tstamp> |
| |
| <!--look for a template Ivy file --> |
| <property name="project.ivy.xml" location="project-template.ivy.xml"/> |
| <available property="project.has-ivy.xml?" file="${project.ivy.xml}"/> |
| </target> |
| |
| |
| <!-- ========================================================== --> |
| <!-- ivy.xml creation/copy, depending on whether it exists or not --> |
| <!-- ========================================================== --> |
| |
| <!--copy an existing template--> |
| <target name="copy-ivy.xml" depends="ivy-init" if="project.has-ivy.xml?"> |
| <expandingcopy file="${project.ivy.xml}" tofile="${target.ivy.xml}"/> |
| </target> |
| |
| |
| <!-- inline creation of a zero dependency ivy.xml. |
| We don't even declare a dependency on ant! |
| --> |
| <target name="make-ivy.xml" depends="ivy-init" unless="project.has-ivy.xml?"> |
| <echo message="Creating ivy.xml ${target.ivy.xml}" level="verbose"/> |
| <echoxml file="${target.ivy.xml}"> |
| <ivy-module version="1.3"> |
| <info organization="${ivy.organization}" |
| module="${artifact.name}" |
| revision="${artifact.version}" |
| publication="${publication.datetime}"> |
| <license name="Apache Software License 2.0" |
| url="http://www.apache.org/licenses/LICENSE-2.0"/> |
| <ivy-author name="Apache Ant Development Team" |
| url="http://ant.apache.org/"/> |
| </info> |
| </ivy-module> |
| </echoxml> |
| </target> |
| |
| <target name="ivy.xml" depends="copy-ivy.xml,make-ivy.xml"> |
| <checksum file="${target.ivy.xml}" algorithm="md5"/> |
| <checksum file="${target.ivy.xml}" algorithm="sha1"/> |
| </target> |
| |
| </project> |