您的位置:首页 > 大数据 > 人工智能

Grails 入门: 构建您的第一个 Grails 应用程序

2008-02-19 10:03 369 查看
<project name = "PPM" default = "all" basedir = "." >
<!-- 定义属性文件 -->
<property file="build.properties"/>
<property name="this.name" location="PPM"/>
<property name="this.path" location="${root}/${this.name}"/>
<property name="this.build" location="${this.path}/Build"/>
<property name="this.src" location="${mainProject.path}/ProductCode"/>
<property name="this.out" location="${mainProject.webinfo}/classes"/>
<property name="ear.dir" location="${shareLib.path}/build/Ear"/>
<property name="back.dir" location="${shareLib.path}/build/Back"/>

<property file="${shareLib.path}/build/buildversion.properties"/>
<taskdef name="uniteIbatisXml" classname="com.zte.ppm.common.util.UniteIbatisXml"/>
<taskdef name="uniteWebXml" classname="com.zte.ppm.common.util.UniteWebXml"/>

<property name="appFrame.buildfile" location="${appFrame.path}/build.xml" />
<property name="baseUtil.buildfile" location="${baseUtil.path}/build.xml" />
<property name="empOrg.buildfile" location="${empOrg.path}/build.xml" />
<property name="menuRight.buildfile" location="${menuRight.path}/build.xml" />
<property name="productSys.buildfile" location="${productSys.path}/build.xml" />
<property name="orgRight.buildfile" location="${orgRight.path}/build.xml" />
<property name="projectInfo.buildfile" location="${projectInfo.path}/build.xml" />
<property name="portofManage.buildfile" location="${protofManage.path}/build.xml" />

<!-- 下面两个是copy文件时调用的函数 -->
<target name="deployOneDir">
<delete dir="${mainProject.web}/${dir}"/>
<copy todir = "${mainProject.web}/${dir}" overwrite="true">
<fileset dir = "${project.path}/${dir}">
<include name = "**/*.*"/>
</fileset>
</copy>
</target>

<target name="deployXmlFile">
<copy todir = "${mainProject.webinfo}" overwrite="true">
<fileset dir = "${project.webinfo}">
<include name = "*-ssb-config.xml"/>
</fileset>
</copy>
</target>

<target name="copyBaseLib">
<delete>
<fileset dir="${mainProject.lib}" includes="*.jar"/>
</delete>
<copy todir = "${mainProject.lib}" overwrite="true">
<fileset dir = "${shareLib.lib}">
<exclude name = "PMS_CJ*.jar"/>
</fileset>
</copy>
</target>

<target name="clear">
<delete dir="${appFrame.path}" includes="**/*.class"/>
<delete dir="${baseUtil.path}" includes="**/*.class"/>
<delete dir="${empOrg.path}" includes="**/*.class"/>
<delete dir="${menuRight.path}" includes="**/*.class"/>
<delete dir="${productSys.path}" includes="**/*.class"/>
<delete dir="${orgRight.path}" includes="**/*.class"/>
<delete dir="${projectInfo.path}" includes="**/*.class"/>
<delete dir="${protofManage.path}" includes="**/*.class"/>
</target>

<!-- 构建所有组件 -->
<target name="build.appFrame">
<ant antfile="${appFrame.buildfile}" target="global" inheritAll="false" />
</target>
<target name="build.baseUtil">
<ant antfile="${baseUtil.buildfile}" target="global" inheritAll="false" />
</target>
<target name="build.empOrg">
<ant antfile="${empOrg.buildfile}" target="global" inheritAll="false" />
</target>
<target name="build.menuRight">
<ant antfile="${menuRight.buildfile}" target="global" inheritAll="false" />
</target>
<target name="build.productSys">
<ant antfile="${productSys.buildfile}" target="global" inheritAll="false" />
</target>
<target name="build.orgRight">
<ant antfile="${orgRight.buildfile}" target="global" inheritAll="false" />
</target>
<target name="build.projectInfo">
<ant antfile="${projectInfo.buildfile}" target="global" inheritAll="false" />
</target>
<target name="build.portofManage">
<ant antfile="${portofManage.buildfile}" target="global" inheritAll="false" />
</target>

