Re: Ant Packaging - Was: building pgsql-interfaces...

From: Christopher Cain <ccain(at)mhsoftware(dot)com>
To: pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: Ant Packaging - Was: building pgsql-interfaces...
Date: 2000-10-19 21:51:15
Message-ID: 39EF6CD3.D162B097@mhsoftware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Mark's assessment is pretty much mirrors my thinking. On several of the
projects I've installed, you simply pass the build parameters directly
to the shell file (i.e. "./build.sh jar" or "./build.sh docs"). In this
case, it would probably be something like "./build.sh jdbc2".

I, too, have only used Ant under Linux, but I was going to try a Tomcat
install (which usese Ant) on an NT machine soon anyway (just to test
compatibility, mind you ;-). I'll go ahead and do that today or tomorrow
and see if I run across any issues. I haven't seen any issues on any of
the Jakarta lists, however, so it should be fine.

At this point it sounds like there are no objections to at least
offering an Ant distro in addition to the make version (assuming
success, of course). N'est pas?

Mark Dzmura wrote:
>
> Peter Mount wrote:
>
> > On Tue, 17 Oct 2000, Christopher Cain wrote:
> >
> > > For what it's worth, I am very much in favor of migrating to Ant. Having worked
> > > with it in other packages, I have found it to be an order of magnitude better
> > > than Make for Java software. As mentioned, it is cleaner and much easier to
> > > work with than makefiles. Of course, I can say all of this because unlike like
> > > Peter, I have no idea what any of the complications are :-)
> >
> > There's three complications really.
> >
> > 1: We need to get the current version number out of the source. This is
> > used by DatabaseMetaData for some methods, and the current official way is
> > to get it out of Makefile.global. However, this is only in existence after
> > configure is run on the main source tree.
> >
> > Prior to 7.1, this was done manually, and as there was several places to
> > do it, it was easily, and regularly missed.
>
> Ant is typically invoked by a "build.sh" bash script (under Unix/Linux platforms - I
> know there is an equivalent .bat file for windoze systems, but I don't build
> in that environment.)
>
> It is a piece of cake to invoke build.sh, passing down one or more
> parameters, either on the make command line or as environment variables,
> and from inside the script to pass the parameters to Ant with "-Dproperty=value"
> phrases on the line which starts the Ant JVM. These variables are accesible
>
> So it's easy to get things like version numbers from the "make" world into Ant.
>
> > 2: The org.postgresql.Driver class is created dynamically. Partly to
> > include the version data, but also to include which implementation of
> > java.sql.Connection is needed for that particular version of the
> > driver. Ie, which one of the _three_ versions of the driver now in the
> > source - JDBC1.1, JDBC2 and JDBC2-Enterprise which match to either
> > JDK1.1.x, Java2SE and Java2EE respectively.
> >
>
> >
> > 3: Currently make utilises a test class, utils.CheckVersion which is
> > compiliable on all JDK1.1 or later VM's and checks for the existence of
> > certain classes and parameters to check what true version of the JDK is in
> > existence. Make then uses this to build the correct version of
> > org.postgresql.Driver and the rest of the driver.
> >
>
> Ant has decent conditionals which should be sufficient
>
> As a speed benchmark, Cocoon 1.8, with well over 100 Java source files,
> builds in under 30 seconds on my PII/400 notebook w/ 128MB RAM
> (and running lots of other stuff..)
>
> >
> > Now, some classes are only built for certain drivers. ie:
> >
> > For the enterprise edition there are:
> > org.postgresql.PostgresqlDataSource
> > org.postgresql.xa.*
> >
> > Unique to JDBC1 is org.postgresql.jdbc1.*
> >
> > Unique to JDBC2 is org.postgresql.jdbc2.*
> > org.postgresql.largeobject.PGBlob
> > and some array implementation stuff I'm having trouble including from the
> > supplied patches (working on that one).
> >
> > > I would like to get some feedback on the idea, however, as I really do think
> > > that Ant is a superior solution for Java projects. If there is any interest, I
> > > would certainly be willing to help Mark out in getting an Ant distro of the
> > > drivers up and running.
> >
> > Make is dire for building Java projects, which is why I'd favour ANT if it
> > can deal with the three problems above. The last thing I want to see is
> > having to have three (possibly more) sets of source code where there are
> > lots of duplication, and we would loose the integrity of the driver pretty
> > fast (most of the driver is common to all versions).
> >
>
> >
> > Also, how platform independent is ANT? I currently test the builds under
> > Linux, and the various Windows entities (if you can call them an OS).
> >
>
> Ant was built under Solaris. Runs great on Linux (We use it exclusively for
> Java - ditched make entirely for Java about 6 months ago). As for Windows,
> I can only say that the documentation talks as much about Windows as it does
> about *nix platforms, and many developers using it seem to be using Windows...
> No personal experience, though... (windows being one of the impediments to
> my complete happiness...)
>
> regards,
> mdz
>
> > > Peter Mount wrote:
> > >
> > > > I'll look into Ant, but I can see some possible problems, especially as we
> > > > have 3 versions of driver now (JDBC1.1, JDBC2 and JDBC2enterprise), and I'm
> > > > checking the JDBC2.1 specification at the moment.
> > >
> > > Mark Dzmura wrote:
> > >
> > > > (( I offer as a suggestion that Peter/et al move to using the Java Apache
> > > > project's
> > > > "Ant" package for doing Java-only builds... It is so much faster and cleaner
> > > > to build under Ant (everything is compiled under a single JVM) and
> > > > maintanence
> > > > of the build.xml file is so much cleaner than hopeless makefiles...
> > > >
> > > > If there is interest, I will take a stab at creating a build.xml for the
> > > > JDBC driver...))
> > >
> >
> > --
> > Peter T Mount peter(at)retep(dot)org(dot)uk http://www.retep.org.uk
> > PostgreSQL JDBC Driver http://www.retep.org.uk/postgres/
> > Java PDF Generator http://www.retep.org.uk/pdf/

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Peter Mount 2000-10-20 07:38:40 RE: Ant Packaging - Was: building pgsql-interfaces.. .
Previous Message Mark Dzmura 2000-10-19 18:31:15 Re: Ant Packaging - Was: building pgsql-interfaces...