ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <>
Subject Re: Ant gui tool
Date Sun, 15 Oct 2000 13:52:11 GMT
At 07:24  15/10/00 -0500, you wrote:
>Stefan Bodewig <> writes:
>> >>>>> "JC" == Jonathan Carlson <> writes:
>>  >> Yes, huge problems. We couldn't ship it with Ant and you'd violate
>>  >> the GPL if you shipped Ant with your stuff.
>>  JC> Then how can jBoss (which is GPL) use the Tomcat server which is
>>  JC> APL?
>> IANAL, but I'm afraid jBoss violates the GPL if they do.
>With all this talk about what's compatible how about this situation.  Say I
>write a tool in java, essentially a compiler, that uses some gnu libraries,
>regexp & getopt.  Then I decide that I want to write my build files with ant,
>since it's so cool.  Now I want to write a taskdef for ant that allows my
>to be used easily with ant and distribute that rule with my tool along with a
>link to ant's homepage.
>>From the sound of this discussion it seems that I cannot use GPL license for
>my tool.  I'm ok with that, but can I use the BSD or APL licenses since I've
>linked in with gnu libraries?

Nope - as the GPL will not allow distributions to contain non-GPL stuff. SO
essentially you have to make your task GPL compatable - so often the best
thing to do is release it as public domain. However if it links with the
code from the compiler then this will still break the GPL as the taskdef
would have to be GPL and thus so would ant. So the only way to really do it
is to create a seperate Main class that is the "tool" main. Then create a
task that only interacts with the Main class through reflection. ie 

Object o = Class.forName( getMainClassName() );
Method m = o.getClass().getMethod( "main", new Class() { String.class } );
m.execute( myParams );

However even this is not enough to satisfy the GPL. You have to actually
create a standard interface and document it (best way is to create a java
interface that sets all values) and place that in public domain (so that
both GPL and Ant task can use it). Then you have to allow the
implementation of the interface to be dynamically switched by a runtime
property (not a compile time property).

SO you end up with

interface MyInterface { ... } //under public domain
class Main implements MyInterface { ... } //under GPL 
class MyTask { ... } //under a license compatable with APL

Ugly yes but it is the price for your "freedom" with GPL.

But if the only reason you are GPLing the code is so you can use the
libraries then it may be advantegous to switch to less confining products.
There is a few regexp libraries at apache that are good and there is a
gnuopt like package in avalon project (at but
much much easier to use ;). However if you are using GPL because you are a
warrior in fight against oppression then you have to do the above ;)



| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |

View raw message