ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sreejith.M.Janardhanan" <mjsreej...@vanenburg.com>
Subject RE: Updating default.properties in ant.jar for taskdefs
Date Wed, 17 Dec 2003 15:36:39 GMT

Hi Jan, 

That was great help!!

I did an <unjar>, <concat> and <jar update="true"> pointing to same directory
where the "default.properties" file was extracted. So, I didn't use <jar><zipfileset
prefix> for updating the jar. Hope I am on the right track. I thought I will share the
ant file for others too in the mailing list.

<target name="copy-ant-library" >
	<mkdir dir="${temp.dir}"/>
	<echo message="Extracting the default.properties files from ant.jar..."/>
	<unjar src="${ant.library}" dest="${temp.dir}/src" >
	    <patternset>
	        <include name="org/**/taskdefs/defaults.properties"/> 
	    </patternset>
	</unjar>
	<concat destfile="${temp.dir}/src/org/apache/tools/ant/taskdefs/defaults.properties" append="true">
		<filelist dir="projects/anttasks" files="task.properties" />
	</concat>
	<copy file="${ant.library}" todir="${temp.dir}"></copy>
	<jar jarfile="${temp.dir}/ant.jar" basedir="${temp.dir}/src" update="true" />
	<echo message="Copying the updated ant library to plug-in project..."/>
	<copy file="${temp.dir}/ant.jar" todir="${plug-in-resource-sdk}" />
	<delete dir="${temp.dir}" />
</target>    

Regards,
Sreejith

-----Original Message-----
From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de] 
Sent: Wednesday, December 17, 2003 12:52 PM
To: user@ant.apache.org
Subject: RE: Updating default.properties in ant.jar for taskdefs

Why not 
   <taskdef file=""/>  ???

or with Ant 1.6 and namespaces

   <project xmlns:my="antlib:com.mycompany.tools.ant">
       <my:custom1/>

So you havenĀ“t to worry about to ensure that a modified Ant version is on
the machine.

I personally would reject modifying a tools only for lazyness :-)
But if you want that, then:
- extract the default.properties from the ant.jar (<unjar>)
- add your lines to that (<concat>, <echo append>)
- update the jar (<jar><zipfileset prefix>)

Maybe you will have problems with updating the jar using Ant because
Ant uses that jar for itself :-) 


Jan




> -----Original Message-----
> From: Sreejith.M.Janardhanan [mailto:mjsreejith@vanenburg.com]
> Sent: Wednesday, December 17, 2003 8:13 AM
> To: user@ant.apache.org
> Subject: Updating default.properties in ant.jar for taskdefs
> 
> 
> Hi,
> 
> 	I want to append the following lines to end of file
> "defaults.properties" located in package 
> "org/apache/tools/ant/taskdefs"
> in "ant.jar" for avoiding writing taskdefs in all build files.
> 				
> # my custom tasks
> contentexport=com.mycompany.tools.ant.CustomTask1
> contentimport=com.mycompany.tools.ant.CustomTask2
> 
> I don't want to build the ant project with new "default.properties". I
> am having ant.jar ready and just have to update 
> default.properties in it
> using a ant build file (probably from another properties file). Can
> anyone tell me how I can achieve this?
> 
> Thanks in advance,
> 
> Regards,
> ____________________________
> Sreejith M Janardhanan
> 
> 
> 
> 
> **********************************************************************
> The information in this message is confidential and may be legally
> privileged. It is intended solely for the addressee. Access 
> to this message
> by anyone else is unauthorized. If you are not the intended 
> recipient, any
> disclosure, copying, or distribution of the message, or any action or
> omission taken by you in reliance on it, is prohibited and 
> may be unlawful.
> Please immediately contact the sender if you have received 
> this message in
> error.
> 
> **********************************************************************
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message