本文共 5265 字,大约阅读时间需要 17 分钟。
<?xml version="1.0" encoding="utf-8" ?>
<project name="init" basedir="."> <target name="init" depends="initParameter"> <copy file="template\${OldEntityName}." tofile="src\${newEntityName}.java" /> <copy file="template\${OldEntityName}Dao.java" tofile="src\${newEntityName}Dao.java" /> <copy file="template\${OldEntityName}DaoImpl.java" tofile="src\${newEntityName}DaoImpl.java" /> <copy file="template\${OldEntityName}Service.java" tofile="src\${newEntityName}Service.java" /> <copy file="template\${OldEntityName}ServiceImpl.java" tofile="src\${newEntityName}ServiceImpl.java" /> <copy file="template\${OldEntityName}Action.java" tofile="src\${newEntityName}Action.java" /> <copy file="template\${OldEntityName}Test.java" tofile="src\${newEntityName}ServiceTest.java" /><copy file="template\${oldentityname}.js" tofile="src\${newentityname}.js" />
<copy file="template\${oldentityname}inc.txt" tofile="src\${newentityname}.inc" />
<copy file="template\struts-${oldentityname}.xml" tofile="src\struts-${newentityname}.xml" />
<copy file="template\${oldentityname}list.jsp" tofile="src\${newentityname}list.jsp" />
<copy file="template\${oldentityname}save.jsp" tofile="src\${newentityname}save.jsp" /> <copy file="template\${oldentityname}find.jsp" tofile="src\${newentityname}find.jsp" /> <copy file="template\${oldentityname}update.jsp" tofile="src\${newentityname}update.jsp" /><replaceregexp match="${oldentityname}" replace="${newentityname}" byline="true">
<fileset dir="src" includes="**/*.*" /> </replaceregexp><replaceregexp match="${OldEntityName}" replace="${NewEntityName}" byline="true">
<fileset dir="src" includes="**/*.*" /> </replaceregexp><replaceregexp match="${oldmodulename}" replace="${newmodulename}" byline="true">
<fileset dir="src" includes="**/*.*" /> </replaceregexp><replaceregexp match="${OldModuleName}" replace="${NewModuleName}" byline="true">
<fileset dir="src" includes="**/*.*" /> </replaceregexp></target>
<target name="copyNewFileToProject">
<copy file="src\${NewEntityName}.java" tofile="${projectBasePath}\src\com\huike\hidp\system\${newmodulename}\vo\${NewEntityName}.java" /> <copy file="src\${NewEntityName}Dao.java" tofile="${projectBasePath}\src\com\huike\hidp\system\${newmodulename}\dao\${NewEntityName}Dao.java" /> <copy file="src\${NewEntityName}DaoImpl.java" tofile="${projectBasePath}\src\com\huike\hidp\system\${newmodulename}\dao\impl\${NewEntityName}Service.java" /> <copy file="src\${NewEntityName}Service.java" tofile="${projectBasePath}\src\com\huike\hidp\system\${newmodulename}\service\${NewEntityName}Service.java" /> <copy file="src\${NewEntityName}ServiceImpl.java" tofile="${projectBasePath}\src\com\huike\hidp\system\${newmodulename}\service\impl\${NewEntityName}Service.java" /> <copy file="src\${NewEntityName}Action.java" tofile="${projectBasePath}\src\com\huike\hidp\system\${newmodulename}\action\${NewEntityName}Service.java" /> <copy file="src\${NewEntityName}ServiceTest.java" tofile="${projectBasePath}\testsrc\com\huike\hidp\system\${newmodulename}\service\${NewEntityName}ServiceTest.java" /></target>
<target name="initParameter">
<property name="oldmodulename" value="informationmanager" /> <property name="OldEntityName" value="Note" /><property name="oldModuleName" value="informationmanager" />
<property name="oldEntityName2" value="note" /><property name="NewModuleName" value="Informationmanager" />
<property name="newModuleName" value="informationmanager" /> <property name="NewEntityName" value="Note" /> <property name="newEntityName2" value="note" /> <property name="projectBasePath" value="F:\Working\workspace\phmis" /> <delete dir="WebRoot" /> <delete dir="src" /> </target> <target name="createTemplate"><property name="projectBasePath" value="F:\Working\workspace\phmis" />
<property name="oldmodulename" value="informationmanager" /> <property name="OldModuleName" value="Informationmanager" /> <property name="NewModulename" value="Informationmanager" /> <property name="OldEntityName" value="Note" /> <property name="NewEntityName" value="Note" /><property name="ModuleClassName" value="InformationManager"/>
<copy tofile="template\${NewEntityName}.java" file="${projectBasePath}\src\com\huike\hidp\system\${oldmodulename}\vo\${OldEntityName}.java" />
<copy tofile="template\${NewModuleName}Dao.java" file="${projectBasePath}\src\com\huike\hidp\system\${oldmodulename}\dao\${OldModuleName}Dao.java" /> <copy tofile="template\${NewModuleName}DaoImpl.java" file="${projectBasePath}\src\com\huike\hidp\system\${oldmodulename}\dao\impl\${OldModuleName}DaoImpl.java" /> <copy tofile="template\${NewModuleName}Service.java" file="${projectBasePath}\src\com\huike\hidp\system\${oldmodulename}\service\${OldModuleName}Service.java" /> <copy tofile="template\${NewModuleName}ServiceImpl.java" file="${projectBasePath}\src\com\huike\hidp\system\${oldmodulename}\service\impl\${OldModuleName}ServiceImpl.java" /> <copy tofile="template\${NewModuleName}Action.java" file="${projectBasePath}\src\com\huike\hidp\system\${oldmodulename}\action\${OldModuleName}Service.java" /> <copy tofile="template\${NewModuleName}ServiceTest.java" file="${projectBasePath}\testsrc\com\huike\hidp\system\${oldmodulename}\service\${ModuleClassName}ServiceTest.java" /> </target> </project>转载地址:http://qnkda.baihongyu.com/