Thanks Josh. Great to hear that SBT and Ivy largely use the same thing
there. Unfortunately Gradle uses something completely different. I've
submitted a pull request to
Gradle<https://github.com/gradle/gradle/pull/268>to allow setting an
option that would make it work the same way as Ivy and
SBT. Unfortunately they don't want to make it the default for backwards
compatibility, but at least it will be a little easier to make Gradle use
the correct layout.

-Ben


On Thu, Apr 10, 2014 at 9:06 AM, Josh Suereth <joshua.suer...@gmail.com>wrote:

> Right, Ivy has a default for local in its ivysettings, but I think
> sbt/gradle just mimic this as opposed to use the raw ivy settings (I'm not
> fully aware of why sbt doesn't use it directly, I think so users can turn
> it off using sbt-only settings)
>
>
> Here's the Ivy 1.4 config for local:
>
> <ivysettings>
>         <property name="ivy.local.default.root"
> value="${ivy.default.ivy.user.dir}/local" override="false"/>
>         <property name="ivy.local.default.ivy.pattern"
>  value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
> override="false"/>
>         <property name="ivy.local.default.artifact.pattern"
> value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
> override="false"/>
>         <resolvers>
>                 <filesystem name="local">
>                         <ivy
> pattern="${ivy.local.default.root}/${ivy.local.default.ivy.pattern}" />
>                         <artifact
> pattern="${ivy.local.default.root}/${ivy.local.default.artifact.pattern}"
> />
>                 </filesystem>
>         </resolvers>
> </ivysettings>
>
>
>
> Hope that helps answer "what default" is :)   As I said, we modify the
> artifact pattern slightly to handle sbt plugins and binary revisioning, but
> the pattern should be compatible with the above and only sbt has to care
> about sbt-plugins (theoretically).
>
>
>
>
> On Thu, Apr 10, 2014 at 11:58 AM, Ben McCann <b...@benmccann.com> wrote:
>
> > Hey Josh, thanks for the pointers.  I'm mainly curious about
> ~/.ivy2/local.
> >  I'm surprised you say you don't think there *is* a standard. Ivy must
> use
> > some pattern by default when publishing to ~/.ivy2/local, right?
>  Hopefully
> > for compatibility SBT would do the same thing as Ivy there.
> >
> > Thanks,
> > Ben
> >
> >
> > On Thu, Apr 10, 2014 at 5:48 AM, Josh Suereth <joshua.suer...@gmail.com
> > >wrote:
> >
> > > Sorry, send that a bit too early, here's the hook to local where we
> adapt
> > > the pattern for sbt plugins:
> > >
> > >
> > >
> >
> https://github.com/sbt/sbt/blob/0.13/ivy/src/main/scala/sbt/Resolver.scala#L281-L285
> > >
> > >
> > > If you're not resolving sbt plugins, that shouldn't matter.
> > >
> > >
> > > On Thu, Apr 10, 2014 at 8:47 AM, Josh Suereth <
> joshua.suer...@gmail.com
> > > >wrote:
> > >
> > > > Ben -
> > > >
> > > > Do you mean "~/.ivy2/local" or  "~/.ivy2/cache"  ?
> > > >
> > > > AFAIK the cache bit is the same in sbt as for Ivy, caveat that we try
> > to
> > > > ignore what resolver an artifact came from in the store.  However,
> > > Gradle's
> > > > cache is a completely different beast, so the I don't think the two
> are
> > > > compatible.
> > > >
> > > > Now for the local-project, we could very-well have something
> > non-standard
> > > > in there, although I don't think there *is* a standard.  Here's the
> > > > code/pattern for resolving from the local repo:
> > > >
> > > >
> > > >
> > >
> >
> https://github.com/sbt/sbt/blob/0.13/launch/src/main/scala/xsbt/boot/Update.scala#L379-L387
> > > >
> > > >
> > >
> >
> https://github.com/sbt/sbt/blob/0.13/launch/src/main/scala/xsbt/boot/BootConfiguration.scala#L30-L32
> > > >
> > > > Also, for loading sbt-plugins we add the additional "scala/sbt"
> > universe
> > > > to the pattern:
> > > >
> > > >
> > > > Someone more qualified than I in the Ivy can answer whether that's a
> > > > "default" thing.
> > > >
> > > >
> > > >
> > > >
> > > > On Thu, Apr 10, 2014 at 3:00 AM, Ben McCann <b...@benmccann.com>
> wrote:
> > > >
> > > >> Hi,
> > > >>
> > > >> I'm using SBT and Gradle as build systems. I want them to publish to
> > and
> > > >> read from ~/.ivy2 but they use and expect default layouts and so
> they
> > do
> > > >> not cooperate well each other using this directory. I'm wondering
> > which
> > > >> one
> > > >> is right and which one is wrong.
> > > >>
> > > >> Also, I downloaded the latest ivy source to check what layout it
> > uses. I
> > > >> noticed the fields IvyRepResolver.DEFAULT_IVYPATTERN and
> > > >> IvyRepResolver.DEFAULT_IVYROOT are unused. Should they be removed?
> The
> > > >> latter points to what appears to be an abandoned domain as the page
> is
> > > >> filled with adds and a link stating "Buy this domain".
> > > >>
> > > >> Thanks,
> > > >> Ben
> > > >>
> > > >> --
> > > >> about.me/benmccann
> > > >>
> > > >
> > > >
> > >
> >
> >
> >
> > --
> > about.me/benmccann
> >
>



-- 
about.me/benmccann

Reply via email to