mirror of https://github.com/apache/ant-ivy
180 lines
8.5 KiB
XML
180 lines
8.5 KiB
XML
<!--
|
|
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="IvyRelease" default="snapshot" xmlns:ivy="antlib:fr.jayasoft.ivy.ant">
|
|
<import file="build.xml"/>
|
|
|
|
<target name="generate-doc">
|
|
<!-- requires java 6 jdk in path and Apache Ant 1.7 -->
|
|
<copy todir="${doc.build.dir}">
|
|
<fileset dir="${doc.src.dir}" includes="images/**,style/**,samples/**" />
|
|
</copy>
|
|
<script language="javascript"><![CDATA[
|
|
importClass(java.io.File);
|
|
|
|
fs = project.createDataType("fileset");
|
|
fs.setDir( new File(project.getProperty("doc.src.dir")) );
|
|
fs.setIncludes("**/*.html");
|
|
fs.setExcludes("template.html,"
|
|
+"*Template.html,"
|
|
+"conflict-solving-algo.html,"
|
|
+"doc/use.html,"
|
|
+"doc/reference.html,"
|
|
+"samples/**,"
|
|
+"reports/**,"
|
|
+"xooki/**,"
|
|
+"presentations/**,"
|
|
+"test/**");
|
|
|
|
// Get the files (array) of that fileset
|
|
ds = fs.getDirectoryScanner(project);
|
|
srcFiles = ds.getIncludedFiles();
|
|
|
|
// iterate over that array
|
|
for (i=0; i<srcFiles.length; i++) {
|
|
|
|
// get the values via Java API
|
|
var file = new File(fs.getDir(project), srcFiles[i]);
|
|
|
|
var basedir = file.getParent();
|
|
var filename = file.getName();
|
|
var filepath = srcFiles[i].substring(0, srcFiles[i].lastIndexOf(project.getProperty("file.separator"))+1);
|
|
|
|
exec = project.createTask("exec");
|
|
exec.setDir(new File(basedir));
|
|
exec.setExecutable("jrunscript");
|
|
exec.createArg().setValue(project.getProperty("doc.src.dir")+"/xooki/xooki.js");
|
|
exec.createArg().setValue("-noddtree");
|
|
exec.createArg().setValue(filename);
|
|
exec.createArg().setValue(project.getProperty("doc.build.dir")+"/"+filepath);
|
|
exec.perform();
|
|
}
|
|
]]></script>
|
|
</target>
|
|
|
|
<target name="all-doc" depends="javadoc, generate-doc" />
|
|
|
|
<target name="init-snapshot" depends="default-version">
|
|
<property name="snapshot.full.name" value="apache-ivy-${build.version}" />
|
|
</target>
|
|
|
|
<target name="snapshot-src" depends="init-snapshot,all-doc">
|
|
<mkdir dir="${distrib.dir}"/>
|
|
<zip destfile="${distrib.dir}/${snapshot.full.name}-src.zip">
|
|
<zipfileset dir="${doc.build.dir}" prefix="${snapshot.full.name}/doc" excludes="**/reports/coverage/**,**/reports/test/**"/>
|
|
<zipfileset dir="${src.dir}" prefix="${snapshot.full.name}/src/java"/>
|
|
<zipfileset dir="${basedir}/src/example" prefix="${snapshot.full.name}/src/example"/>
|
|
<zipfileset dir="${test.dir}" prefix="${snapshot.full.name}/test/java"/>
|
|
<zipfileset dir="${basedir}/test/repositories" prefix="${snapshot.full.name}/test/repositories"/>
|
|
<zipfileset dir="${basedir}/test/buildlist" prefix="${snapshot.full.name}/test/buildlist"/>
|
|
<zipfileset dir="${basedir}/test/triggers" prefix="${snapshot.full.name}/test/triggers" excludes="**/cache/**"/>
|
|
<zipfileset dir="${basedir}/test/xsl" prefix="${snapshot.full.name}/test/xsl"/>
|
|
<zipfileset dir="${src.dir}/org/apache/ivy/plugins/parser/xml" includes="ivy.xsd" fullpath="${snapshot.full.name}/ivy.xsd"/>
|
|
<zipfileset dir="${basedir}" includes="MANIFEST.MF" fullpath="${snapshot.full.name}/MANIFEST.MF"/>
|
|
<zipfileset dir="${basedir}" includes="DISCLAIMER" fullpath="${snapshot.full.name}/DISCLAIMER"/>
|
|
<zipfileset dir="${basedir}" includes="NOTICE" fullpath="${snapshot.full.name}/NOTICE"/>
|
|
<zipfileset dir="${basedir}" includes="LICENSE" fullpath="${snapshot.full.name}/LICENSE"/>
|
|
<zipfileset dir="${basedir}" includes="CHANGES.txt" fullpath="${snapshot.full.name}/CHANGES.txt"/>
|
|
<zipfileset dir="${basedir}" includes="RELEASE_NOTES" fullpath="${snapshot.full.name}/RELEASE_NOTES"/>
|
|
<zipfileset dir="${basedir}" includes="ivysettings.xml" fullpath="${snapshot.full.name}/ivysettings.xml"/>
|
|
<zipfileset dir="${basedir}" includes="build.properties" fullpath="${snapshot.full.name}/build.properties"/>
|
|
<zipfileset dir="${basedir}" includes="ivy.xml" fullpath="${snapshot.full.name}/ivy.xml"/>
|
|
|
|
<zipfileset dir="${basedir}" includes="build.xml" fullpath="${snapshot.full.name}/build.xml"/>
|
|
</zip>
|
|
<tar destfile="${distrib.dir}/${snapshot.full.name}-src.tar.gz"
|
|
compression="gzip" longfile="gnu">
|
|
<zipfileset src="${distrib.dir}/${snapshot.full.name}-src.zip"/>
|
|
</tar>
|
|
</target>
|
|
|
|
<target name="snapshot-bin" depends="init-snapshot, jar, all-doc">
|
|
<mkdir dir="${distrib.dir}"/>
|
|
<ivy:deliver
|
|
deliverpattern="${distrib.dir}/ivy.xml"
|
|
pubrevision="${build.version}"
|
|
pubdate="${pubdate}"
|
|
status="${status}"/>
|
|
<zip destfile="${distrib.dir}/${snapshot.full.name}-bin.zip">
|
|
<zipfileset dir="${doc.build.dir}" prefix="${snapshot.full.name}/doc" excludes="**/reports/coverage/**,**/reports/test/**"/>
|
|
<zipfileset dir="${basedir}/src/example" prefix="${snapshot.full.name}/src/example"/>
|
|
<zipfileset dir="${basedir}" includes="DISCLAIMER" fullpath="${snapshot.full.name}/DISCLAIMER"/>
|
|
<zipfileset dir="${basedir}" includes="NOTICE" fullpath="${snapshot.full.name}/NOTICE"/>
|
|
<zipfileset dir="${basedir}" includes="LICENSE" fullpath="${snapshot.full.name}/LICENSE"/>
|
|
<zipfileset dir="${basedir}" includes="CHANGES.txt" fullpath="${snapshot.full.name}/CHANGES.txt"/>
|
|
<zipfileset dir="${basedir}" includes="RELEASE_NOTES" fullpath="${snapshot.full.name}/RELEASE_NOTES"/>
|
|
<zipfileset dir="${src.dir}/org/apache/ivy/plugins/parser/xml" includes="ivy.xsd" fullpath="${snapshot.full.name}/ivy.xsd"/>
|
|
<zipfileset dir="${basedir}" includes="ivy.xml" fullpath="${snapshot.full.name}/ivy.xml"/>
|
|
|
|
<zipfileset dir="${artifacts.build.dir}" includes="${final.name}" fullpath="${snapshot.full.name}/ivy-${build.version}.jar"/>
|
|
<zipfileset dir="${artifacts.build.dir}" includes="${final.core.name}" fullpath="${snapshot.full.name}/ivy-core-${build.version}.jar"/>
|
|
</zip>
|
|
<tar destfile="${distrib.dir}/${snapshot.full.name}-bin.tar.gz"
|
|
compression="gzip" longfile="gnu">
|
|
<zipfileset src="${distrib.dir}/${snapshot.full.name}-bin.zip"/>
|
|
</tar>
|
|
<copy file="${artifacts.build.dir}/${final.name}" todir="${distrib.dir}" />
|
|
<copy file="${artifacts.build.dir}/${final.core.name}" todir="${distrib.dir}" />
|
|
<copy file="${src.dir}/org/apache/ivy/plugins/parser/xml/ivy.xsd" todir="${distrib.dir}" />
|
|
</target>
|
|
|
|
<target name="snapshot-checksums">
|
|
<checksum algorithm="md5">
|
|
<fileset dir="${distrib.dir}">
|
|
<include name="*.zip"/>
|
|
<include name="*.gz"/>
|
|
</fileset>
|
|
</checksum>
|
|
<checksum algorithm="sha">
|
|
<fileset dir="${distrib.dir}">
|
|
<include name="*.zip"/>
|
|
<include name="*.gz"/>
|
|
</fileset>
|
|
</checksum>
|
|
</target>
|
|
|
|
<target name="snapshot-version">
|
|
<property name="version.prefix" value="${target.ivy.version}-dev-"/>
|
|
</target>
|
|
|
|
<target name="release-version">
|
|
<input message="please enter version: " addproperty="build.version"/>
|
|
<input message="please enter status: (integration,milestone,release)" addproperty="status"/>
|
|
</target>
|
|
|
|
<target name="snapshot" depends="localivy, clean-ivy-home, init-ivy, clean-all, snapshot-version, coverage-report, snapshot-src, snapshot-bin, snapshot-checksums"
|
|
description="used for nightly and integration builds"/>
|
|
<target name="release" depends="release-version, snapshot" description="make a new release of Ivy"/>
|
|
|
|
<!--
|
|
publication on ivy web site
|
|
requires to be logged in on people.apache.org
|
|
-->
|
|
<available property="loggedin" file="/www/incubator.apache.org/ivy/index.html"/>
|
|
<target name="publish-latest" if="loggedin" description="publishes the last snapshot done to ivy web site">
|
|
<property name="html.dir" value="/www/incubator.apache.org/ivy/downloads/latest/"/>
|
|
<delete>
|
|
<fileset dir="${html.dir}"/>
|
|
</delete>
|
|
<copy todir="${html.dir}">
|
|
<fileset dir="${distrib.dir}"/>
|
|
</copy>
|
|
</target>
|
|
|
|
</project>
|