You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Daniel M. Bikel" <db...@linc.cis.upenn.edu> on 2004/01/14 19:00:26 UTC

variable license file?

Hi.  I have a build.xml file that, among other things, builds an entire
distributable version of my software, including source code.  This includes
copying a license text file, as well as inserting the lines of that license
into an install shell script (just like the J2SDK install script, which
cat's the JDK license and asks the user if he/she agrees).

Anyway, here's my question: I want to distribute *two* versions of my
software, one version with source with one license and one version without
source code with a different license.  It's easy to build a second target
that doesn't copy the source code to a "dist" directory, but currently, I
have a property that specifies where this LICENSE text file lives in my
project hierarchy.  I have just read
	http://ant.apache.org/manual/CoreTasks/property.html
which makes it very clear that properties are *immutable*.  So, after this
(unfortunately long) preface, here's my question: how do you accomplish
what I want to do?  Do I need to use the Condition task somehow?

If I were using make, I would simply redefine my ${deploy.license} variable
that specifies the relative path of my license file before building the
distributable.  But I can't do that in Ant.

Thanks in advance!

--Dan.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: variable license file?

Posted by "Alexey N. Solofnenko" <A....@mdl.com>.
You can append strings to a file and then read it when it is needed.

- Alexey.

Daniel M. Bikel wrote:

>Sorry about this long message.  Here's the simple question: what's the
>simplest way to change the value of properties according to what target I'm
>trying to build?
>
>--Dan.
>
>On Wed, 14 Jan 2004, Daniel M. Bikel wrote:
>
>  
>
>>Hi.  I have a build.xml file that, among other things, builds an entire
>>distributable version of my software, including source code.  This includes
>>copying a license text file, as well as inserting the lines of that license
>>into an install shell script (just like the J2SDK install script, which
>>cat's the JDK license and asks the user if he/she agrees).
>>
>>Anyway, here's my question: I want to distribute *two* versions of my
>>software, one version with source with one license and one version without
>>source code with a different license.  It's easy to build a second target
>>that doesn't copy the source code to a "dist" directory, but currently, I
>>have a property that specifies where this LICENSE text file lives in my
>>project hierarchy.  I have just read
>>	http://ant.apache.org/manual/CoreTasks/property.html
>>which makes it very clear that properties are *immutable*.  So, after this
>>(unfortunately long) preface, here's my question: how do you accomplish
>>what I want to do?  Do I need to use the Condition task somehow?
>>
>>If I were using make, I would simply redefine my ${deploy.license} variable
>>that specifies the relative path of my license file before building the
>>distributable.  But I can't do that in Ant.
>>
>>Thanks in advance!
>>
>>--Dan.
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: variable license file?

Posted by Donald Strong <ds...@agentissoftware.com>.
This is another approach, if you want to build both targets at once using
the
same build target (build-dist).
Note: This builds build-dist with different values for the properties.
      You can then write one build sequence and skip some targets using
      <target unless="bin-only" ...

<target name="dist">
  <antcall target="build-dist">
     <param name="licencefile" value="licences/source-licence.txt" />
     <param name="dist.dir"    value="dist/source" />
  </antcall>
  <antcall target="build-dist">
     <param name="licencefile" value="licences/binary-licence.txt" />
     <param name="dist.dir"    value="dist/binary" />
     <param name="bin-only"    value="true" />
  </antcall>
</target>

-----Original Message-----
From: Matt Benson [mailto:gudnabrsam@yahoo.com]
Sent: Thursday, 15 January 2004 5:47 AM
To: Ant Users List
Subject: Re: variable license file?


Set the property in the target, or specify the
property at the command-line.  But that only works if
you invoke one target per Ant invocation.

-Matt

--- "Daniel M. Bikel" <db...@linc.cis.upenn.edu>
wrote:
> Sorry about this long message.  Here's the simple
> question: what's the
> simplest way to change the value of properties
> according to what target I'm
> trying to build?
>
> --Dan.
>
> On Wed, 14 Jan 2004, Daniel M. Bikel wrote:
>
> > Hi.  I have a build.xml file that, among other
> things, builds an entire
> > distributable version of my software, including
> source code.  This includes
> > copying a license text file, as well as inserting
> the lines of that license
> > into an install shell script (just like the J2SDK
> install script, which
> > cat's the JDK license and asks the user if he/she
> agrees).
> >
> > Anyway, here's my question: I want to distribute
> *two* versions of my
> > software, one version with source with one license
> and one version without
> > source code with a different license.  It's easy
> to build a second target
> > that doesn't copy the source code to a "dist"
> directory, but currently, I
> > have a property that specifies where this LICENSE
> text file lives in my
> > project hierarchy.  I have just read
> >
> http://ant.apache.org/manual/CoreTasks/property.html
> > which makes it very clear that properties are
> *immutable*.  So, after this
> > (unfortunately long) preface, here's my question:
> how do you accomplish
> > what I want to do?  Do I need to use the Condition
> task somehow?
> >
> > If I were using make, I would simply redefine my
> ${deploy.license} variable
> > that specifies the relative path of my license
> file before building the
> > distributable.  But I can't do that in Ant.
> >
> > Thanks in advance!
> >
> > --Dan.
> >
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
>


__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: variable license file?

Posted by Matt Benson <gu...@yahoo.com>.
Set the property in the target, or specify the
property at the command-line.  But that only works if
you invoke one target per Ant invocation.

-Matt

--- "Daniel M. Bikel" <db...@linc.cis.upenn.edu>
wrote:
> Sorry about this long message.  Here's the simple
> question: what's the
> simplest way to change the value of properties
> according to what target I'm
> trying to build?
> 
> --Dan.
> 
> On Wed, 14 Jan 2004, Daniel M. Bikel wrote:
> 
> > Hi.  I have a build.xml file that, among other
> things, builds an entire
> > distributable version of my software, including
> source code.  This includes
> > copying a license text file, as well as inserting
> the lines of that license
> > into an install shell script (just like the J2SDK
> install script, which
> > cat's the JDK license and asks the user if he/she
> agrees).
> >
> > Anyway, here's my question: I want to distribute
> *two* versions of my
> > software, one version with source with one license
> and one version without
> > source code with a different license.  It's easy
> to build a second target
> > that doesn't copy the source code to a "dist"
> directory, but currently, I
> > have a property that specifies where this LICENSE
> text file lives in my
> > project hierarchy.  I have just read
> > 
> http://ant.apache.org/manual/CoreTasks/property.html
> > which makes it very clear that properties are
> *immutable*.  So, after this
> > (unfortunately long) preface, here's my question:
> how do you accomplish
> > what I want to do?  Do I need to use the Condition
> task somehow?
> >
> > If I were using make, I would simply redefine my
> ${deploy.license} variable
> > that specifies the relative path of my license
> file before building the
> > distributable.  But I can't do that in Ant.
> >
> > Thanks in advance!
> >
> > --Dan.
> >
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: variable license file?

Posted by "Daniel M. Bikel" <db...@linc.cis.upenn.edu>.
Sorry about this long message.  Here's the simple question: what's the
simplest way to change the value of properties according to what target I'm
trying to build?

--Dan.

On Wed, 14 Jan 2004, Daniel M. Bikel wrote:

> Hi.  I have a build.xml file that, among other things, builds an entire
> distributable version of my software, including source code.  This includes
> copying a license text file, as well as inserting the lines of that license
> into an install shell script (just like the J2SDK install script, which
> cat's the JDK license and asks the user if he/she agrees).
>
> Anyway, here's my question: I want to distribute *two* versions of my
> software, one version with source with one license and one version without
> source code with a different license.  It's easy to build a second target
> that doesn't copy the source code to a "dist" directory, but currently, I
> have a property that specifies where this LICENSE text file lives in my
> project hierarchy.  I have just read
> 	http://ant.apache.org/manual/CoreTasks/property.html
> which makes it very clear that properties are *immutable*.  So, after this
> (unfortunately long) preface, here's my question: how do you accomplish
> what I want to do?  Do I need to use the Condition task somehow?
>
> If I were using make, I would simply redefine my ${deploy.license} variable
> that specifies the relative path of my license file before building the
> distributable.  But I can't do that in Ant.
>
> Thanks in advance!
>
> --Dan.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: variable license file?

Posted by Matt Benson <gu...@yahoo.com>.
There are ways and ways; a quick way that springs to
mind is ant-contrib's variable task <var> or something
like that...

-Matt

--- "Daniel M. Bikel" <db...@linc.cis.upenn.edu>
wrote:
> Hi.  I have a build.xml file that, among other
> things, builds an entire
> distributable version of my software, including
> source code.  This includes
> copying a license text file, as well as inserting
> the lines of that license
> into an install shell script (just like the J2SDK
> install script, which
> cat's the JDK license and asks the user if he/she
> agrees).
> 
> Anyway, here's my question: I want to distribute
> *two* versions of my
> software, one version with source with one license
> and one version without
> source code with a different license.  It's easy to
> build a second target
> that doesn't copy the source code to a "dist"
> directory, but currently, I
> have a property that specifies where this LICENSE
> text file lives in my
> project hierarchy.  I have just read
> 
> http://ant.apache.org/manual/CoreTasks/property.html
> which makes it very clear that properties are
> *immutable*.  So, after this
> (unfortunately long) preface, here's my question:
> how do you accomplish
> what I want to do?  Do I need to use the Condition
> task somehow?
> 
> If I were using make, I would simply redefine my
> ${deploy.license} variable
> that specifies the relative path of my license file
> before building the
> distributable.  But I can't do that in Ant.
> 
> Thanks in advance!
> 
> --Dan.
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org