Ant 1.8.0 low performance - performance

New Ant 1.8.0 (release Feb 1) introduces some cool features, so I tried my build/deployment scripts with new Ant.
I was surprised that execution time becomes in 10-30 times slower for some targets! Below simple example with Exec task, although I got performance problems with other task types too.
<target name="create_backup_impl" if="db.make_backup" >
<echo message="Backup is starting.." />
<exec executable="${db.dump_executable}"
output="${db.backup_file}"
failonerror="true">
<arg value="-h${db.host}" />
<arg value="-u${db.userid}" />
<arg value="-p${db.password}" />
<arg value="${db.backup_options}" />
<arg value="${db.name}" />
</exec>
<echo message="Backup completed!" />
</target>
It is a target for backuping database (backup size ~100 Mb). Ant 1.7.1 works about 30 s, Ant 1.8.0 - 15 min. I tried several times, effect is stable. Processor loading is very low for Ant 1.8, and near 50% for old one. Looks like problem with priority of process or slow IO operations. Any ideas?

I'm seeing similar performance degradation when using
<apply executable="...">
...
</apply>
Looks like this performance degradation was caused by a 9 year old bug fix in ANT 1.8.0 found here: https://issues.apache.org/bugzilla/show_bug.cgi?id=5003 (See comment #29).
Performance slightly improves in ANT 1.8.1 but is still worse than ANT 1.7.1: https://issues.apache.org/bugzilla/show_bug.cgi?id=48734 (See comment #2).

I would suggest filing a bug report directly with Ant team. Their response time is usually very good.
http://ant.apache.org/bugs.html

Related

How to install updates on Progress-4GL programs

Good afternoon,
In my company, we are regularly doing updates on customers' systems, all Progress-4GL technology. Currently we are doing all this manually, and I'd like to automate this.
The following actions are needed:
Take a dump (*.df) of the current database
Upload modifications to the database (*.df files)
compile *.w and *.p files.
Is there a tool that does all that (together with zipping/unzipping *.w, *.p and *.i files), or do I need to create such a tool myself?
In the latter case, what are the commandline commands for the mentioned actions:
Take a dump (*.df) of the current database
Upload modifications to the database (*.df files)
compile *.w and *.p files.
If you're familiar with ANT, the take a look at the PCT plugin for ANT:
https://github.com/Riverside-Software/pct
This makes is easy to create a delta.df file between the "new" full DF and the current database, e.g.:
<PCTDumpIncremental destFile="temp/delta.df" dlcHome="${dlc}"
debugLevel="2" activeIndexes="0" removeEmptyDFFile="true" msgBufferSize="${Mm}" >
<SourceDB dbname="temp/ref-SmartDB" singleUser="true" />
<TargetDB dbname="${smartdb}" dbDir="${smartdbdir}" singleUser="${smartdbsingleuser}"/>
</PCTDumpIncremental>
and then load the delta.df into the current application DB:
<PCTLoadSchema srcFile="temp/delta.df" dlcHome="${dlc}" onlineChanges="true" callbackClass="rssw.pct.AbstractLoadCallback" msgBufferSize="${Mm}" commitWhenErrors="false">
<DBConnectionSet refid="smartdbset" />
</PCTLoadSchema>
and then compile the application:
<PCTCompile destDir="${installroot}" graphicalMode="true" dlcHome="${dlc}"
md5="true" minSize="false" cpinternal="${cpinternal}" cpColl="${cpcoll}" cpstream="${cpstream}"
compileUnderscore="true" inputchars="32000" baseDir="${installroot}"
token="4000" progPerc="10" assemblies="${assemblies}">
<fileset dir="${installroot}" casesensitive="false">
<include name="Ccs/**/*.cls"/>
<include name="Consultingwerk/**/*.cls"/>
<include name="Consultingwerk/**/*.p"/>
<include name="Consultingwerk/**/*.w"/>
<include name="Setup/**/*.p"/>
<include name="src/**/*.p"/>
</fileset>
<propath>
<pathelement path="${installroot}/." />
<pathelement path="${installroot}/src" />
<pathelement path="${installroot}/Consultingwerk/Studio/ProdictDumpHack/src" />
<pathelement path="${dlc}/gui/netlib/OpenEdge.Net.pl" />
</propath>
<DBConnectionSet refid="smartdbset" />
</PCTCompile>
ANT and PCT are included in OpenEdge from 11.7 on. Since you're on 11.6, you'll have to bring your own ANT and PCT.

can't install ipa to iOS8 with command line

