Using SBT with non-standard ivy sources classifier

67 views
Skip to first unread message

JonF

unread,
Sep 28, 2011, 7:48:06 AM9/28/11
to simple-build-tool
Our internal ivy repository contains source jar's with a .src.jar
extension instead of the conventional -sources.jar

We are using an ivysettings.xml in order to match the correct
patterns, and the .src.jar files get downloaded into the local ivy
cache correctly, but cause issues with plugins expecting the standard
format (i.e. sbtidea).

Is it possible to do the reverse of:
artifactName := { (config: String, module: ModuleID, artifact:
Artifact) =>
artifact.classifier match {
case Some("sources") => artifact.name + "-" + module.revision
+ ".srcs." + artifact.extension
case Some(classifier) => artifact.name + "-" + module.revision
+ "." + classifier + "." + artifact.extension
case None => artifact.name + "-" + module.revision + "." +
artifact.extension
}
},

or configure ivy to do the renaming somehow?

Cheers

Jon

Mark Harrah

unread,
Sep 28, 2011, 10:56:09 PM9/28/11
to simple-b...@googlegroups.com
Hi Jon,

I don't think so. What exactly is the command you are running and what does the error message look like? Are you aware of the transitiveClassifiers settings? That contains a list of the strings to retrieve classifiers for and would fix a problem on sbt's side. I don't know if sbtidea hard codes "sources" or has some other way of selecting sources once resolved.

-Mar

> Cheers
>
> Jon
>

Jon Freedman

unread,
Sep 29, 2011, 4:40:22 AM9/29/11
to simple-build-tool
There's no error unfortunately - and sbtidea does have appear to have
sources/javadoc hardcoded (not unreasonably) - see
https://github.com/mpeltonen/sbt-idea/blob/master/src/main/scala/org/sbtidea/SbtIdeaModuleMapping.scala

I'm not having an issue getting the src jar's into my ivy repository,
just wondering if there was any way I could associate our internal src/
doc classifier with the sources/javadoc convention. We can internally
fork sbtidea, but I'm trying to see if there's a solution which would
work with all plugins expecting a standard repository layout.

Mark Harrah

unread,
Sep 29, 2011, 3:35:40 PM9/29/11
to simple-b...@googlegroups.com
On Thu, 29 Sep 2011 01:40:22 -0700 (PDT)
Jon Freedman <jon_fr...@tiscali.co.uk> wrote:

> There's no error unfortunately - and sbtidea does have appear to have
> sources/javadoc hardcoded (not unreasonably) - see
> https://github.com/mpeltonen/sbt-idea/blob/master/src/main/scala/org/sbtidea/SbtIdeaModuleMapping.scala

I'd be surprised if that does anything. I don't think ScalaInstance.extraJars ever contains sources/javadocs, although it may have in 0.7 and that code wasn't removed. This is the more likely part where sources/javadocs are extracted:

https://github.com/mpeltonen/sbt-idea/blob/master/src/main/scala/org/sbtidea/SbtIdeaModuleMapping.scala#L102

> I'm not having an issue getting the src jar's into my ivy repository,
> just wondering if there was any way I could associate our internal src/
> doc classifier with the sources/javadoc convention. We can internally
> fork sbtidea, but I'm trying to see if there's a solution which would
> work with all plugins expecting a standard repository layout.

Plugins should probably make the classifiers to search for be a setting, mostly because it shouldn't be too much work and because you aren't likely to be the only one. The IDE plugin authors can correct me if I've misjudged this.

-Mark

ijuma

unread,
Sep 30, 2011, 4:17:00 AM9/30/11
to simple-b...@googlegroups.com
On Thursday, 29 September 2011 20:35:40 UTC+1, Mark Harrah wrote:

I'd be surprised if that does anything.  I don't think ScalaInstance.extraJars ever contains sources/javadocs, although it may have in 0.7 and that code wasn't removed.  This is the more likely part where sources/javadocs are extracted:

 https://github.com/mpeltonen/sbt-idea/blob/master/src/main/scala/org/sbtidea/SbtIdeaModuleMapping.scala#L102

Yes, that looks like unused code that remains from sbt-idea for SBT 0.7.x
 

Plugins should probably make the classifiers to search for be a setting, mostly because it shouldn't be too much work and because you aren't likely to be the only one.  The IDE plugin authors can correct me if I've misjudged this.

Seems sensible to me. I'd file a feature request in the sbt-idea issue tracker.

Best,
Ismael

Jon Freedman

unread,
Sep 30, 2011, 4:47:19 AM9/30/11
to simple-build-tool
> Seems sensible to me. I'd file a feature request in the sbt-idea issue
> tracker.

done: https://github.com/mpeltonen/sbt-idea/issues/97
Reply all
Reply to author
Forward
0 new messages