[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Ant can't find checkstyle



On 26 August 2010 20:47, Torsten Werner <twerner@debian.org> wrote:
> Hi Dmitrijs,
>
> On Thu, Aug 26, 2010 at 1:22 PM, Dmitrijs Ledkovs
> <dmitrij.ledkov@ubuntu.com> wrote:
>> The upstream build.xml can't find checkstyle.jar and tries to copy
>> convenience jar from the source tree into /usr/share/ant/lib/
>>
>> How do I tell ant to use checkstyle from /usr/share/java/ ?
>
> you should be more verbose. Try to explain your problem to your
> grandma. :) It is really hard to guess what you have tried to do.
>
> Cheers,
> Torsten
>

Ok let's take it from the beginning.

I'm part of pkg-crosswire packaging group, which packages sword (C++)
library + frontends that use that. In addition to that "Crosswire"
upstream have a java port of sword - called jsword with an awesome
frontend bibledesktop that is developed together. Since there is a
tight connection / itteraction with upstream we have had multiple
requests to package jsword & bibledesktop for debian.

The packaging at the first glance is the typical "java packaging
nightmare", but I don't think it is *that* bad in this case. Since
ustream is willing to cooperate.

Now to library & app itself.

"Source" tarballs are, well useless, so I've started with svn checkout.

svn co https://www.crosswire.org/svn/jsword/trunk jsword

In there, there are a few dirs / each treated as separate components.

I'm primarly interested in building/packaging jsword & bibledesktop
right now. According to documentation, I'll need to build:
bibledesktop, jsword, common, common-swing, jsword-support.

The "embedded" external jars are conveniently organised in the
jsword-support folder.

Each of those dirs have ant "build.xml" files & "pom.xml" as well.

Upstream targets 1.4.2 java with continued testing that it works with
java 1.5 as well and uses Eclipse for development, althought the ant
build files look like they are hand-written (there are also some
commits that apperantly "mavenise" the ant build.xmls not sure what
that means)

As part of their development they have a special jsword-web/build.xml
which build the whole stack, javadoc, and binary/source tarballs for
nightly publishing/QA testing. So I have tried to build that.

$ cd jsword-web
$ ant

Expecting for everything to work.(100's of MB later and JDK installed)
i got to this point:

checkstyle:
     [echo] CheckStyle may fail if checkstyle-all-5.0.jar is not visible to Ant.
     [echo] To make it visible you need to do one of two things depending
     [echo] on whether you are running ant in Eclipse or not.
     [echo] In Eclipse, add checkstyle-all-5.0.jar to Preferences ->
Ant -> Runtime -> Global Entries
     [echo] Otherwise, run the checkstyle.antlibs task to copy jars to
ANT_HOME/lib
    [mkdir] Created dir:
/home/tdlk/src/jsword/jsword-1.6/jsword-web/target/webapp/checkstyle
     [copy] Copying 1 file to
/home/tdlk/src/jsword/jsword-1.6/jsword-web/target/webapp/checkstyle

BUILD FAILED
/home/tdlk/src/jsword/jsword-1.6/jsword-web/build.xml:89: The
following error occurred while executing this line:
/home/tdlk/src/jsword/jsword-1.6/jsword-support/tools/checkstyle/build.xml:25:
Problem: failed to create task or type checkstyle
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.


Total time: 53 seconds

I think I have now solved this partially with:

$ ant -lib /usr/share/java/checkstyle.jar

That goes on further, but ultimately fails. I'm suspecting either
because it's "debian-style-spliced-in-half-ish" checkstyle, or because
upstream is using 0.5.0 or all of the above =))) I see bugs about
updating checkstyle to latest upstream (which has a chain of
dependencies....) so I just use the convenience jar from the svn
checkout.

$ ant -lib ../jsword-support/tools/checkstyle/checkstyle-5.0/checkstyle-all-5.0.jar

This seems to succeed building most of the jsword components and fails
building the jsword web-app.

(BTW awesome debconf10 talks: Nightmare & Javahelper - kind of
convinced me that there are tools available now to package jsword
stuff using dh7-ish)

(also it's very annoying that their build.xml keeps on deleting build
objects, resulting in subsequent runs of ant in almost complete
rebuilds)

(and my grandma is already fast asleep now)

So at this point I'm realising that jsword-web/build.xml is very
"upstream" specific and is more QA-tool (ant whole-world) with a few
unnecessary dependencies on checkstyle, findbug and etc.

So I'm gonna try to purge all "external" jar from the source tree and
try to build just jsword core library and bibledesktop app. And then
finally I'm gonna start trying to debanise those. Is this generally
the "right" approach?

One thing upstream did tell me "we will change anything in
build.xml/pom.xml etc. to get a Debian package" (well the original
statement was to get Ubuntu package, but I choose to run $ sed
s/Ubuntu/Debian/ on all emails from upstreams)

ps. Anyone willing to checkout jsword and poke it a little bit for the
most obvious "embedded" dependencies which are not in Debian (known to
be impossible to package)?

PSS. Tada:
$ ant -lib ../jsword-support/tools/checkstyle/checkstyle-5.0/checkstyle-all-5.0.jar
-lib /usr/share/java/jdepend.jar
BUILD SUCCESSFUL
Total time: 4 minutes 33 seconds


Reply to: