On Fri, 8 Feb 2013 13:58:24 -0800 (PST)
Michael Bayne <
m...@samskivert.com> wrote:
> I'm trying to depend on a sources jar (the actual library-dependencies
> needs to have the sources jar in it; it's needed for a GWT compile), but
> the two ways I can see to do it both fail:
>
> If I do:
>
> libraryDependencies += "org" % "lib" % "V" classifier "sources"
>
> then SBT looks for .ivy2/cache/org/lib/jars/lib-V-sources.jar which is not
> where Ivy keeps sources jars. Ivy keeps them in
> ivy2/cache/org/lib/srcs/lib-V.jar.
>
> If I do:
>
> libraryDependencies += "org" % "lib" % "V" withSources()
>
> then the dependency is not added to my project at all (or rather the
> non-sources dependency is added but the sources jar is not added as a
> dependency).
Classifiers, which both of the above use, are a Maven concept. If you are consuming something published with Ivy, it probably uses configurations. Depending on who published them, the sources are probably available in the "sources" configuration. You might try something like:
libraryDependencies += "org" % "lib" % "V" % "compile->sources"
This means "include the 'sources' configuration of org:lib in my 'compile' configuration." The syntax is Ivy's:
http://ant.apache.org/ivy/history/latest-milestone/ivyfile/configurations.html
> Is this too esoteric a requirement? Is there some other way to say that I
> want "show dependency-classpath" to report
> back: Attributed(/HOME/.ivy2/cache/org/lib/srcs/lib-V.jar)?
>
> I'm just trying to achieve sanity in the world of GWT apps which have
> traditionally included their source in the binary jar file which causes
> problems, not least of which is that SBT finds those sources and tries to
> compile them.
Hmm, I think this is javac pulling sources from the classpath. Perhaps I misunderstand the situation, but sbt wouldn't explicitly compile Java sources in a dependency's jar unless that jar were unpacked to a source directory.
-Mark
> --
> You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
simple-build-t...@googlegroups.com.
> To post to this group, send email to
simple-b...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/simple-build-tool?hl=en.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>