Gradle: Properly build classpath from OSGI dependency's MANIFEST.MF -


my gradle project ("osgiapp") has dependency on osgi project ("osgidep"), has following manifest.mf entries:

manifest-version: 1.0 export-package: test.lib,test.osgidep bundle-classpath: lib/lib.jar,. bundle-name: osgidep bundle-version: 1.0 bundle-symbolicname: osgidep 

two packages exported here:

  • test.lib package provided lib/lib.jar included in osgidep.jar
  • test.osgidep package provided osgidep.jar itself

now, build.gradle looks this:

apply plugin: 'java' apply plugin: 'osgi'  repositories {     flatdir {          dirs "../osgidep"     } }  dependencies {     compile ":osgidep:" } 

and when i'm trying build code uses both exported packages:

package test.osgi;  import test.lib.lib; import test.osgidep.osgidep;  public class test {     lib lib = new lib();     osgidep dep = new osgidep(); } 

i compilation error saying test.lib package not exist.

how can tell gradle generate proper classpath based on dependency's manifest.mf entries?

your problem of types need compile osgiapp "hidden" in bundle-classpath of osgidep. javac knows nothing bundle-classpath. need extract lib.jar somewhere can add compile dependencies osgiapp. embedded jars lib.jar problematic if need use bundle compile dependency.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -