Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 549011d1ce288876d9945d2ba97b8db9c22cf48c (plain) (blame)
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<?xml version="1.0" encoding="UTF-8"?>
<!--
	The following properties must be specified for this script.
	
	src.cmpn.jar	- The path to the osgi.cmpn.jar to be used as input.
	target.cmpn.dir	- The directory for cmpn binary and source output.
	target.util.dir - The directory for util binary and source output.
	temp.dir		- The directory for storing temporary build files.
	
	TODO Add support for updating package version exports in manifest.	
-->
<project name="project" default="main">
	<target name="main" depends="cmpn,util">
		<echo message="Processed target main"/>
	</target>
	
	<target name="cmpn" depends="cleanCmpn,extractCmpn,zipCmpn,copyCmpn">
		<echo message="Processed target cmpn"/>
	</target>
	
	<target name="util" depends="cleanUtil,extractUtil,zipUtil,copyUtil">
		<echo message="Processed target util"/>
	</target>
	
	<target name="copyCmpn" depends="copyCmpnBin,copyCmpnSrc">
		<echo message="Processed target copyCmpn"/>
	</target>
		
	<target name="copyCmpnBin">
		<echo message="Entering target copyCmpnBin"/>
		<echo message="Unzipping ${temp.dir}/cmpn/bin.zip to ${target.cmpn.dir}/"/>
		<unzip dest="${target.cmpn.dir}/" src="${temp.dir}/cmpn/bin.zip"/>
		<echo message="Exiting target copyCmpnBin"/>
	</target>
	
	<target name="copyCmpnSrc">
		<echo message="Entering target copyCmpnSrc"/>
		<echo message="Copying ${temp.dir}/cmpn/src.zip to ${target.cmpn.dir}/"/>
		<copy file="${temp.dir}/cmpn/src.zip" todir="${target.cmpn.dir}/"/>
		<echo message="Exiting target copyCmpnSrc"/>
	</target>
	
	<target name="copyUtil" depends="copyUtilBin,copyUtilSrc">
		<echo message="Processed target copyUtil"/>
	</target>
	
	<target name="copyUtilBin">
		<unzip dest="${target.util.dir}/" src="${temp.dir}/util/bin.zip"/>
	</target>
		
	<target name="copyUtilSrc">
		<echo message="Entering target copyUtilSrc"/>
		<echo message="Copying ${temp.dir}/util/src.zip to ${target.util.dir}/"/>
		<copy file="${temp.dir}/util/src.zip" todir="${target.util.dir}/"/>
		<echo message="Exiting target copyUtilSrc"/>
	</target>
	
	<target name="zipCmpn" depends="zipCmpnBin,zipCmpnSrc">
		<echo message="Processed target zipCmpn"/>
	</target>
		
	<target name="zipCmpnBin">
		<echo message="Entering target zipCmpnBin"/>
		<echo message="Zipping ${temp.dir}/cmpn/bin/ to ${temp.dir}/cmpn/bin.zip"/>
		<zip destfile="${temp.dir}/cmpn/bin.zip" basedir="${temp.dir}/cmpn/bin/"/>
		<echo message="Exiting target zipCmpnBin"/>
	</target>
	
	<target name="zipCmpnSrc">
		<echo message="Entering target zipCmpnSrc"/>
		<echo message="Zipping ${temp.dir}/cmpn/OSGI-OPT/src/ to ${temp.dir}/cmpn/src.zip"/>
		<zip destfile="${temp.dir}/cmpn/src.zip" basedir="${temp.dir}/cmpn/OSGI-OPT/src/"/>
		<echo message="Exiting target zipCmpnSrc"/>
	</target>
	
	<target name="zipUtil" depends="zipUtilBin,zipUtilSrc">
		<echo message="Processed target zipUtil"/>
	</target>
	
	<target name="zipUtilBin">
		<echo message="Entering target zipUtilBin"/>
		<echo message="Zipping ${temp.dir}/util/bin/ to ${temp.dir}/util/bin.zip"/>
		<zip destfile="${temp.dir}/util/bin.zip" basedir="${temp.dir}/util/bin/"/>
		<echo message="Exiting target zipUtilBin"/>
	</target>
		
	<target name="zipUtilSrc">
		<echo message="Entering target zipUtilSrc"/>
		<echo message="Zipping ${temp.dir}/util/OSGI-OPT/src/ to ${temp.dir}/util/src.zip"/>
		<zip destfile="${temp.dir}/util/src.zip" basedir="${temp.dir}/util/OSGI-OPT/src/"/>
		<echo message="Exiting target zipUtilSrc"/>
	</target>
	
	<target name="extractCmpn" depends="extractCmpnBin,extractCmpnSrc">
		<echo message="Processed target extractCmpn"/>
	</target>
		
	<target name="extractCmpnBin">
		<echo message="Entering target extractCmpnBin"/>
		<echo message="Unzipping specified contents from ${src.cmpn.jar} to ${temp.dir}/cmpn/bin/"/>
		<unzip dest="${temp.dir}/cmpn/bin/" src="${src.cmpn.jar}">
			<patternset>
				<include name="org/osgi/service/cm/**/*"/>
				<include name="org/osgi/service/component/**/*"/>
				<include name="org/osgi/service/device/**/*"/>
				<include name="org/osgi/service/event/**/*"/>
				<include name="org/osgi/service/http/**/*"/>
				<include name="org/osgi/service/io/**/*"/>
				<include name="org/osgi/service/log/**/*"/>
				<include name="org/osgi/service/metatype/**/*"/>
				<include name="org/osgi/service/provisioning/**/*"/>
				<include name="org/osgi/service/upnp/**/*"/>
				<include name="org/osgi/service/useradmin/**/*"/>
				<include name="org/osgi/service/wireadmin/**/*"/>
				<exclude name="**/packageinfo"/>
				<exclude name="**/package-info.class"/>
			</patternset>
		</unzip>
		<echo message="Exiting target extractCmpnBin"/>
	</target>
	
	<target name="extractCmpnSrc">
		<echo message="Entering target extractCmpnSrc"/>
		<echo message="Unzipping specified contents from ${src.cmpn.jar} to ${temp.dir}/cmpn/"/>
		<unzip dest="${temp.dir}/cmpn/" src="${src.cmpn.jar}">
			<patternset>
				<include name="OSGI-OPT/src/org/osgi/service/cm/**/*"/>
				<include name="OSGI-OPT/src/org/osgi/service/component/**/*"/>
				<include name="OSGI-OPT/src/org/osgi/service/device/**/*"/>
				<include name="OSGI-OPT/src/org/osgi/service/event/**/*"/>
				<include name="OSGI-OPT/src/org/osgi/service/http/**/*"/>
				<include name="OSGI-OPT/src/org/osgi/service/io/**/*"/>
				<include name="OSGI-OPT/src/org/osgi/service/log/**/*"/>
				<include name="OSGI-OPT/src/org/osgi/service/metatype/**/*"/>
				<include name="OSGI-OPT/src/org/osgi/service/provisioning/**/*"/>
				<include name="OSGI-OPT/src/org/osgi/service/upnp/**/*"/>
				<include name="OSGI-OPT/src/org/osgi/service/useradmin/**/*"/>
				<include name="OSGI-OPT/src/org/osgi/service/wireadmin/**/*"/>
			</patternset>
		</unzip>
		<echo message="Exiting target extractCmpnSrc"/>
	</target>
	
	<target name="extractUtil" depends="extractUtilBin,extractUtilSrc">
		<echo message="Processed target extractUtil"/>
	</target>
	
	<target name="extractUtilBin">
		<echo message="Entering target extractUtilBin"/>
		<echo message="Unzipping specified contents from ${src.cmpn.jar} to ${temp.dir}/util/bin/"/>
		<unzip dest="${temp.dir}/util/bin/" src="${src.cmpn.jar}">
			<patternset>
				<include name="org/osgi/util/measurement/**/*"/>
				<include name="org/osgi/util/position/**/*"/>
				<include name="org/osgi/util/xml/**/*"/>
				<exclude name="**/packageinfo"/>
				<exclude name="**/package-info.class"/>
			</patternset>
		</unzip>
		<echo message="Exiting target extractUtilBin"/>
	</target>
	
	<target name="extractUtilSrc">
		<echo message="Entering target extractUtilSrc"/>
		<echo message="Unzipping specified contents from ${src.cmpn.jar} to ${temp.dir}/util/"/>
		<unzip dest="${temp.dir}/util/" src="${src.cmpn.jar}">
			<patternset>
				<include name="OSGI-OPT/src/org/osgi/util/measurement/**/*"/>
				<include name="OSGI-OPT/src/org/osgi/util/position/**/*"/>
				<include name="OSGI-OPT/src/org/osgi/util/xml/**/*"/>
			</patternset>
		</unzip>
		<echo message="Exiting target extractUtilSrc"/>
	</target>
	
	<target name="cleanCmpn" depends="cleanCmpnTarget,cleanCmpnTemp">
		<echo message="Processed target cleanCmpn"/>
	</target>
	    			
	<target name="cleanCmpnTarget">
		<echo message="Entering target cleanCmpnTarget"/>
		<echo message="Deleting specified files from ${target.cmpn.dir}/"/>
		<delete includeemptydirs="true">
			<fileset dir="${target.cmpn.dir}/">
				<include name="src.zip"/>
				<include name="org/"/>
			</fileset>
		</delete>
		<echo message="Exiting target cleanCmpnTarget"/>
	</target>
		
	<target name="cleanCmpnTemp">
		<echo message="Entering target cleanCmpnTemp"/>
		<echo message="Deleting ${temp.dir}/cmpn/"/>
		<delete dir="${temp.dir}/cmpn/"/>
		<echo message="Exiting target cleanCmpnTemp"/>
	</target>
	
	<target name="cleanUtil" depends="cleanUtilTarget,cleanUtilTemp">
		<echo message="Processed target cleanUtil"/>
	</target>
	
	<target name="cleanUtilTarget">
		<echo message="Entering target cleanUtilTarget"/>
		<echo message="Deleting specified files from ${target.util.dir}/"/>
		<delete includeemptydirs="true">
			<fileset dir="${target.util.dir}/">
				<include name="src.zip"/>
				<include name="org/"/>
			</fileset>
		</delete>
		<echo message="Exiting target cleanUtilTarget"/>
	</target>
	
	<target name="cleanUtilTemp">
		<echo message="Entering target cleanUtilTemp"/>
		<echo message="Deleting ${temp.dir}/util/"/>
		<delete dir="${temp.dir}/util/"/>
		<echo message="Exiting target cleanUtilTemp"/>
	</target>
</project>

Back to the top