项目的build.xml文件 自动从starteam获取新版本 ,自动编译打包

2024-01-15 13:32

本文主要是介绍项目的build.xml文件 自动从starteam获取新版本 ,自动编译打包,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

<?xml version="1.0" encoding="gb2312"?>
<project default="usage" basedir=".">
 <!-- =================================================================== -->
 <!-- Initialization target  
  @xing 创建
  @时间:2005-9-6
  使用方法:
  1 安装ant,设置ant_home
  2 启动Dos控制台,输入ant build  命令
  3 控制台提示 BUILD SUCCESSFUL  表示工程编译成功
 
  4自动从starteam获取最新版本,编译,打包生成hrm.war文件
 
  -->
 <target name="starteam">
  <echo message="checkout最新的版本,从starteam服务器"/>
  <!-- checkout最新的版本,从starteam服务器 -->
  <stcheckout URL="192.198.64.168:49201/资源管理项目/" username="test" password="test" rootlocalfolder="./" forced="true" rootstarteamfolder="/基本版本"/>
  <!--  删除web-info目录下的classes目录        -->
  <delete dir="hrm/WEB-INF/classes"/>
 </target>
 <!-- =================================================================== -->
 <target name="init" depends="starteam">
  <tstamp/>
  <property name="Name" value="资源项目"/>
  <property name="name" value="Manager System"/>
  <property name="version" value="0.1"/>
  <property name="year" value="2005-09-6"/>
  <echo message="----------- ${Name} ${version} [${year}] ------------"/>
  <!-- 编译变量设置 -->
  <property name="debug" value="off"/>
  <property name="optimize" value="on"/>
  <property name="deprecation" value="on"/>
  <property name="src.dir" value="./src"/>
  <property name="lib.dir" value="./lib"/>
  <property name="build.dest" value="./hrm/WEB-INF/classes"/>
  <property name="build.javadocs" value="./doc"/>
  <path id="classpath">
   <pathelement path="${jsdk_jar}"/>
   <fileset dir="${lib.dir}">
    <include name="**/*.jar"/>
   </fileset>
  </path>
  <filter token="year" value="${year}"/>
  <filter token="version" value="${version}"/>
  <filter token="date" value="${TODAY}"/>
  <filter token="log" value="true"/>
  <filter token="verbose" value="true"/>
 </target>
 <!-- =================================================================== -->
 <!-- Help on usage                                                       -->
 <!-- =================================================================== -->
 <target name="usage" depends="init">
  <echo message="${Name} Build file"/>
  <echo message="-------------------------------------------------------------"/>
  <echo message=""/>
  <echo message=" available targets are:"/>
  <echo message=""/>
  <echo message="   jar      --> generates the ${name}.jar file"/>
  <echo message="   build    --> compiles the source code"/>
  <echo message="   javadoc  --> generates the API documentation"/>
  <echo message="   clean    --> cleans up the directory"/>
  <echo message=""/>
  <echo message=" Please rename build.properties.default to build.properties"/>
  <echo message=" and edit build.properties to specify JSDK 2.3 classpath."/>
  <echo message=""/>
  <echo message=" See the comments inside the build.xml file for more details."/>
  <echo message="------------------------------请执行 ant build命令 编译工程-------------------------------"/>
  <echo message=""/>
  <echo message=""/>
 </target>
 <!-- =================================================================== -->
 <!-- Prepares the source code                                            -->
 <!-- =================================================================== -->
 <target name="prepare-src" depends="init">
  <!-- create directories -->
  <mkdir dir="${build.javadocs}"/>
  <mkdir dir="${build.dest}"/>
  <!-- copy src files -->
  <copy todir="${build.dest}">
   <fileset dir="${src.dir}" excludes="**/*.java"/>
  </copy>
 </target>
 <!-- =================================================================== -->
 <!-- 编译工程                                      -->
 <!-- =================================================================== -->
 <target name="build" depends="prepare-src">
  <javac srcdir="${src.dir}" destdir="${build.dest}" debug="${debug}" optimize="${optimize}">
   <classpath refid="classpath"/>
  </javac>
  <echo message="编译更新资源文件"/>
  <!--  编译属性文件      xing 2005-10-30  -->
  <native2ascii encoding="GBK" src="./hrm/WEB-INF/res" dest="./hrm/WEB-INF/classes" includes="res_zh.txt"/>
  <!--  更改名称      xing 2005-10-30  -->
  <move file="./hrm/WEB-INF/classes/res_zh.txt" tofile="./nhhrm/WEB-INF/classes/ApplicationResources_zh_CN.properties"/>
  <!--  打包文件      xing 2005-10-30  -->
  <echo message="打包文件"/>
  <war destfile="hrm.war" webxml="./hrm/WEB-INF/web.xml">
   <fileset dir="./hrm"/>
  </war>
 </target>
 <!-- =================================================================== -->
 <!-- Creates the class package                                           -->
 <!-- =================================================================== -->
 <target name="jar" depends="build">
  <jar jarfile="${lib.dir}/${name}.jar" basedir="${build.dest}" includes="**"/>
 </target>
 <!-- =================================================================== -->
 <!-- Creates the API documentation                                       -->
 <!-- =================================================================== -->
 <target name="javadoc" depends="build">
  <mkdir dir="${build.javadocs}"/>
  <javadoc packagenames="${packages}" sourcepath="${src.dir}" destdir="${build.javadocs}" author="true" version="true" use="true" splitindex="true" windowtitle="${Name} API" doctitle="${Name}">
   <classpath refid="classpath"/>
  </javadoc>
 </target>
 <!-- =================================================================== -->
 <!-- Clean targets                                                       -->
 <!-- =================================================================== -->
 <target name="clean" depends="init">
  <delete dir="${build.dest}/org"/>
  <delete dir="${build.dest}/com"/>
  <delete>
   <fileset dir="${build.dest}" includes="**/*.class"/>
  </delete>
 </target>
