use of aQute.bnd.osgi.Builder in project bnd by bndtools.
the class ResourcesTest method testIncludeResourceDoNotCopyPath.
public static void testIncludeResourceDoNotCopyPath() throws Exception {
Builder b = new Builder();
// Use Properties file otherwise -donotcopy is not picked up
Properties p = new Properties();
p.put("-donotcopy", ".*/more/.*");
p.put("Include-Resource", "TargetFolder=testresources/ws/p2/Resources");
p.put("-resourceonly", "true");
p.put("-upto", "3.0");
b.setProperties(p);
Jar jar = b.build();
Resource r = jar.getResource("TargetFolder/resource3.txt");
assertNotNull(r);
r = jar.getResource("TargetFolder/resource4.txt");
assertNotNull(r);
r = jar.getResource("TargetFolder/more/resource6.txt");
assertNotNull(r);
r = jar.getResource("TargetFolder/more/resource7.txt");
assertNotNull(r);
r = jar.getResource("TargetFolder/stuff/resource9.res");
assertNotNull(r);
r = jar.getResource("TargetFolder/text.txt");
assertNotNull(r);
}
use of aQute.bnd.osgi.Builder in project bnd by bndtools.
the class ResourcesTest method testIncludeResourceDirectivesDefault.
public static void testIncludeResourceDirectivesDefault() throws Exception {
Builder b = new Builder();
b.setProperty("Include-Resource", "TargetFolder=testresources/ws/p2/Resources");
b.setProperty("-resourceonly", "true");
Jar jar = b.build();
Resource r = jar.getResource("TargetFolder/resource3.txt");
assertNotNull(r);
r = jar.getResource("TargetFolder/resource4.txt");
assertNotNull(r);
r = jar.getResource("TargetFolder/more/resource6.txt");
assertNotNull(r);
r = jar.getResource("TargetFolder/more/resource7.txt");
assertNotNull(r);
r = jar.getResource("TargetFolder/stuff/resource9.res");
assertNotNull(r);
r = jar.getResource("TargetFolder/text.txt");
assertNotNull(r);
}
use of aQute.bnd.osgi.Builder in project bnd by bndtools.
the class ResourcesTest method testIncludeResourceDoNotCopy.
public static void testIncludeResourceDoNotCopy() throws Exception {
Builder b = new Builder();
// Use Properties file otherwise -donotcopy is not picked up
Properties p = new Properties();
p.put("-donotcopy", "CVS|.svn|stuff");
p.put("Include-Resource", "TargetFolder=testresources/ws/p2/Resources");
p.put("-resourceonly", "true");
b.setProperties(p);
Jar jar = b.build();
Resource r = jar.getResource("TargetFolder/resource3.txt");
assertNotNull(r);
r = jar.getResource("TargetFolder/resource4.txt");
assertNotNull(r);
r = jar.getResource("TargetFolder/more/resource6.txt");
assertNotNull(r);
r = jar.getResource("TargetFolder/more/resource7.txt");
assertNotNull(r);
r = jar.getResource("TargetFolder/stuff/resource9.res");
assertNull(r);
r = jar.getResource("TargetFolder/text.txt");
assertNotNull(r);
}
use of aQute.bnd.osgi.Builder in project bnd by bndtools.
the class ResourcesTest method testCommand.
/**
* Command facility in Include-Resource
*/
public void testCommand() throws Exception {
if (!onWindows()) {
Builder b = new Builder();
b.setProperty("Include-Resource", "xkeystore; requires='testresources/keystore';cmd='echo ${@requires}', ");
b.setProperty("-resourceonly", "true");
Jar jar = b.build();
assertTrue(b.check());
Resource r = jar.getResource("xkeystore");
assertNotNull(r);
String s = IO.collect(r.openInputStream());
assertEquals("testresources/keystore\n", s);
}
}
use of aQute.bnd.osgi.Builder in project bnd by bndtools.
the class ResourcesTest method testIncludeResourceDirectivesFilterRecursive.
public static void testIncludeResourceDirectivesFilterRecursive() throws Exception {
Builder b = new Builder();
b.setProperty("Include-Resource", "TargetFolder=testresources/ws/p2/Resources;filter:=re*.txt");
b.setProperty("-resourceonly", "true");
Jar jar = b.build();
Resource r = jar.getResource("TargetFolder/resource3.txt");
assertNotNull(r);
r = jar.getResource("TargetFolder/resource4.txt");
assertNotNull(r);
r = jar.getResource("TargetFolder/more/resource6.txt");
assertNotNull(r);
r = jar.getResource("TargetFolder/more/resource7.txt");
assertNotNull(r);
r = jar.getResource("TargetFolder/text.txt");
assertNull(r);
}
Aggregations