poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 50610] Add ant tasks for running POI against a workbook
Date Mon, 07 Feb 2011 13:05:51 GMT

--- Comment #11 from Yegor Kozlov <yegor@dinom.ru> 2011-02-07 08:05:46 EST ---
I checked out the latest sources from https://github.com/jsvede/excelant/. 

Firstly, I see two packages with duplicate contents: org.excelant.* and
org.apache.poi.ss.excelant.*. Was org.excelant.* added by mistake? 

Secondly, I tweaked build.xml and added a target to run junit tests. See the
attached diff. This configuration requires junit-4.7.jar in the lib directory.

The tests need to be converted to junit 3.8 because that's what POI uses
(changing junit versions is probably something we'd decide to do project wide).
This means no annotations. Sorry. 

 The test classes should be renamed to follow POI conventions: All tests should
start with Test* and extend TestCase. Also, POI expects tests to be silent (not
write to std-out or any log) when successful. 

Thirdly, Ant provides several ways of registering custom tasks and itt would be
good if ExcelAnt supports all of them:

 (1) explicit definition of taskdefs in build.xml (supported)

 (2) reference to a configuration file bundled in the jar

  <typedef resource="org/apache/poi/ss/excelant/antlib.xml"

Where the antlib file is defined as follows:


  <taskdef name="excelant" classname="org.excelant.ExcelAntTask" />
  <taskdef name="test" classname="org.excelant.ExcelAntTest" />
  <taskdef name="setDouble" classname="org.excelant.ExcelAntSetDoubleCell" />
  <taskdef name="evaluate" classname="org.excelant.ExcelAntEvaluateCell" />


3. Similar to (2), but assigning a namespace URI:

  <typedef uri="poi:org.apache.poi.ss.excelant"

4.Using Ant's autodiscovery. Run Ant as


 or copy the excelant jar into ANT_HOME/lib - and then in your build file,
simply declare the namespace on the project tag:

                <project xmlns:poi="antlib:org.apache.poi.ss.excelant">

 And all tasks of this library will automatically be available in the poi
namespace without any typedef.

I added support for (2)-(3), see my patch. (4) needs to be tested. 


Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org

View raw message