1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <!--
3+ Copyright 2010 SpringSource
4+
5+ Licensed under the Apache License, Version 2.0 (the "License");
6+ you may not use this file except in compliance with the License.
7+ You may obtain a copy of the License at
8+
9+ http://www.apache.org/licenses/LICENSE-2.0
10+
11+ Unless required by applicable law or agreed to in writing, software
12+ distributed under the License is distributed on an "AS IS" BASIS,
13+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ See the License for the specific language governing permissions and
15+ limitations under the License.
16+ -->
17+ <project name =" artifact-common" xmlns : ivy =" antlib:org.apache.ivy.ant"
18+ xmlns:bundlor=" antlib:com.springsource.bundlor.ant" >
19+
20+ <!-- Main targets -->
21+ <target name =" javadoc-all" depends =" ivy.init, resolve.compile, src.init" if =" src.exists"
22+ description=" Creates javadoc documentation for all classes." >
23+ <java-doc input.dir=" ${main.java.dir}" output.dir=" ${javadoc-all.output.dir}" classpath.id=" compile.classpath"
24+ access=" private" />
25+ </target >
26+
27+ <target name =" javadoc-api" depends =" ivy.init, resolve.compile, src.init" if =" src.exists"
28+ description=" Creates javadoc documentation for all classes." >
29+ <java-doc input.dir=" ${main.java.dir}" output.dir=" ${javadoc-api.output.dir}" classpath.id=" compile.classpath"
30+ access=" protected" exclude.package.names=" ${javadoc.exclude.package.names}" />
31+ </target >
32+
33+ <target name =" jar" depends =" ivy.init, resolve.compile, compile.init, jar.init"
34+ description=" Creates a JAR file containing the output of a compilation of the source tree." >
35+ <delete quiet =" true" file =" ${ivy.output.file}" />
36+ <mkdir dir =" ${ivy.output.dir}" />
37+ <delete quiet =" true" file =" ${jar.output.file}" />
38+ <mkdir dir =" ${jar.output.dir}" />
39+ <delete quiet =" true" file =" ${source-jar.output.file}" />
40+ <mkdir dir =" ${source-jar.output.dir}" />
41+
42+ <compile classpath.id=" compile.classpath" input.dir=" ${main.java.dir}" output.dir=" ${main.output.dir}"
43+ resources.dir=" ${main.resources.dir}" />
44+ <ivy : retrieve resolveId =" additional.classpath" conf =" additional" type =" jar" transitive =" false"
45+ pattern=" ${main.output.dir}/[artifact]-[revision].[ext]" log =" download-only" />
46+ <antcall target =" bundlor" />
47+ <jar destfile =" ${jar.output.file}" basedir =" ${main.output.dir}" index =" true" filesetmanifest =" merge" >
48+ <manifest >
49+ <attribute name =" Bundle-ManifestVersion" value =" 2" />
50+ <attribute name =" Bundle-Version" value =" ${bundle.version}" />
51+ <attribute name =" Bundle-Creator" value =" ${user.name}" />
52+ <attribute name =" Implementation-Title" value =" ${implementation.title}" />
53+ <attribute name =" Implementation-Version" value =" ${implementation.version}" />
54+ </manifest >
55+ </jar >
56+ <jar destfile =" ${source-jar.output.file}" basedir =" ${main.java.dir}" index =" true" />
57+ <ivy : publish resolver =" integration" pubdate =" ${timestamp}" status =" ${release.type}" >
58+ <artifacts pattern =" ${ivy.output.dir}/[artifact].[ext]" />
59+ <artifacts pattern =" ${jar.output.dir}/[artifact].[ext]" />
60+ <artifacts pattern =" ${source-jar.output.dir}/[artifact].[ext]" />
61+ <artifacts pattern =" ${license.dir}/[artifact].[ext]" />
62+ </ivy : publish >
63+ </target >
64+
65+ <!-- Other targets -->
66+ <propertyset id =" bundlor.properties" />
67+
68+ <target name =" compile.init" depends =" ivy.init" />
69+
70+ <target name =" jar.init" >
71+ <fail message =" The 'integration.repo.dir' property must be set on this project." >
72+ <condition >
73+ <not >
74+ <isset property =" integration.repo.dir" />
75+ </not >
76+ </condition >
77+ </fail >
78+ <fail message =" The 'ivy.cache.dir' property must be set on this project." >
79+ <condition >
80+ <not >
81+ <isset property =" ivy.cache.dir" />
82+ </not >
83+ </condition >
84+ </fail >
85+ <fail message =" The 'version' property must be set on this project." >
86+ <condition >
87+ <not >
88+ <isset property =" version" />
89+ </not >
90+ </condition >
91+ </fail >
92+ </target >
93+
94+ <target name =" bundlor" depends =" bundlor.init" unless =" disable.bundlor" >
95+ <bundlor : bundlor inputPath =" ${main.output.dir}" outputPath =" ${main.output.dir}"
96+ bundleVersion=" ${bundle.version}" manifestTemplatePath =" ${manifest.template.file}"
97+ failOnWarnings=" ${fail.on.warnings}" >
98+ <propertyset refid =" bundlor.properties" />
99+ <propertyset >
100+ <propertyref builtin =" all" />
101+ </propertyset >
102+ </bundlor : bundlor >
103+ </target >
104+
105+ <target name =" bundlor.init" depends =" ivy.init" unless =" disable.bundlor" >
106+ <ivy : cachepath resolveId =" bundlor.classpath" pathid =" bundlor.classpath" organisation =" com.springsource.bundlor"
107+ module=" com.springsource.bundlor.ant" revision =" ${bundlor.ant.version}" conf =" ant" inline =" true"
108+ type=" jar" log =" download-only" />
109+ <taskdef resource =" com/springsource/bundlor/ant/antlib.xml" uri =" antlib:com.springsource.bundlor.ant"
110+ classpathref=" bundlor.classpath" />
111+ </target >
112+
113+ <target name =" javadoc.prep" depends =" src.init" if =" src.exists" >
114+ <mkdir dir =" ${javadoc.prep.dir}" />
115+ <copy todir =" ${javadoc.prep.dir}" >
116+ <fileset dir =" ${main.java.dir}" erroronmissingdir =" false" />
117+ </copy >
118+ </target >
119+
120+ </project >
0 commit comments