How to call a web service from Ant script or from within Jenkins?

Option 1: “get” task Ant’s get task can be used to invoke web services, but it restricted to GET operations. Only works for very simple web services Option 2: curl Invoke the unix curl command to call the webservice (See this post for examples) <target name=”invoke-webservice”> <exec executable=”curl”> <arg line=”-d ‘param1=value1&param2=value2’ http://example.com/resource.cgi”/> </exec> </target> Note: … Read more

how to create a bundled runnable jar using Ant

Snip… I have reworked your build.xml file to properly include the libraries in the jar file and in the Manifest classpath. I’m assuming that your “apache http.jar” file is a wrapper for Apache Core, and contains several other jar files in it for the apache client, etc. build.xml <?xml version=”1.0″ encoding=”ISO-8859-1″?> <project name=”Test” basedir=”.” default=”jar”> … Read more

How to search for a string in files with Ant (make sure certain string isn’t found in source files)

You might consider using fileset selectors to do this. Selectors allow you to choose files based on content, size, editability and so on. You can combine selectors with name-based includes and excludes, or patternsets. Below is an example. The second fileset is derived from the first, with a selector that simply matches on file content. … Read more

How do I reference external jar files in a common directory (not libs) to build android project using ant?

In the sdk, there are ant files under tools/ant. In main_rules.xml, you can find the following code section: <!– Directory for the third party java libraries –> <property name=”jar.libs.dir” value=”libs” /> <property name=”jar.libs.absolute.dir” location=”${jar.libs.dir}” /> <!– create a path with all the jar files, from the main project and the libraries –> <path id=”jar.libs.ref”> <fileset … Read more