On 9/21/07, Maarten Coene <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> while working on IVY-601, I was wondering what the value of the
> ivy.settings.dir variable should be.
> The problem is that the value of this ivy.settings.dir variable depends on
> how the settings are loaded.
>
> For instance:
>
> Ivy ivy = new Ivy();
> ivy.configure(new File("C:/test/ivysettings.xml"));
>
> will set the value of the ivy.settings.dir to "C:/test".
> However, if you configure Ivy like this:
>
> Ivy ivy = new Ivy();
> ivy.configure(new File("C:/test/ivysettings.xml").toURL());
>
> you'll end up with an ivy.settings.dir variable with value "file:C:/test"
>
> This makes a big difference in the way you can use the
> ivy.settings.dirvariable!
> For instance, a lot of the Ivy junit tests will fail if we configure Ivy
> with the URL instead of the File.
>
> Another example, consider the following ivysettings.xml file:
>
> <ivysettings>
> <include url="${ivy.settings.dir}/ivy-shared-resolver.xml"/>
> </ivysettings>
>
> This will only work if you configure Ivy with an URL. If you configure Ivy
> with a File, it won't work anymore, unless you use the "file" attribute to
> include the other settings file, or add "file:" befoire the
> ivy.settings.dir variable.
>
>
> I think the same problem is there when you include another settings file
> (like the example above). The value of the ivy.settings.dir variable will
> be different if you include the settings file with the "url" attribute or
> with the "file" attribute.
>
> We should have a mechanism where you don't have to care about the way the
> settings file was loaded and the ivy.settings.dir should be the same in
> both situations. The question is: what value should it have?
I agree it would be nice to have a variable set with a value which doesn't
depend on the way the settings are loaded. But I don't think we should
change the ivy.settings.dir value, because it may break backward
compatibility. Adding a variable like ivy.settings.base.url set to what we
get in ivy.settings.dir when we load settings using an URL (ie the file URL
when they are loaded with a File) could be a good solution to have something
which always resolve to the same value.
WDYT?
Xavier
regards,
> Maarten
>
>
>
>
>
>
>
> ____________________________________________________________________________________
> Don't let your dream ride pass you by. Make it a reality with Yahoo!
> Autos.
> http://autos.yahoo.com/index.html
>
>
>
>
--
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://incubator.apache.org/ivy/
http://www.xoocode.org/