2

I am using sbt-osgi to repackage some library dependencies into OSGi packages, and that works well, until I started using scalajs as well. The library dependencies are defined as normal projects something like this:

lazy val bonecp = OsgiProject("com.jolbox.bonecp", buddyPolicy = Some("global")) settings 
    (libraryDependencies += "com.jolbox" % "bonecp" % "0.8.0-rc1")

The OsgiProject function has default OSGi settings plus some implicits for determining what path the project has. When the bundle task is run on these projects, a new jar with OSGi stuff is created based on the OSGiProject settings. This project just rebundles the bonecp library as an OSGi jar and has no sources. The problem here is that since there's no source, theres no files in target/scala-2.11. This causes sbt-osgi to spit out a ton of ignorable errors, but scalajs is not as forgiving and refuses to do anything with these projects. Is there any good way to unpack the downloaded libraryDependency jars into target/scala-<scalaVersion>?

MarkHammons
  • 123
  • 1
  • 5
  • There's a way to do it, but am not sure how good it'd be. You can also execute a task after another with `triggeredBy`, but I think it'd hide the real issue. What do you mean by *The library dependencies are defined as normal projects*? What's *because theres nothing in target/scala-2.11, but they're ignorable*? – Jacek Laskowski Aug 04 '14 at 14:49
  • I added a little more stuff to clarify. – MarkHammons Aug 04 '14 at 16:02
  • Basically, since my entire project is OSGi modules, then I convert dependencies that aren't OSGi into OSGi in my sbt build. Then, projects that have dependencies such as bonecp depend on the bonecp project in my build, instead of the bonecp on mvnrepository. – MarkHammons Aug 04 '14 at 17:09

0 Answers0