X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=src%2Forg%2Fargeo%2Fbuild%2FRepackage.java;h=b0e667716d91fb42e4ea3ad22105b92cbc757fc9;hb=59c4f98460a3a199ce2c0340a43f0b517edaacfc;hp=35413fe336df06dee5008f9fba2b827eba98e8a0;hpb=3714839e09d67535491b15ef560b2cb3fdf482db;p=cc0%2Fargeo-build.git diff --git a/src/org/argeo/build/Repackage.java b/src/org/argeo/build/Repackage.java index 35413fe..b0e6677 100644 --- a/src/org/argeo/build/Repackage.java +++ b/src/org/argeo/build/Repackage.java @@ -82,6 +82,7 @@ public class Repackage { private Path originBase; private Path a2Base; + private Path a2SrcBase; private Path a2LibBase; private Path descriptorsBase; @@ -102,6 +103,7 @@ public class Repackage { 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)) @@ -1008,12 +1010,19 @@ public class Repackage { 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];