For some reason I cannot install the IPA file on to the iOS8 device using Ant.
I've read countless posts on StackOverflow and searched the world wide web with no luck. Any help appreciated.
I'm on Windows 7 and using Ant to run the command line codes.
Ant Script below:
<macrodef name="install-ios">
<attribute name="ipa"/>
<sequential>
<exec executable="${sdk.home}/bin/adt${bin.bat_ext}" failonerror="true">
<arg value="-installApp"/>
<arg value="-platform"/>
<arg value="ios"/>
<arg value="-package"/>
<arg value="#{ipa}"/>
</exec>
</sequential>
</macrodef>
When I run the script I get an error on the Output:
"exec return 13"
I've tried looking it up, but cannot find anything.

PHP Mess Detector integration with Teamcity

I have Teamcity 7.0.3 installed with different projects. I want to use PHP Mess Detector. I want to have limited set of rules from PHP Mess Detector. And different set of rules for every project. So my questions are
1: How can I modify default rules of PHP Mess Detector?
2: How can I have different set of rules defined against each project in Teamcity?
My current build file content is :
<?xml version="1.0" encoding="UTF-8"?>
<project name="bnnpoa" default="analyse" basedir=".">
<property name="project-name" value="${ant.project.name}" />
<property name="work-dir" value="%system.teamcity.build.workingDir%" />
<property name="folder-to-check" value="${work-dir}\sites" />
<target name="analyse">
<exec executable="C:\php\PEAR\scripts\phpmd.bat">
<arg value="${folder-to-check}"/>
<arg value="html"/>
<arg value="C:\php\PEAR\resources\rulesets\naming.xml,C:\php\PEAR\resources\rulesets\codesize.xml,C:\php\PEAR\resources\rulesets\controversial.xml"/>
<arg value=">"/>
<arg value="${project-name}_analysis.htm"/>
</exec>
</target>
</project>
Add a build step and use same code for every project.
To define your own rules you can modify XML files or copy them , modify rules as per needs, place files in same path and other option is to create new XML and import required rules from files.

Running Ruby tests (Rspec and Cucumber) through Ant

I'm currently looking at TeamCity and how to get our Ruby tests running. I can run the tests just fine when using the Command line or Rake builders. The question I'm trying to solve right now is two fold:
In one of my previous jobs, we also relied on TeamCity to run our .NET tests. We used Nant for this and we had means of tracking the amount of queries that were ran during tests as well as the average execution time for these queries.
I'm trying to do the same right now with my Ruby project. So the first logical step I want to tackle is, How do I run for example RSpec or Cucumber tests using Ant?
I tried looking at Ant itself and grasp it a little bit, but all the examples I find are for jRuby, which we don't use. We rely on RVM and a normal Ruby installation.
The second part of the question is, How can I track the amount of queries ran and their execution time? I'm guessing there is probably a gem for it or some sort of global variable to track. Would love to output this information back to TeamCity somehow.
EDIT
Ok, so I managed to get things running with Ant for my TeamCity server.
This is the XML i'm using atm:
<?xml version="1.0"?>
<project name="rubycas" default="init">
<description>
This buildfile is used to build the RubyCAS project under TeamCity and run the required tasks to validated
whether the project is stable and fully functional.
</description>
<property name="test_type" value="cucumber" />
<target name="init">
<echo message="##teamcity[testStarted name='Rubycas']" />
<condition property="cucumberBool">
<equals arg1="${test_type}" arg2="cucumber" />
</condition>
<condition property="rspecBool">
<equals arg1="${test_type}" arg2="rspec" />
</condition>
</target>
<target name="rspec" if="rspecBool" depends="init">
<exec executable="rspec" outputproperty="result">
<arg value="--require teamcity/spec/runner/formatter/teamcity/formatter" /> <arg value="--format Spec::Runner::Formatter::TeamcityFormatter" />
</exec>
<echo message="${result}" />
</target>
<target name="cucumber" if="cucumberBool" depends="init">
<exec executable="cucumber" outputproperty="result">
<arg value="--format junit" />
<arg value="--out results" />
<arg value="features" />
</exec>
<echo message="${result}" />
</target>
</project>
Problem now is, I cannot get the output from RSpec into TeamCity to recognize the tests.
You can use ant's exec task to run arbitrary system calls, which in your case might be rspec:
https://ant.apache.org/manual/Tasks/exec.html
Something along the lines of
<target name="rspec">
<exec executable="rake">
<arg value="spec"/>
</exec>
</target>
I don't know if your tracking stuff will work with this though, because it's really executing the commands outside of ant.

WSDL2Java in Ant

What is the exact way of generating a Java code using WSDL in a ant build file? There were so many ways given, but most of them are not reorganized by Ant.
There is Axis Ant Task for this. There is also CXF way of doing things. I would use Apache CXF, like this:
<target name="cxfWSDLToJava">
<java classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="true">
<arg value="-client"/>
<arg value="-d"/>
<arg value="src"/>
<arg value="MyWSDL.wsdl"/>
<classpath>
<path refid="cxf.classpath"/>
</classpath>
</java>
</target>

Resources