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 17:54:47 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=50610

--- Comment #14 from Jon Svede <jsvede@yahoo.com> 2011-02-07 12:54:43 EST ---
(In reply to comment #11)
> 
> Firstly, I see two packages with duplicate contents: org.excelant.* and
> org.apache.poi.ss.excelant.*. Was org.excelant.* added by mistake? 


No, it was that I had checked the code in org.excelant but then later moved
everything to the POI suggested packaging.  I didn't delete the old code until
I was sure I didn't need it.  I thought had deleted the org.excelant code but
looking in the master on github, that delete didn't make it up.  I will fix
that, the correct codeline is the org.apache.* packages.

> 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. 

Not a problem, I can refactor the existing tests.

>  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. 

I can refactor accordingly, not a problem.

> 
> 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"
>                    classpath="YOUR-PATH-TO/poi-exelant.jar"/>
> 
> 
> Where the antlib file is defined as follows:
> 
> <antlib>
> 
>   <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" />
> 
> </antlib>
> 
> 
> 3. Similar to (2), but assigning a namespace URI:
> 
>   <typedef uri="poi:org.apache.poi.ss.excelant"
>            resource="org/apache/poi/ss/excelant/antlib.xml"
>                    classpath="YOUR-PATH-TO/poi-exelant.jar"/>
> 
> 4.Using Ant's autodiscovery. Run Ant as
> 
>   ant -lib DIR_CONTAINING_EXCELANT_JAR targetName
> 
>  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. 

Yes, I had wanted to add support for #4, I wasn't aware of the methodology
you've shown in #2 and #3.

My goal was to get it all working in the github repository and once we had it
all worked out, migrate the code the POI structure and update the build file.   

I'll take a look at your patch to github repository and play around with it.

Thanks for reviewing it all providing feedback!

Sincerely,

Jon

-- 
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


Mime
View raw message