<!-- copy所有jsp到PPM项目下 -->
<target name = "deployjsp">
<antcall target="deployOneDir">
<param name="dir" value="app/appframe"/>
<param name="project.path" value="${appFrame.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="common"/>
<param name="project.path" value="${appFrame.path}/WebContent"/>
</antcall>
<copy todir = "${mainProject.web}" overwrite="true">
<fileset dir = "${appFrame.path}/WebContent">
<include name = "*.jsp"/>
</fileset>
</copy>
<antcall target="deployOneDir">
<param name="dir" value="app/baseutil"/>
<param name="project.path" value="${baseUtil.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="app/emporg"/>
<param name="project.path" value="${empOrg.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="app/menuright"/>
<param name="project.path" value="${menuRight.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="app/productsys"/>
<param name="project.path" value="${productSys.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="app/orgright"/>
<param name="project.path" value="${orgRight.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="app/projectinfo"/>
<param name="project.path" value="${projectInfo.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="app/portofmanage"/>
<param name="project.path" value="${protofManage.path}/WebContent"/>
</antcall>
</target>

<!-- copy所有css到PPM项目下 -->
<target name = "deploycss">
<antcall target="deployOneDir">
<param name="dir" value="css"/>
<param name="project.path" value="${appFrame.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="css/baseutil"/>
<param name="project.path" value="${baseUtil.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="css/emporg"/>
<param name="project.path" value="${empOrg.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="css/menuright"/>
<param name="project.path" value="${menuRight.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="css/productsys"/>
<param name="project.path" value="${productSys.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="css/orgright"/>
<param name="project.path" value="${orgRight.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="css/projectinfo"/>
<param name="project.path" value="${projectInfo.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="css/portofmanage"/>
<param name="project.path" value="${protofManage.path}/WebContent"/>
</antcall>
</target>

<!-- copy所有图片到PPM项目下 -->
<target name = "deployimages">
<antcall target="deployOneDir">
<param name="dir" value="images"/>
<param name="project.path" value="${appFrame.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="images/baseutil"/>
<param name="project.path" value="${baseUtil.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="images/emporg"/>
<param name="project.path" value="${empOrg.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="images/menuright"/>
<param name="project.path" value="${menuRight.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="images/productsys"/>
<param name="project.path" value="${productSys.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="images/orgright"/>
<param name="project.path" value="${orgRight.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="images/projectinfo"/>
<param name="project.path" value="${projectInfo.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="images/portofmanage"/>
<param name="project.path" value="${protofManage.path}/WebContent"/>
</antcall>
</target>

<!-- copy所有js到PPM项目下 -->
<target name = "deployjs">
<antcall target="deployOneDir">
<param name="dir" value="js"/>
<param name="project.path" value="${appFrame.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="js/baseutil"/>
<param name="project.path" value="${baseUtil.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="js/emporg"/>
<param name="project.path" value="${empOrg.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="js/menuright"/>
<param name="project.path" value="${menuRight.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="js/productsys"/>
<param name="project.path" value="${productSys.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="js/orgright"/>
<param name="project.path" value="${orgRight.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="js/projectinfo"/>
<param name="project.path" value="${projectInfo.path}/WebContent"/>
</antcall>
<antcall target="deployOneDir">
<param name="dir" value="js/portofmanage"/>
<param name="project.path" value="${protofManage.path}/WebContent"/>
</antcall>
</target>

<!-- copy SSB配置文件到PPM项目下 -->
<target name = "deploySSBConfigFile">
<copy todir = "${mainProject.webinfo}" overwrite="true">
<fileset dir = "${appFrame.webinfo}">
<include name = "SSB_Assistant.xml"/>
<include name = "SSB_MainPage.xml"/>
<include name = "SSB_Menu.xml"/>
<include name = "SSB_Page.xml"/>
</fileset>
</copy>
<antcall target="deployXmlFile">
<param name="project.webinfo" value="${appFrame.webinfo}"/>
</antcall>
<antcall target="deployXmlFile">
<param name="project.webinfo" value="${baseUtil.webinfo}"/>
</antcall>
<antcall target="deployXmlFile">
<param name="project.webinfo" value="${empOrg.webinfo}"/>
</antcall>
<antcall target="deployXmlFile">
<param name="project.webinfo" value="${menuRight.webinfo}"/>
</antcall>
<antcall target="deployXmlFile">
<param name="project.webinfo" value="${productSys.webinfo}"/>
</antcall>
<antcall target="deployXmlFile">
<param name="project.webinfo" value="${orgRight.webinfo}"/>
</antcall>
<antcall target="deployXmlFile">
<param name="project.webinfo" value="${projectInfo.webinfo}"/>
</antcall>
<antcall target="deployXmlFile">
<param name="project.webinfo" value="${protofManage.webinfo}"/>
</antcall>
</target>

<!-- 合并ibatis配置文件 -->
<target name="deployibatis">
<uniteIbatisXml include="${ibatis.configFile}" target="${mainProject.webinfo}/SqlMapConfig.xml"/>
</target>

