Subversion Repositories DevTools

Rev

Rev 1968 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1968 Rev 1970
Line 142... Line 142...
142
			</if>
142
			</if>
143
 
143
 
144
		</sequential>
144
		</sequential>
145
 
145
 
146
	</macrodef>
146
	</macrodef>
-
 
147
	
-
 
148
	
-
 
149
	<!-- used to remove the need to add a using line in your ant build file for every
-
 
150
		package listed in your dependency file. Simply call usingall instead and it
-
 
151
		will "detect" all the versions you are using and use them automatically.
-
 
152
		
-
 
153
		NOTE: This will make a copy of your depends.xml file to determine what
-
 
154
				packages to use.
-
 
155
				
-
 
156
		If for some reason you need to use the include and exclude items for some 
-
 
157
		pacakges, then don't use this macro.
-
 
158
		
-
 
159
		In addition, if there are order dependent usings, then list those first, and then
-
 
160
		use usingall to load the others (if they are already loaded then it will ignore them).
-
 
161
	-->
-
 
162
	<macrodef name="usingall">
-
 
163
	
-
 
164
		<attribute name="dependsFile" default="${ant.project.name}depends.xml"/>
-
 
165
		
-
 
166
		<sequential>
-
 
167
			<copy todir="${basedir}/build" overwrite="true">
-
 
168
				<fileset dir="${basedir}">
-
 
169
					<include name="@{dependsFile}"/>
-
 
170
				</fileset>
-
 
171
			</copy>
-
 
172
			
-
 
173
			<replaceregexp file="${basedir}/build/@{dependsFile}"
-
 
174
                         match='project.*name="'
-
 
175
                         replace='project name="tmp'
-
 
176
                         byline="true"/>
-
 
177
						 
-
 
178
			<replaceregexp file="${basedir}/build/@{dependsFile}"
-
 
179
                         match='property.*name="'
-
 
180
                         replace='property name="use.version.'
-
 
181
                         byline="true"/>
-
 
182
						 
-
 
183
			<import file="${basedir}/build/@{dependsFile}"/>
-
 
184
			
-
 
185
			<propertyselector property="use.versions"
-
 
186
                         delimiter=","
-
 
187
                         match="use\.version\.([^\.]*)"
-
 
188
                         select="\1"
-
 
189
                         casesensitive="false" />
-
 
190
						
-
 
191
			<for list="${use.versions}" delimiter="," param="use.version">
-
 
192
				<sequential>
-
 
193
					<if>
-
 
194
						<and>
-
 
195
							<not><equals arg1="@{use.version}" arg2="packagename"/></not>
-
 
196
							<not><equals arg1="@{use.version}" arg2="packageversion"/></not>
-
 
197
							<not><equals arg1="@{use.version}" arg2="ant-using"/></not>
-
 
198
						</and>
-
 
199
						<then>
-
 
200
							<using name="@{use.version}"/>
-
 
201
						</then>
-
 
202
					</if>
-
 
203
					
-
 
204
				</sequential>
-
 
205
			</for>
-
 
206
				
-
 
207
		</sequential>
-
 
208
	</macrodef>
147
 
209
 
148
</project>
210
</project>