You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Ryan Fong <ry...@workday.com> on 2012/08/01 19:32:54 UTC

IvyDE 2.2.0.beta1 & Ant environment varaibles

G¹day, mates.  Our team has Ivy integrated with our Ant build files.  While
investigating Eclipse Juno w/ the IvyDE 2.2.0.beta1 plugin I discovered that
IvyDE has trouble resolving the environment variables that are dynamically
provided by Ant.  For example, ${my.build.dir} and ${ant.project.name} vary
for each of the projects we have.

Although we can provide paths to hardcoded properties files to the plugin,
it would require a customized file per project.  Additionally,
${my.build.dir} is used by a FileSystemResolver which requires an absolute
path which is different on each developer¹s system.

I¹d appreciate suggestions on how to get IvyDE working in this environment,
preferably without modifying the ivy.xml files.  Is this a limitation of the
plugin?  Thanks!

--------
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0">
    <info organisation="${ivy.organisation}" module="${ant.project.name}"/>
    
    <configurations>
        <include 
file="${my.build.dir}/common/default-ivy-configurations.xml"/>
-------

Re: IvyDE 2.2.0.beta1 & Ant environment varaibles

Posted by Eyad Ebrahim <ty...@gmail.com>.
In IvyDE you could import a property file.
So instead of wanting to use the properties of ant build.xml file, you
could create a some_property.properties:
1) ant build.xml uses <loadproperties file .... /> to include this file.
2) Use IvyDE settings section to include this same file [in the property
files section]

HOWEVER,
In case of your two properties (I will consider each one, since they are
inherently different):
1)  ant.project.name: I hard coded it, but you don't need to do that. The
approach I suggested up there would solve the problem. [of course I'm
considering it for your ivy.xml example you provided]
2) my.build.dir: I had the same thing and build.dir is a different
repository from all other repositories (but they point to the my.build.dir
as an environment variable):
   - If you don't mind setting this variable to each project, then put it
in the .properties file and use the previous approach.
   - if you want to use one variable for all projects, make sure to use
<property environment="env" /> [not properties] in the ivysettings.xml
before you could use this variable inside your ivy.xml files.

I know I'm having some stupid details, but maybe you could adapt this to
your case.

All the best,
Eyad

P.S. I had to do a special trick for Jenkins to see the my.build.dir (which
is not an environment variable)

On Wed, Aug 1, 2012 at 7:32 PM, Ryan Fong <ry...@workday.com> wrote:

> G¹day, mates.  Our team has Ivy integrated with our Ant build files.  While
> investigating Eclipse Juno w/ the IvyDE 2.2.0.beta1 plugin I discovered
> that
> IvyDE has trouble resolving the environment variables that are dynamically
> provided by Ant.  For example, ${my.build.dir} and ${ant.project.name}
> vary
> for each of the projects we have.
>
> Although we can provide paths to hardcoded properties files to the plugin,
> it would require a customized file per project.  Additionally,
> ${my.build.dir} is used by a FileSystemResolver which requires an absolute
> path which is different on each developer¹s system.
>
> I¹d appreciate suggestions on how to get IvyDE working in this environment,
> preferably without modifying the ivy.xml files.  Is this a limitation of
> the
> plugin?  Thanks!
>
> --------
> <?xml version="1.0" encoding="UTF-8"?>
> <ivy-module version="2.0">
>     <info organisation="${ivy.organisation}" module="${ant.project.name
> }"/>
>
>     <configurations>
>         <include
> file="${my.build.dir}/common/default-ivy-configurations.xml"/>
> -------
>