使用Ant修改文件编码

<?xml version="1.0" encoding="utf-8" ?>
<project name ="vtigercrm language pack" default ="encoding" > 
	<property name="basedir" value="./"/>
	<property name ="target.dir" value ="${basedir}/target"/> 
	<property name ="output.encoding" value ="UTF-8"/> 

	<target name="default" depends="encoding" description="default: build everything" />
	<target name ="init" depends ="clean"> 
		<mkdir dir ="${target.dir}" /> 
	</target > 

	<target name ="clean" > 
		<delete dir ="${target.dir}" /> 
	</target > 

	<target name ="encoding" depends ="init" > 
		<copy todir ="${target.dir}" outputencoding ="${output.encoding}"> 
			<fileset dir ="${basedir}" > 
				<include name ="**/*.java" /> 
			</fileset > 
			<filterset > 
				<filter token ="ENCODING" value ="${output.encoding}" /> 
			</filterset > 
		</copy > 
	</target > 
</project > 

 

你可能感兴趣的:(xml,ant)