-
-
Notifications
You must be signed in to change notification settings - Fork 303
Description
I am trying to include some native libraries which are in a maven repository using:
lib/=${repo;org.weasis.thirdparty.org.opencv:libopencv_java:so:linux-x86-64;4.4.0.-dcm};lib:=true,\
lib/=${repo;org.weasis.thirdparty.org.opencv:libopencv_java:so:linux-x86;4.4.0.-dcm};lib:=true,\
lib/=${repo;org.weasis.thirdparty.org.opencv:libopencv_java:jnilib:macosx-x86-64;4.4.0.-dcm};lib:=true,\
lib/=${repo;org.weasis.thirdparty.org.opencv:opencv_java:dll:windows-x86-64;4.4.0.-dcm};lib:=true,\
lib/=${repo;org.weasis.thirdparty.org.opencv:opencv_java:dll:windows-x86;4.4.0.-dcm};lib:=true,\
First of all the 4.4.0.-dcm
format really threw me. It is bizarre having to put .
before the -
. I couldn't find the documentation for this. I did eventually find the regex in:
private static final String VERSION_STRING = "(\\d{1,10})(\\.(\\d{1,10})(\\.(\\d{1,10})(\\.([-\\w]+))?)?)?"; |
After working around that gotcha, these all work fine except for the macOS one. It will fail because a file that ends in lib
is assumed to be some kind of library:
bnd/biz.aQute.bndlib/src/aQute/bnd/build/Project.java
Lines 1475 to 1479 in d875537
if (f.getName() | |
.endsWith("lib")) | |
container = new Container(this, bsn, range, Container.TYPE.LIBRARY, f, null, attrs, db); | |
else | |
container = new Container(this, bsn, range, Container.TYPE.REPO, f, null, attrs, db); |
When then blows up because of course a dynlib is a dynamically linked library, not a text file so this doesn't work:
bnd/biz.aQute.bndlib/src/aQute/bnd/build/Container.java
Lines 244 to 261 in d875537
// Are ww a library? If no, we are the result | |
if (getType() == TYPE.LIBRARY) { | |
// We are a library, parse the file. This is | |
// basically a specification clause per line. | |
// I.e. you can do bsn; version, bsn2; version. But also | |
// spread it out over lines. | |
try (BufferedReader rd = IO.reader(getFile(), Constants.DEFAULT_CHARSET)) { | |
String line; | |
while ((line = rd.readLine()) != null) { | |
line = line.trim(); | |
if (!line.startsWith("#") && line.length() > 0) { | |
List<Container> list = project.getBundles(Strategy.HIGHEST, line, null); | |
result.addAll(list); | |
} | |
} | |
} | |
} else | |
result.add(this); |