ant

Why do we need Maven or Ant, if we already have Eclipse?

柔情痞子 提交于 2019-12-18 09:54:53
问题 I think this question is an extension of Compare to the IDE for Java,do we still need Ant? There are answers for the question above, but I wish to know a concrete example of using Maven or Ant over just Eclipse. When I develop in Eclipse, Eclipse does everything for me and I just need to click the run button. And also, Eclipse can let you export your code to a runnable jar or even .exe for windows. So I really don't know why I need Maven or Ant. And also if I do need, which one should I

Using apache ant commands to store value to excel cell

 ̄綄美尐妖づ 提交于 2019-12-18 09:48:02
问题 I was curious if it was possible to store values into excel spreadsheet cells? And if so, how would one go about completing this? I also have multiple values that I would like to store into the same excel sheet but in different cells (like A2 or B1). For example, say that I have a value that I want to stick into cell A1, right now, I can actually using this command: <echo append="true" file="file.xls" message="1" /> This will store "1" in cell A1 and if I ran the same command again, it would

Retrieve value from text file and replace a string constant in another file with that value using ant script

倾然丶 夕夏残阳落幕 提交于 2019-12-18 09:41:28
问题 I have a file called versionInfo.txt. This file among other things has the following text: "Implementation-Version: 7.5.0.1". I need to retrieve the version value and copy this version value to a Java file. The Java file will have the following variable: version = "@version-info@"; I need to replace this @version-info@ with the value I retrieved from the first file. I need to do plug in this code in an existing build.xml file written using ant script. 回答1: Create a properties file like this

Loading JSCH Library from local lib directory in ant build.xml

为君一笑 提交于 2019-12-18 09:38:23
问题 I can do SCP task while i add jsch-0.1.44.jar to ant/lib directory.But i want to load from the local lib dir and add it to classpath.Could you please help 回答1: The built-in tasks have limited options for customizing the classpath. 1) Place your custom jars in the ${user.home}/.ant/lib directory /home/mark/.ant └── lib ├── ivy.jar └── jsch.jar This is where I install jars that are my personal extensions to the standard ANT distro 2) Supply the location of the jar directory on the commandline

generating code coverage report for android test project

匆匆过客 提交于 2019-12-18 09:06:57
问题 i am trying to get a coverage report for my android junit test project and following this guide to do so android update test-project -m <path to app project> -p <path to test project> worked fine. it generated a build.xml and updated project.properties, local.properties and proguard.cfg. but when I change directory to test project directory and enter command ant coverage it gives me this error. BUILD FAILED Target "coverage" does not exist in the project "My Project Test". Total time: 0

Ivy makepom marks all dependencies as optional despite mapping

安稳与你 提交于 2019-12-18 09:06:14
问题 Given: <dependency org="foo" name="bar" /> and no configurations, following ant snippet: <echo>${ivy.configuration}</echo> <ivy:makepom ivyfile="${build.dir}/ivy.xml" pomfile="${build.dir}/${ivy.module}.pom"> <mapping conf="default" scope="compile" /> </ivy:makepom> Produces pom with with optional dependency on foo.bar and prints "default". If I change mapping to conf="*" then it works but it is obviously suboptimal . Is it possible to map unspecified default configuration or do I need to set

How do I run JUnit tests during my Ant build script while omitting test classes from my resulting jar?

萝らか妹 提交于 2019-12-18 08:53:15
问题 I'm using the Hello World with Ant tutorial from the Ant manual to learn about Ant. The last part of the tutorial involves adding JUnit tests to the project. I've got everything working as described in the tutorial and am now going on to make some minor changes. One of the changes I would like to make is to run the tests during a typical build but not have the *Test.class files end up in the final .jar file for the application. This is because the eventual project I will be working on will be

How do I run JUnit tests during my Ant build script while omitting test classes from my resulting jar?

巧了我就是萌 提交于 2019-12-18 08:51:41
问题 I'm using the Hello World with Ant tutorial from the Ant manual to learn about Ant. The last part of the tutorial involves adding JUnit tests to the project. I've got everything working as described in the tutorial and am now going on to make some minor changes. One of the changes I would like to make is to run the tests during a typical build but not have the *Test.class files end up in the final .jar file for the application. This is because the eventual project I will be working on will be

Ant exec - cannot run program 'start' CreateProcess error=2

邮差的信 提交于 2019-12-18 07:45:49
问题 I can't run the windows 'start' using ant exec. Ant version 1.7.1. Here is sample build.xml to recreate the problem <project name="test" basedir="." default="test-target"> <target name="test-target"> <exec executable="start"> <arg line="cmd /c notepad" /> </exec> </target> </project> getting the following error when I execute this build file: Execute failed: java.io.IOException: Cannot run program "start": Cre ateProcess error=2, The system cannot find the file specified My env is Windows XP,

How to conditionally set arg value of exec task?

淺唱寂寞╮ 提交于 2019-12-18 07:45:17
问题 I've got an ant build script which I should modify. Specifically I should make a subversion checkout conditional: currently only the trunk gets checked out, the new version should checkout a given branch if needed. <target name="do-svn-checkout" depends="init" <property name="branch" value=""/> <exec executable="svn"> <arg value="checkout"/> <arg value="-r"/> <arg value="HEAD"/> <arg value="http://t01/java/trunk"/> <arg value="zzz"/> <arg value="--password"/> <arg value="xxx"/> <arg value="-