ant

How can I extract .class files from .jar files?

人盡茶涼 提交于 2019-12-10 13:53:52
问题 A quick question: I like the look of this bit of Ant: <fileset dir="${lib}"> <patternset refid="myPattern" /> </fileset> So I could use this e.g. to copy a few .jar files from ${lib} that match myPattern. What if what I really want is to look into each .jar in ${lib} and select only .class files that match myPattern? 回答1: The unjar task does pretty much what you want here out of the box. Use a fileset to specify the jar files you want to extract from, and a patternset to specify which files

Jenkins+Ant+Jmeter接口自动化集成测试实例

寵の児 提交于 2019-12-10 13:42:17
一、Jenkins安装配置 1、安装配置JDK1.6+环境变量; 2、下载jenkins.war,放入C:\jenkins目录下,目录位置随意; Jenkins启动方法: cmd进入Jenkins目录下,执行java -jar jenkins.war 浏览器输入:localhost:8080可以访问Jenkins表示配置成功; 二、Ant安装配置 1、下载apache-ant-1.9.6;放入E盘,如E:\apache-ant-1.9.6,目录位置随意 2、配置环境变量: ANT_HOME E:\apache-ant-1.9.6 path E:\apache-ant-1.9.6 classpath E:\apache-ant-1.9.6 3、验证Ant配置是否成功; cmd下输入Ant提示如下表示配置成功: Buildfile: build.xml does not exist! Build failed 三、配置xml文件 1、Jmeter目录位置:D:\tools\apache-jmeter-2.11,在jmeter中建立demo文件夹,demo中创建build.xml文件,需要配置Jmeter目录、生成报告的路径,报告的格式和脚本目录,内容如下: <?xml version="1.0" encoding="UTF8"?> <project name="ant-jmeter

How to configure lazy or incremental build in general with Ant?

天大地大妈咪最大 提交于 2019-12-10 13:35:05
问题 Java compiler provides incremental build, so javac ant task as well. But most other processes don't. Considering build processes, they transform some set of files (source) into another set of files (target). I can distinct two cases here: Transformator cannot take a subset of source files, only the whole set. Here we can only make lazy build - if no files from source was modified - we skip processing. Transformator can take a subset of sources files and produce a partial result - incremental

How can I remove/filter/ignore some package from Emma (code coverage)

我们两清 提交于 2019-12-10 13:23:00
问题 I`m trying to remove some package from my report and having trouble. Could some one give me some help? I'm using EMMA in my ant process. <!-- Generate the emma report both in xml and html --> <emma> <report sourcepath="${build.report.src}" metrics="class:${coverage.classes.min},method:${coverage.methods.min}"> <fileset dir="${build.report.junit.data.dir}"> <include name="*.emma"/> </fileset> <html outfile="${build.report.reports}/emma/raw.html" depth="method"/> <xml outfile="${build.report

Unconditionally execute a task in ant?

末鹿安然 提交于 2019-12-10 13:16:33
问题 I'm trying to define a task that emits (using echo) a message when a target completes execution, regardless of whether that target was successful or not. Specifically, the target executes a task to run some unit tests, and I want to emit a message indicating where the results are available: <target name="mytarget"> <testng outputDir="${results}" ...> ... </testng> <echo>Tests complete. Results available in ${results}</echo> </target> Unfortunately, if the tests fail, the task fails and

Java, Spring, Hibernate cannot find org.springframework.orm.hibernate3.LocalSessionFactoryBean

守給你的承諾、 提交于 2019-12-10 12:57:00
问题 I am trying to make spring+hibernate+ant project And at the moment I get this error: HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Servlet.init() for servlet spring threw exception org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) org

Replace property in a xml file using ANT

人走茶凉 提交于 2019-12-10 12:56:59
问题 I'm trying to replace a version number in a build.xml file using an ANT script. I've tried various approaches, searched and re-searched StackOverflow for answers but could not get the exact query. so here is my xml file: <?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.0"?> <project name="feature" default="main" basedir="."> <target name="init"> <property name="Version" value="1.0.0.20120327"/> </target> <target name="main" depends="init"> <description>Main target</description> <

Build Android Library Project With Ant

岁酱吖の 提交于 2019-12-10 12:49:22
问题 I am having trouble building my Android library project with ant. When I try to run ant release , it says Target "release" does not exist in the project "MyProject" . I then assumed that perhaps libraries do not get build with release/debug, so I started using ant compile , which seems to work. I then zip the folder manually using java's zip utility and rename it to .apk. I am guessing this is the wrong way to do this. Can anyone show me how to build an Android library project using ant? 回答1:

Ant Successful even when Ant Task fails

可紊 提交于 2019-12-10 12:37:50
问题 There must be a simple setting I am missing so forgive me, but I've noticed on two occasions that my bad ant tasks do not cause the build to fail. For example: Ant copy when source file does not exist ... BUILD SUCCESSFUL Ant unzip, when task reports "can't write file" or similar message ... BUILD SUCCESSFUL Ant exec error, invalid syntax ... BUILD SUCCESSFUL How do I guarantee all ant task errors will result in a build failure? 回答1: <EXEC> tasks do no fail by default. You need to enable this

com.android.dx.util.DexException: Multiple dex files define

半城伤御伤魂 提交于 2019-12-10 12:34:42
问题 I use ant release and got this error: [dx] UNEXPECTED TOP-LEVEL EXCEPTION: [dx] com.android.dx.util.DexException: Multiple dex files define Lcom/android/vending/billing/IMarketBillingService; [dx] at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:580) [dx] at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:538) [dx] at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:519) [dx] at com.android.dx.merge.DexMerger.mergeDexBuffers(DexMerger.java:168) [dx]