<!-- 合并web.xml文件 -->
<target name="deployweb">
<uniteWebXml include="${web.configFile}" target="${mainProject.webinfo}/web.xml"/>
</target>

<target name="unitResourceFile">
<delete>
<fileset dir="${mainProject.path}/ProductCode">
<include name="ssb_application_resource_en_US.properties"/>
<include name="ssb_application_resource_zh_CN.properties"/>
</fileset>
</delete>
<exec executable ="cmd">
<arg line="/c copy"/>
<arg value="${appFrame.path}/ProductCode/com/zte/pms/appframe/resource/ssb_application_resource_en_US.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="+"/>
<arg value="${baseUtil.path}/ProductCode/com/zte/pms/baseutil/resource/ssb_application_resource_en_US.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_en_US.properties"/>
</exec>
<exec executable ="cmd">
<arg line="/c copy"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_en_US.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="+"/>
<arg value="${empOrg.path}/ProductCode/com/zte/pms/emporg/resource/ssb_application_resource_en_US.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_en_US.properties"/>
</exec>
<exec executable ="cmd">
<arg line="/c copy"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_en_US.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="+"/>
<arg value="${menuRight.path}/ProductCode/com/zte/pms/menuright/resource/ssb_application_resource_en_US.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_en_US.properties"/>
</exec>
<exec executable ="cmd">
<arg line="/c copy"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_en_US.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="+"/>
<arg value="${productSys.path}/ProductCode/com/zte/pms/productsys/resource/ssb_application_resource_en_US.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_en_US.properties"/>
</exec>
<exec executable ="cmd">
<arg line="/c copy"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_en_US.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="+"/>
<arg value="${orgRight.path}/ProductCode/com/zte/pms/orgright/resource/ssb_application_resource_en_US.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_en_US.properties"/>
</exec>
<exec executable ="cmd">
<arg line="/c copy"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_en_US.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="+"/>
<arg value="${projectInfo.path}/ProductCode/com/zte/pms/projectinfo/resource/ssb_application_resource_en_US.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_en_US.properties"/>
</exec>
<exec executable ="cmd">
<arg line="/c copy"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_en_US.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="+"/>
<arg value="${protofManage.path}/ProductCode/com/zte/pms/portofmanage/resource/ssb_application_resource_en_US.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_en_US.properties"/>
</exec>

<exec executable ="cmd">
<arg line="/c copy"/>
<arg value="${appFrame.path}/ProductCode/com/zte/pms/appframe/resource/ssb_application_resource_zh_CN.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="+"/>
<arg value="${baseUtil.path}/ProductCode/com/zte/pms/baseutil/resource/ssb_application_resource_zh_CN.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_zh_CN.properties"/>
</exec>
<exec executable ="cmd">
<arg line="/c copy"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_zh_CN.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="+"/>
<arg value="${empOrg.path}/ProductCode/com/zte/pms/emporg/resource/ssb_application_resource_zh_CN.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_zh_CN.properties"/>
</exec>
<exec executable ="cmd">
<arg line="/c copy"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_zh_CN.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="+"/>
<arg value="${menuRight.path}/ProductCode/com/zte/pms/menuright/resource/ssb_application_resource_zh_CN.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_zh_CN.properties"/>
</exec>
<exec executable ="cmd">
<arg line="/c copy"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_zh_CN.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="+"/>
<arg value="${productSys.path}/ProductCode/com/zte/pms/productsys/resource/ssb_application_resource_zh_CN.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_zh_CN.properties"/>
</exec>
<exec executable ="cmd">
<arg line="/c copy"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_zh_CN.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="+"/>
<arg value="${orgRight.path}/ProductCode/com/zte/pms/orgright/resource/ssb_application_resource_zh_CN.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_zh_CN.properties"/>
</exec>
<exec executable ="cmd">
<arg line="/c copy"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_zh_CN.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="+"/>
<arg value="${projectInfo.path}/ProductCode/com/zte/pms/projectinfo/resource/ssb_application_resource_zh_CN.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_zh_CN.properties"/>
</exec>
<exec executable ="cmd">
<arg line="/c copy"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_zh_CN.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="+"/>
<arg value="${protofManage.path}/ProductCode/com/zte/pms/portofmanage/resource/ssb_application_resource_zh_CN.properties"/>
<arg value="+"/>
<arg value="${shareLib.path}/Build/space.properties"/>
<arg value="${mainProject.path}/ProductCode/ssb_application_resource_zh_CN.properties"/>
</exec>
</target>

