File: build.xml

package info (click to toggle)
bnd 1.50.0-5
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 5,828 kB
  • sloc: java: 39,896; xml: 1,572; makefile: 112; sh: 53
file content (166 lines) | stat: -rw-r--r-- 6,070 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?xml version="1.0" encoding="UTF-8"?>
<!--
	The is main OSGi build file. It is included from projects
	as is.
	
	It is described in http://www2.osgi.org/members/Build/HomePage 
-->
<project name="master" default="none">

	<!-- 
	     INIT
	     The target is a dependent of all other targets.
	     It's purpose is to set up the environment only once
	     and avoid it being repeatedly done for each antcall.
	-->

	<target name="init" unless="initialized">
		<dirname property="projectdir" file="${ant.file}" />
		<dirname property="workspacedir" file="${projectdir}" />
		<taskdef resource="aQute/bnd/ant/taskdef.properties" classpath="${workspacedir}/aQute.libg/bin;${workspacedir}/biz.aQute.bndlib/bin:${workspacedir}/cnf/repo/biz.aQute.bnd/biz.aQute.bnd-latest.jar" />

		<bndprepare basedir="${projectdir}" print="false" top="${release.dir}" />

		<!-- mark init has been run -->
		<property name="initialized" value="set" />
		<echo>Enter project ${project.name}</echo>
	</target>

	<!-- 
		DEPENDENCIES
		Build project dependencies.
	-->
	<target name="dependencies" depends="init" if="project.dependson" unless="donotrecurse">
		<subant target="build" inheritAll="false" buildpath="${project.dependson}">
			<property name="donotrecurse" value="true" />
		</subant>
	</target>

	<!--
	     Test
	-->
	<target name="test" depends="compile">
		<bnd command="test" exceptions="true" basedir="${project}" />
	</target>

	<!--
	     COMPILE
	     Compile the sources. 
	-->
	<target name="compile" depends="dependencies" if="project.sourcepath">
		<mkdir dir="${project.output}" />
		<javac fork="yes" executable="${javac}" srcdir="${project.sourcepath}" destdir="${project.output}" classpath="${project.buildpath}" bootclasspath="${project.bootclasspath}" deprecation="true" listfiles="true" target="${javac.target}" source="${javac.source}" debug="${javac.debug}" includeAntRuntime="no" verbose="${verbose}" excludes="${javac.excludes}" />
		<!-- 
		  The eclipse compiler copies resources but the Javac compiler does not
		  If ${src} == ${bin} then this is not necessary, but unfortunately, now 
		  it is. 
		-->
		<copy todir="${project.output}" verbose="${verbose}" preservelastmodified="true">
			<fileset dir="${project.sourcepath}">
				<exclude name="**/*.java" />
				<exclude name="**/*.class" />
			</fileset>
		</copy>
	</target>

	<target name="deploy" depends="build">
		<bnd command="deploy" exceptions="true" basedir="${project}" />
	</target>
	<!-- 
		JARS
		Iterate of the jars to build.
	-->
	<target name="build" depends="compile">
		<bnd command="build" trace="true" exceptions="true" basedir="${project}" />
	</target>

	<target name="junit" depends="build">
		
		<junit showoutput="false" printsummary="true" failureproperty='stop' errorproperty='stop' fork="true" dir="${basedir}">
			<classpath path="${project.buildpath}" />
			<formatter type="xml" />
			<batchtest todir="tmp">
				<fileset dir="${src}">
					<include name="test/**.java" />
				</fileset>
			</batchtest>
		</junit>

		<fail if="stop" />
	</target>

	<target name="release" depends="build">
		<subant target="release" inheritall="false" buildpath="${project.dependson}">
			<property name="donotrecurse" value="true" />
		</subant>
		<bnd command="release" exceptions="true" basedir="${project}" />
	</target>

	<target name="release.bindex" depends="release">
		<echo message="bindex classpath: ${workspacedir}/cnf/repo/org.osgi.impl.bundle.bindex/org.osgi.impl.bundle.bindex-2.2.0.jar" />
		<taskdef name="bindex" classname="org.osgi.impl.bundle.bindex.ant.BindexTask">
			<classpath>
				<fileset dir="${workspacedir}/cnf/repo/org.osgi.impl.bundle.bindex" includes="org.osgi.impl.bundle.bindex-2.2.0.jar" />
			</classpath>
		</taskdef>

		<bindex root="${releaserepo}" repositoryfile="${releaserepo}/repository.xml" quiet="yes">
			<fileset dir="${releaserepo}" includes="**/*.jar" />
		</bindex>
	</target>

	<!--
	     CLEAN
	-->
	<target name="deepclean" depends="init,clean" if="project.dependson">
		<subant target="clean" inheritAll="false" buildpath="${project.dependson}" />
	</target>

	<target name="clean" depends="init">
		<delete dir="${project.output}" />
		<bnd command="clean" exceptions="true" basedir="${project}" />
	</target>

	<!--
	     ECHO
	-->
	<target name="echo" depends="init">
		<echo>verbose:                ${verbose}</echo>
		<echo>project.name:           ${project.name}</echo>
		<echo>project.output:         ${project.output}</echo>
		<echo>project.sourcepath:     ${project.sourcepath}</echo>
		<echo>project.allsourcepath:  ${project.allsourcepath}</echo>
		<echo>project.buildpath:      ${project.buildpath}</echo>
		<echo>project.testpath:       ${project.testpath}</echo>
		<echo>project.dependson:      ${project.dependson}</echo>
		<echo>project.bootclasspath:  ${project.bootclasspath}</echo>
		<echo>javac:                  ${javac}</echo>
		<echo>p:                      ${p}</echo>
		<echo>btool.manifestVersion:  ${btool.manifestVersion}</echo>
		<echo>btool.analyse:          ${btool.analyse}</echo>
		<echo>btool.showmanifest:     ${btool.showmanifest}</echo>
		<echo>btool.noversion:     	  ${btool.noversion}</echo>
		<echo>btool.sources:     	  ${btool.sources}</echo>
		<echo>btool.noextraheaders:   ${btool.noextraheaders}</echo>
		<echo>jars.compile.order:     ${jars.compile.order}</echo>
		<echo>bin.includes:           ${bin.includes}</echo>
		<echo>base.modfied:           ${base.modified} (${base.modified.readable})</echo>
		<echo>target:                 ${target}</echo>
		<echo>release.target:         ${release.target}</echo>
		<echo>licensed repo:          ${licensed-repo}</echo>
		<echo>repo:                   ${repo}</echo>
		<echo>releaserepo:            ${releaserepo}</echo>
		<echo>use.bnd:                ${use.bnd}</echo>
		<echo>nodeploy:               ${nodeploy}</echo>
		<echo>-dependson:             ${-dependson}</echo>

	</target>

	<!--
	     Default Target
	-->
	<target name="none">
		<fail message="This ant script should never be directly called." />
	</target>

</project>