Ant cpptask with ivy

rajeshkumar created the topic: ant cpptask with ivy
Questions:
A company I am working for, has some c binaries build with ant using cpptask. They use ivy to retrieve shared c libraries every time we start a build which wastes a significant amount of time comparing the revisions and downloading, when then only need to be download if the header files have changed. I have added a target which sets a var, which causes the build to skip over the ivy steps but I’d like a better solution. I see that cpptask creates a file history.xml and only rebuilds to binary if any of the sources have change. I’d like to know if there is way to independently test if the binary needs to build, and it does, I’d like it fire off the ivy targets. I’d also like for a variable to be set if the binary was rebuilt so that I can conditionally start an rpm generation task

Answer:







Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

How to put new line in apache ant message

rajeshkumar created the topic: How to put new line in apache ant message
How to put new line in Apache Ant echo task and mail task:

Answer:
line.separator is Java System Properties which can be used for this purpose.
Found the solution (tried with Ant 1.7.0):

1. You might wrap the message-texts within the XML file.
2. If you put ${line.separator} in front of the line every space before that line separator will be trimmed away.

Example Program:









Note:
If new properties get added (it happens), expect them to appear under the “ant.” and “org.apache.tools.ant” prefixes, unless the developers have a very good reason to use another prefix. Accordingly, please avoid using properties that begin with these prefixes. This protects you from future Ant releases breaking your build file.
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Ant+Unable to create directory as a file already

rajeshkumar created the topic: Ant+Unable to create directory as a file already
Hi,

I have one file called djir.ear and I am trying to create a folder with the same name “jir.ear” same location using ant script.
but i get error message saying that
Unable to create directory as a file alr
eady exists with that name

Can you suggest me any solution for this? as i build is failing and mkdir do not support failonerror propertry 🙁
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

The type doesn’t support the nested “resources”

scmuser created the topic: The type doesn’t support the nested “resources”
Hi,
I getting below error when i execute following command

Error: The type doesn’t support the nested “resources” element.





any help???

Tagged :

Ant Scripting Issue

ant-qa created the topic: Ant Scripting Issue
1) I have many ant build files ( .xml files / test scripts) in folder : bin/execute

2) I have another testsuit.xml file (ant build file) that works as a test suit. All the test cases in folder : bin/execute are executed in the order they appear in testsuit.xml

3) I want to write code maybe another ant test (.xml file) to make sure that all the test cases are added (executed) in the test suit.

4) Test cases in the testsuit.xml can be identified by :

Any thoughts will be extremely appreciated

Thanks

Tagged :

Condition with Task in Ant

scmuser created the topic: Condition with Task in Ant
Hi,

How can i use conditions in Ant Task execution?

Any idea?

tpatil replied the topic: Re: Condition with Task in Ant
[i]













[/i]

rajeshkumar replied the topic: Re: Condition with Task in Ant
Hi,

I guess questions was based on applying condition for Aant TASK instead of Ant Target. Following ways i mean using you can set the conditional properties value but set condition with TASK.

There is one external lib ant-contrib which can be used to put conditional Task such you can find more details in links below…..
ant-contrib.sourceforge.net/tasks/tasks/if.html
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Replace xml values using ant

tpatil created the topic: Replace xml values using ant
I want to replace xml values using ant. Any idea?

e.g
org.hibernate.dialect.Oracle10gDialect

I want to replace the value of hibernate.dialect property using ant.

rajeshkumar replied the topic: Re: Replace xml values using ant
You can opt for any one of these based on senario…

1. if you can your Value as holding place such as… @org.hibernate.dialect.Oracle10gDialect@

Then u can use Filterset task in Ant…for more info…

ant.apache.org/manual/Types/filterset.html

2. If you have same requirement as you mentioned abobe… then probably you can try ReplaceRegExp ant task.

ant.apache.org/manual/Tasks/replaceregexp.html

Please let me know if this solve your problem. 🙂
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

SQL files execute : Incorrect syntax near ‘go’.

saiki created the topic: SQL files execute : Incorrect syntax near ‘go’.
Getting below issue when trying to run the ant script.

I am trying to run few sql files from the folder through ant script in which I configured the “jtds-1.2.5.jar”.
Unable to run the GO statment in the sql file. But able to execute same file it through sql studio with out any error.

************************************************** **


************************************************** **
ERROR:
************************************************** **
java.sql.SQLException: Incorrect syntax near ‘go’.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnos tic(SQLDiagnostic.java:368)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(Td sCore.java:2820)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCor e.java:2258)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(T dsCore.java:632)
at net.sourceforge.jtds.jdbc.JtdsStatement.processRes ults(JtdsStatement.java:584)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL (JtdsStatement.java:546)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeImp l(JtdsStatement.java:723)
at net.sourceforge.jtds.jdbc.JtdsStatement.execute(Jt dsStatement.java:1160)
at org.apache.tools.ant.taskdefs.SQLExec.execSQL(SQLE xec.java:775)
at org.apache.tools.ant.taskdefs.SQLExec.runStatement s(SQLExec.java:751)
at org.apache.tools.ant.taskdefs.SQLExec$Transaction. runTransaction(SQLExec.java:1055)
at org.apache.tools.ant.taskdefs.SQLExec$Transaction. access$000(SQLExec.java:985)
at org.apache.tools.ant.taskdefs.SQLExec.execute(SQLE xec.java:653)

rajeshkumar replied the topic: Re: SQL files execute : Incorrect syntax near ‘go’.
ave you tried executing sql statement on command line. may be sql studio has some setting which is helping to get it execute but not the ant script.

please refer these url as well…
forums.oracle.com/forums/thread.jspa?threadID=1323298
stackoverflow.com/questions/6614544/how-…on-using-jdbc-driver
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

saiki replied the topic: Re: SQL files execute : Incorrect syntax near ‘go’.
I Have set delimetr to GO in ant script

Then it worked

Tagged :

Compile sql file for syntax for error

saiki created the topic: Compile sql file for syntax for error
Hi,

How to Compile sql file for syntax error using ANT script.

Is there any possibility to compile through batch file.

I have 100 of sql file i dont want to create db and know the error in file.

Like java i want to compile it

rajeshkumar replied the topic: Re: Compile sql file for syntax for error
One way – exec method where you can mysqld and do whatever you want.
ant.apache.org/manual/Tasks/exec.html

Another way
www.roseindia.net/tutorials/ant/AntScriptCreateMysqlTable.shtml

Please try any of these and let me if you have any issues in script.
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

saiki replied the topic: Re: Compile sql file for syntax for error
Currently we are creating database through ant script only from CI. We do this build for every 8hrs.

Problem is b4 running the build we are deleting the existing database and then creating the new DB with same name. If there are any syntax error in the sql file the build fails and then it takes some time to fix it.

Idea is to compile sql (Check for syntax error) file for every 3hrs rather than executing and creating new DB and data ?

Tagged :