</project>
<!-- End of file -->

这篇关于项目的build.xml文件 自动从starteam获取新版本 ,自动编译打包的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/609055

相关文章

深入浅出Spring中的@Autowired自动注入的工作原理及实践应用

《深入浅出Spring中的@Autowired自动注入的工作原理及实践应用》在Spring框架的学习旅程中,@Autowired无疑是一个高频出现却又让初学者头疼的注解,它看似简单,却蕴含着Sprin... 目录深入浅出Spring中的@Autowired:自动注入的奥秘什么是依赖注入?@Autowired

Ubuntu如何升级Python版本

《Ubuntu如何升级Python版本》Ubuntu22.04Docker中,安装Python3.11后,使用update-alternatives设置为默认版本,最后用python3-V验证... 目China编程录问题描述前提环境解决方法总结问题描述Ubuntu22.04系统自带python3.10,想升级

基于Redis自动过期的流处理暂停机制

《基于Redis自动过期的流处理暂停机制》基于Redis自动过期的流处理暂停机制是一种高效、可靠且易于实现的解决方案,防止延时过大的数据影响实时处理自动恢复处理,以避免积压的数据影响实时性,下面就来详... 目录核心思路代码实现1. 初始化Redis连接和键前缀2. 接收数据时检查暂停状态3. 检测到延时过

SpringBoot通过main方法启动web项目实践

《SpringBoot通过main方法启动web项目实践》SpringBoot通过SpringApplication.run()启动Web项目,自动推断应用类型,加载初始化器与监听器,配置Spring... 目录1. 启动入口:SpringApplication.run()2. SpringApplicat

Springboot项目构建时各种依赖详细介绍与依赖关系说明详解

《Springboot项目构建时各种依赖详细介绍与依赖关系说明详解》SpringBoot通过spring-boot-dependencies统一依赖版本管理,spring-boot-starter-w... 目录一、spring-boot-dependencies1.简介2. 内容概览3.核心内容结构4.

在ASP.NET项目中如何使用C#生成二维码

《在ASP.NET项目中如何使用C#生成二维码》二维码(QRCode)已广泛应用于网址分享,支付链接等场景,本文将以ASP.NET为示例,演示如何实现输入文本/URL,生成二维码,在线显示与下载的完整... 目录创建前端页面(Index.cshtml)后端二维码生成逻辑(Index.cshtml.cs)总结

MyBatis的xml中字符串类型判空与非字符串类型判空处理方式(最新整理)

《MyBatis的xml中字符串类型判空与非字符串类型判空处理方式(最新整理)》本文给大家介绍MyBatis的xml中字符串类型判空与非字符串类型判空处理方式,本文给大家介绍的非常详细,对大家的学习或... 目录完整 Hutool 写法版本对比优化为什么status变成Long?为什么 price 没事?怎

Spring Boot项目如何使用外部application.yml配置文件启动JAR包

《SpringBoot项目如何使用外部application.yml配置文件启动JAR包》文章介绍了SpringBoot项目通过指定外部application.yml配置文件启动JAR包的方法,包括... 目录Spring Boot项目中使用外部application.yml配置文件启动JAR包一、基本原理

Springboot项目登录校验功能实现

《Springboot项目登录校验功能实现》本文介绍了Web登录校验的重要性,对比了Cookie、Session和JWT三种会话技术,分析其优缺点,并讲解了过滤器与拦截器的统一拦截方案,推荐使用JWT... 目录引言一、登录校验的基本概念二、HTTP协议的无状态性三、会话跟android踪技术1. Cook

更改linux系统的默认Python版本方式

《更改linux系统的默认Python版本方式》通过删除原Python软链接并创建指向python3.6的新链接,可切换系统默认Python版本,需注意版本冲突、环境混乱及维护问题,建议使用pyenv... 目录更改系统的默认python版本软链接软链接的特点创建软链接的命令使用场景注意事项总结更改系统的默