ant

NAnt equvalent of <propertyfile> element

What will be the NAnt equivalent of the below script? This script is in Ant. <target name="getVersion"> <propertyfile file="./version.properties"> <entry key="version" type="string" value="${buildVersion}"/> </propertyfile> </target> ...

scaladoc Ant task writing for multiple source directories?

I wish to compile scaladoc and javadoc in a project with both scala and java in it. The project has more than one source directory (each of which may have scala or javadoc). I tried: <scaladoc destdir="doc"> <classpath refid="compile.classpath"/> <src> <fileset dir="src"/> <fileset dir="tweetstream4j/src"/> ...

Ant propertyfile replacing value issue

Hello, I'm trying to change values in my application.properties file and I'm running into issues with an extra "\" character when trying to substitute url addresses. It doesn't happen when I'm replacing regular text. Here's the section of the properties file I'm attempting to modify: # Web Info web.url=http://www.testaddress.com web.u...

How to use artifact:writepom and artifact:pom?

I've been trying to use writepom using this http://maven.apache.org/ant-tasks/examples/write-pom.html as a reference and have been having problems. I'm essentially just trying to test whether it will actually work so the POM file is quite bare. See below. <project name="CreatePOMStructure" basedir="./test" xmlns:artifact="antlib:org.ap...

Creating/filtering fileset from a list in a file or from a property with ant

Hi, people! Let us suppose I have a file called "list-of-files.txt" with this content: file1.txt file2.properties file3.class I would like to use this content in a ant : <fileset filelist="list-of-files.txt" /> Is it possible? Also, if I had this list of files in a property: <property name="various.files" value="file1.txt,file2....

List directories in a folder, ignore sub directories ANT

Basically I have the following structure for a javadoc: build +---javadoc +-------Module A +-------Module B +---Index.html Module X are folders. I'm trying to list the folders there, ignoring subfolders, so I can create the main index. So far This is what I have: <target name="x"> <dirset id="dist.contents" dir="build/javadoc" ex...

Ant task to check if a database (connection) exists?

Hi, is there a possibility in ANT to check whether a database (connection) exists or not without failing the build? For example: <target name="check-database-available"> <sql classpath="${oracle.jar}" driver="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@${my.db.host}:${my.db.port}:${my.db.sid}" userid=...

Determine all of the file dependencies in a build process that uses makefiles and ant scripts

I'm trying to understand the build process of a codebase. The project uses both autoconf (configure scripts that generate makefiles) and Maven. I would like to be able identify all of the file dependencies in the project, so that for any output file that ends up being generated by a build, I can identify how it was actually produced. Ul...

How can I manipulate the parent attribute using artifact:pom?

I've been experimenting with generating pom.xml files using ant and maven-ant-tasks. So far everything has been working splendidly, but I have a problem with the parent attribute. artifact:pom doesn't support the nested "parent" element. This was my attempt at using the parent attribute: <artifact:pom id="maven-pom-test-s...

verifydesign Ant Task: How to prevent unused dependencies error?

I am using the verifydesign ant task. I am trying to declare some dependencies in advance, which don't actually exist yet. For instance: <package name="packageA" package="tom.packageA"> <depends>packageB</depends> <depends>packageC</depends> </package> <package name="packageB" package="tom.packageB"/> <package name="packageC"...

Compiling content of directories/wildcard to SWC using Flex compc ant tasks

Here is how I usually write the compile task: <compc keep-generated-actionscript="true" include-classes="Class1 Class2 com.package.Class3" output="${module.output.dir}/output.swc" fork="${flex.fork}" maxmemory="256m"> <source-path path-element="${module.basedir}/src"/> </compc> What I'm looking for is a...

Issue writing out file path properties in ant

Hi I'm having an issue with writing out a property which holds the value of a directory path into a property file. My script originally reads in this particular property, call it 'appserver.home', from a props file using the <property file="source.props"/>. I've echoed the value coming in and it reads correctly as *C\:\\somedir\\jboss_4...

eclipse: auto build after save

Hi, I have an ant script that creates runnable jar and I want it to run each time I make changes in my code and save them. I guess I need some "auto build after save" option in eclipse. Is there such a thing? Thanks, Dave ...

How to create a jaxb.index file on the fly using Ant (or Maven)

Hi, This is more of knowledge sharing rather than asking a question. Thought this little Ant snippet might be useful to someone. <target name="create-jaxb-index" depends="compile"> <!-- Create a suitable jaxb.index file on the fly to remove the need for an ObjectFactory jaxb.index is a simple list of the domain objects wit...

Validating number of failing Junits in ANT

I would like to run a JUnit regression Test Suite from within an ANT build script. The test suite has a known number of failures which we are working towards fixing. I want the build to fail if the number of failing tests increases (or changes at all if that's easier to code) - this value can be hard coded in the ANT script. I'm looking...

ANT sql task: How to run SQL and PL/SQL and notice execution failure?

Hi, to execute an .sql script file from ANT it works fine using the following task: <sql classpath="${oracle.jar}" driver="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@@@{db.hostname}:@{db.port}:@{db.sid}" userid="@{db.user}" password="@{db.password}" src="@{db.sql.script}" /> But if the .sql file not only c...

Converting Ant to Maven: problem with target attribute "depends" on Ant

I am converting ant to maven2. I meet a problem. Please help me: In build.xml, i have <target name="clean"> <delete file="${dir.dist}/${api.jarfile}" /> <delete dir="${dir.build}/**" /> /target> <target name="prepare1" depends="clean"> <mkdir dir="${dir.build}" /> <mkdir dir="${dir.generated.code.junit}/build" /> <mkdir dir="$...

wsdlc Ant task ignores constraints

Hi all, I'm attempting to create a web services project using eclipse with the Oracle Enterprise Pack. When generating the web services from a WSDL document using the wsdlc Ant task, all the restrictions/constraints in the WSDL are completely ignored. Is there a way to generate POJO's with built-in constraints such as minoccurs=1 or f...

What are the best resources to learn Ant?

I would like to learn Ant. Can anyone recommend some good learning resources about this topic? Any resource is appreciated, from online introductory tutorials to in-depth books. Thanks for your help! ...

Compiler warnings plugin: Fileset excludes

We are using Hudson as our build machine and I am trying to configure the excludes fileset for the Compilier Warnings plugin. Hudson parses the build log to determine warnings/errors and our Clover scripts output duplicates of real warnings. As documented by Hudson you can configure an ANT fileset to exclude certain warnings: Warnin...