<target name="compile">
<copy todir="${this.out}" overwrite="true">
<fileset dir="${this.src}">
<exclude name = "**/*.java"/>
</fileset>
</copy>
</target>

<!-- 打成WAR包 -->
<target name="build.war">
<copy file = "${shareLib.path}/Build/buildversion.properties" todir = "${mainProject.webinfo}/classes" />
<jar basedir="${mainProject.path}/WebContent" destfile="${this.name}.war" manifest="${mainProject.path}/WebContent/META-INF/MANIFEST.MF" />
</target>

<!-- 版本计数器 -->
<target name = "build.counter" >
<propertyfile file = "buildversion.properties" >
<entry key = "build.version" type = "int" operation = "+" value = "1" pattern = "0000" />
</propertyfile>
<echo message = "Build counter: ${build.version}" />
</target>

<!-- 打成EAR包 -->
<target name = "build.ear" description = "Build J2EE application EAR file" >
<delete dir="${shareLib.path}/build" includes="*.ear"/>
<property name = "ear.name" value = "${this.name}-build${build.version}.ear" />
<jar destfile = "${ear.name}" >
<fileset dir = "${shareLib.path}/build" includes = "*.war" />
<fileset dir = "${apps.path}" includes = "**/*.*" />
</jar>
<copy todir = "${back.dir}">
<fileset dir = "${shareLib.path}/build" includes = "*.ear" />
</copy>
<move file="${this.name}-build${build.version}.ear" tofile="ppm.ear"/>
</target>

<target name="deployEar">
<echo>******************************</echo>
<echo> Begin deploy ear </echo>
<exec executable="wsadmin.bat">
<arg value="-connecttype"/>
<arg value="SOAP"/>
<arg value="-host"/>
<arg value="10.5.8.31"/>
<arg value="-port"/>
<arg value="8879"/>
<arg value="-username"/>
<arg value="administrator"/>
<arg value="-password"/>
<arg value="zte@123456"/>
<arg value="-f"/>
<arg value="D:/CCVIEW/PMS_SRC_COMPDEV/CPC_PMS_VOB/PMS_CJ100_ShareLib/Build/pms.py"/>
</exec>
<echo> End deploy ear </echo>
</target>

<!-- 更新CC snapshot -->
<target name="updateView" description=" Update ClearCase snapshot view" >
<echo>******************************</echo>
<echo> Begin update ClearCase snapshot view </echo>
<ccupdate viewpath="${shareLib.path}" graphical="false" overwrite="false" currenttime="true" />
<ccupdate viewpath="${appFrame.path}" graphical="false" overwrite="false" currenttime="true" />
<ccupdate viewpath="${baseUtil.path}" graphical="false" overwrite="false" currenttime="true" />
<ccupdate viewpath="${empOrg.path}" graphical="false" overwrite="false" currenttime="true" />
<ccupdate viewpath="${menuRight.path}" graphical="false" overwrite="false" currenttime="true" />
<ccupdate viewpath="${productSys.path}" graphical="false" overwrite="false" currenttime="true" />
<ccupdate viewpath="${orgRight.path}" graphical="false" overwrite="false" currenttime="true" />
<ccupdate viewpath="${projectInfo.path}" graphical="false" overwrite="false" currenttime="true" />
<ccupdate viewpath="${protofManage.path}" graphical="false" overwrite="false" currenttime="true" />
<echo> Update ClearCase snapshot view end!</echo>
<echo>******************************</echo>
</target>

<!-- deliver -->
<target name="deliver">
<echo> ******************************</echo>
<echo> Begin deliver to COMPTST </echo>
<exec executable="cmd" output="deliver.log">
<arg value="/c"/>
<arg value="deliver.bat"/>
</exec>
<echo> deliver finish </echo>
</target>
<!--<target name="all" depends="updateView, deliver, clear, copyBaseLib, build.baseUtil, build.empOrg, build.menuRight, build.productSys, build.orgRight, build.projectInfo, build.portofManage, build.appFrame, deployjsp, deploycss, deployimages, deployjs, deploySSBConfigFile,deployibatis, deployweb, unitResourceFile, compile, build.war, build.counter, build.ear"/>-->
<target name="all" depends="clear, copyBaseLib, build.baseUtil, build.empOrg, build.menuRight, build.productSys, build.orgRight, build.projectInfo, build.portofManage, build.appFrame, deployjsp, deploycss, deployimages, deployjs, deploySSBConfigFile,deployibatis, deployweb, unitResourceFile, compile, build.war, build.counter, build.ear"/>
</project>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: