private Path originBase;
private Path a2Base;
+ private Path a2SrcBase;
private Path a2LibBase;
private Path descriptorsBase;
this.originBase = Paths.get(System.getProperty("user.home"), ".cache", "argeo/build/origin");
// TODO define and use a build base
this.a2Base = a2Base;
+ this.a2SrcBase = a2Base.getParent().resolve(a2Base.getFileName() + ".src");
this.a2LibBase = a2Base.resolve("lib");
this.descriptorsBase = descriptorsBase;
if (!Files.exists(this.descriptorsBase))
deleteDirectory(bundleDir);
if (sourceBundles) {
- Path sourceDir = bundleDir.getParent().resolve(bundleDir.toString() + ".src");
+ Path bundleCategoryDir = bundleDir.getParent();
+ Path sourceDir = bundleCategoryDir.resolve(bundleDir.toString() + ".src");
if (!Files.exists(sourceDir)) {
logger.log(WARNING, sourceDir + " does not exist, skipping...");
return jarPath;
+
}
- Path srcJarP = sourceDir.getParent().resolve(sourceDir.getFileName() + ".jar");
+
+ Path relPath = a2Base.relativize(bundleCategoryDir);
+ Path srcCategoryDir = a2SrcBase.resolve(relPath);
+ Path srcJarP = srcCategoryDir.resolve(sourceDir.getFileName() + ".jar");
+ Files.createDirectories(srcJarP.getParent());
+
String bundleSymbolicName = manifest.getMainAttributes().getValue("Bundle-SymbolicName").toString();
// in case there are additional directives
bundleSymbolicName = bundleSymbolicName.split(";")[0];