脚本自动化 ant
用ant,shell下也可以用make。
1,ant 是一个自动化编译工具,安装使用。
2,编写build.xml,核心,写明进行哪些操作,删,建,编译,javac,java等,从例子可以看出每个操作都有固定格式,各种语言都有自己的包,下载安装,即可调用对应的api(按格式添加对应参数,执行即可)。各个函数具体内容需要查询使用。
举例如下:
<project name="BE" default="jar" basedir=".">
<property file="build.properties" />#参数文件
<!-- Global properties for this build -->
<property name="jar.name" value="BE" />
<property name="version" value="SNAPSHOT" />
<property name="package.name" value="${jar.name}-${version}" />
<property name="java.debug" value="true" />
<!-- Directories -->
< ="build.dir" location="build" />
<property name="build.cache.dir" location="${build.dir}/cache" />
<property name="javadoc.dir" location="javadoc" />
<property name="classes.dir" location="${build.dir}/classes" />
<property name="dist.dir" location="dist" />
<property name="dist.java.dir" location="${dist.jar}/java" />
<property name="jar.file" location="${build.dir}/${jar.name}.jar" />
<property name="lib.dir" location="${basedir}/lib" />
<property name="genjar.file" location="${build.dir}/${genjar.name}.jar" />
<property name="src.dir" location="src" />
<property name="src.java.dir" location="${src.dir}/java" />
<target name="init">#建
<tstamp />
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build.dir}" />
<mkdir dir="${classes.dir}" />
</target>
<macrodef name="compile-source">#javac
<sequential>
<!-- Compile the java code from ${src.java} into ${build} -->
<javac srcdir="${src.dir}" destdir="${classes.dir}" debug="${java.debug}" debuglevel="lines,vars,source">
<classpath>
<fileset dir="./lib">
<include name="**/*.jar" />
</fileset>
</classpath>
</javac>
</sequential>
</macrodef>
<target name="jar" depends="compile">#jar命令
<delete file="${jar.file}" />
<jar jarfile="${jar.file}">
<fileset dir="${classes.dir}" />
<fileset dir=".">
<include name="lib/*.jar" />
</fileset>
</jar>
</target>
<target name="jar-all" depends="jar">
</target>
<target name="compile" depends="init" description="compile the source">
<compile-source />
</target>
<target name="clean" description="clean up">
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build.dir}" />
<delete dir="${classes.dir}" />
<delete dir="${dist.dir}" />
</target>
</project>
property 指定变量,如路径名,可以直接使用
target 就一个具体的操作,具有独立性,可以依赖另一个depends。具体命令的格式基本一致,主要是参数需要查询后指定。
整体上构成一个project。
运行命令:ant ,后面指定参数如 ant clean ,指定执行target clean 。没有会执行开头default指定的 target:jar。
运行后,ant自动寻找当前目录的build.xml文件。根据其内容,执行相关操作,删除,编译,执行,产生目录,生成文件,完成部署
脚本自动化 ant的更多相关文章
- fdisk分区硬盘并shell脚本自动化
最近工作需要用到对硬盘进行shell脚本自动化分区和mount的操作,google了一些资料,下面做个总结. 如果硬盘没有进行分区(逻辑分区或者扩展分区,关于两者概念,自行google),我们将无法将 ...
- 性能测试培训:批量执行Jmeter脚本之ant调用
性能测试培训:批量执行Jmeter脚本之ant调用 poptest是国内唯一一家培养测试开发工程师的培训机构,以学员能胜任自动化测试,性能测试,测试工具开发等工作为目标.在poptest的load ...
- Modelsim调用用do脚本自动化仿真
前言 EDA发展的趋势是自动化,使用脚本自动化仿真可以减少不必要的时间浪费. 流程 在windows下新建批处理脚本bat文件(linux下可用shell脚本或者其他,注意给脚本运行权限即可:chmo ...
- shell脚本自动化部署服务
shell脚本自动化部署 !/bin/bash #export PATH=$PATH:/export/maven/bin run_flag_dir="/data0/shell/deploy_ ...
- MySQL数据库主从切换脚本自动化
MySQL数据库主从切换脚本自动化 本文转载自:https://blog.csdn.net/weixin_36135773/article/details/79514507 在一些实际环境中,如何实现 ...
- shell脚本自动化部署
由于公司技术部团队较小,没有专门的运维团队,所以运维工作技术部承包了. 一.纯人工部署是这样的: 1. 本地打包:一般 maven clean package 2. 借助xftp上传到服务器对应目录 ...
- Oracle 12c 静默安装(脚本自动化)
oracle 12C 自动化静默安装脚本 项目地址: github: https://github.com/spdir/oracle-single-install 下载安装脚本 wget https: ...
- Jmeter 批量执行脚本之-----------Ant
一.环境介绍&准备: 1)jmeter3.2版本,需配备jdk1.8(或其他jmeter版本): 2)ant下载,并配置环境变量: a.下载地址:http://ant.apache.org/b ...
- Jenkins 对项目持续集成的配置之二 API接口自动化 Ant+Jmeter
先介绍一下Ant+Jmeter 略 我的另一篇文章有讲在linux上部署ant + jmeter以满足CI持续化集成 https://www.cnblogs.com/qianjinyan/p/9067 ...
随机推荐
- Pycharm中进行Python远程开发
http://blog.csdn.net/pipisorry/article/details/52269952 PyCharm提供两种远程调试(Remote Debugging)的方式: 配置远 ...
- 假设一个大小为100亿个数据的数组,该数组是从小到大排好序的,现在该数组分成若干段,每个段的数据长度小于20「也就是说:题目并没有说每段数据的size 相同,只是说每个段的 size < 20 而已」
假设一个大小为100亿个数据的数组,该数组是从小到大排好序的,现在该数组分成若干段,每个段的数据长度小于20「也就是说:题目并没有说每段数据的size 相同,只是说每个段的 size < 20 ...
- Struts 1 之配置文件
web.xml中配置Struts的入口Servlet--ActionServlet,ActionServlet不负责任何的业务处理,它只是查找Action名单,找到path属性与URL属性一致的Act ...
- Android View框架总结(四)View布局流程之Measure
View树的measure流程 View的measures时序图 View布局流程之measure measure过程 View的measure过程 ViewGroup的measure过程 Frame ...
- lager_transform未定义错误
lager_transform未定义错误rebar编译时报错:D:\server\six>d:/tools/rebar/rebar.cmd compile==> mysql (compil ...
- 【JavaEE WEB 开发】Tomcat 详解 Servlet 入门
转载请注明出处 : http://blog.csdn.net/shulianghan/article/details/47146817 一. Tomcat 下载安装配置 1. Tomcat 下载 T ...
- spring源码系列(一)sring源码编译 spring源码下载 spring源码阅读
想对spring框架进行深入的学习一下,看看源代码,提升和沉淀下自己,工欲善其事必先利其器,还是先搭建环境吧. 环境搭建 sping源码之前是svn管理,现在已经迁移到了github中了,新版本基于g ...
- J2EE Exception:WELD-001408 Unsatisfied dependencies for type [SelectModelFactory] with qualifiers [@
Issue: When you inject some resources using @Inject, you may encounter following exception after app ...
- Dubbo粗浅记录
这篇博客只是我自己的学习记录,对各位高手怕是没有什么太大的帮助,望高手不吝赐教. 项目的截图如下: 我们使用的主要就是红框里面的. 这里我主要分析两个xml /DubboTest/src/main/r ...
- ffplay播放器移植VC的工程:ffplay for MFC
本文介绍一个自己做的FFPLAY移植到VC下的开源工程:ffplayfor MFC.本工程将ffmpeg项目中的ffplay播放器(ffplay.c)移植到了VC的环境下.并且使用MFC做了一套简单的 ...