]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc.factory/src/org/argeo/slc/factory/A2Factory.java
Introduce systemd support
[gpl/argeo-slc.git] / org.argeo.slc.factory / src / org / argeo / slc / factory / A2Factory.java
index b0bfefac632fc6fe0efea9c04c89908b3635797d..1174b8e8c6a074a4996bd42ee63814438ed901d9 100644 (file)
@@ -333,6 +333,10 @@ public class A2Factory {
                                                continue entries;
                                        else if (entry.getName().equals("META-INF/LICENSE-notice.md"))
                                                continue entries;
+                                       else if (entry.getName().equals("META-INF/DEPENDENCIES"))
+                                               continue entries;
+                                       if (entry.getName().startsWith(".cache/")) // Apache SSHD
+                                               continue entries;
                                        Path target = targetBundleDir.resolve(entry.getName());
                                        Files.createDirectories(target.getParent());
                                        if (!Files.exists(target)) {
@@ -648,7 +652,8 @@ public class A2Factory {
                                }
                        });
 
-                       DirectoryStream<Path> dirs = Files.newDirectoryStream(targetCategoryBase, (p) -> Files.isDirectory(p));
+                       DirectoryStream<Path> dirs = Files.newDirectoryStream(targetCategoryBase,
+                                       (p) -> Files.isDirectory(p) && p.getFileName().toString().indexOf('.') >= 0);
                        for (Path dir : dirs) {
                                createJar(dir);
                        }
@@ -785,7 +790,7 @@ public class A2Factory {
                                if (entry.getName().startsWith("META-INF/versions/")) // skip multi-version
                                        continue entries;
                                // skip file system providers as they cause issues with native image
-                               if (entry.getName().startsWith("META-INF/services/java.nio.file.spi.FileSystemProvider")) 
+                               if (entry.getName().startsWith("META-INF/services/java.nio.file.spi.FileSystemProvider"))
                                        continue entries;
                                if (entry.getName().startsWith("OSGI-OPT/src/")) // skip embedded sources
                                        continue entries;
@@ -801,7 +806,7 @@ public class A2Factory {
 //                                     String arch = segments[segments.length - 1];
 //                                     String os = segments[segments.length - 2];
                                        boolean copyDll = false;
-                                       Path targetDll = categoryDir.resolve(target.getFileName());
+                                       Path targetDll = categoryDir.resolve(targetBundleDir.relativize(target));
                                        if (nameVersion.getName().equals("com.sun.jna")) {
                                                if (arch.equals("x86_64"))
                                                        arch = "x86-64";
@@ -810,10 +815,12 @@ public class A2Factory {
                                                if (target.getParent().getFileName().toString().equals(os + "-" + arch)) {
                                                        copyDll = true;
                                                }
+                                               targetDll = categoryDir.resolve(target.getFileName());
                                        } else {
                                                copyDll = true;
                                        }
                                        if (copyDll) {
+                                               Files.createDirectories(targetDll.getParent());
                                                if (Files.exists(targetDll))
                                                        Files.delete(targetDll);
                                                Files.copy(target, targetDll);
@@ -1014,12 +1021,12 @@ public class A2Factory {
                A2Factory factory = new A2Factory(factoryBase, descriptorsBase, true);
 
 //             factory.processSingleM2ArtifactDistributionUnit(descriptorsBase.resolve("org.argeo.tp.apache").resolve("org.apache.xml.resolver.bnd"));
-//             factory.processM2BasedDistributionUnit(descriptorsBase.resolve("org.argeo.tp.apache/apache-sshd"));
+               factory.processM2BasedDistributionUnit(descriptorsBase.resolve("org.argeo.tp.apache/apache-sshd"));
 //             factory.processM2BasedDistributionUnit(descriptorsBase.resolve("org.argeo.tp.jetty/jetty"));
 //             factory.processCategory(descriptorsBase.resolve("org.argeo.tp.osgi"));
 //             factory.processCategory(descriptorsBase.resolve("org.argeo.tp.eclipse.rcp"));
 //             factory.processCategory(descriptorsBase.resolve("org.argeo.tp"));
-               factory.processCategory(descriptorsBase.resolve("org.argeo.tp.apache"));
+//             factory.processCategory(descriptorsBase.resolve("org.argeo.tp.apache"));
 //             factory.processCategory(descriptorsBase.resolve("org.argeo.tp.sdk"));
 //             factory.processCategory(descriptorsBase.resolve("org.argeo.tp.formats"));
 //             factory.processCategory(descriptorsBase.resolve("org.argeo.tp.gis"));
@@ -1031,8 +1038,7 @@ public class A2Factory {
                // Eclipse
                factory.processCategory(Paths.get("osgi/api/org.argeo.tp.osgi"));
                factory.processEclipseArchive(Paths.get("osgi/equinox/org.argeo.tp.osgi", "eclipse-equinox"));
-
-               factory.processEclipseArchive(Paths.get("org.argeo.tp.eclipse", "eclipse-equinox"));
+               factory.processEclipseArchive(Paths.get("osgi/equinox/org.argeo.tp.eclipse", "eclipse-equinox"));
 
                factory.processEclipseArchive(Paths.get("swt/rap/org.argeo.tp.swt", "eclipse-rap"));
                factory.processEclipseArchive(Paths.get("swt/rap/org.argeo.tp.swt.workbench", "eclipse-rap"));
@@ -1045,8 +1051,6 @@ public class A2Factory {
                factory.processEclipseArchive(Paths.get("lib/macosx/x86_64/swt/rcp/org.argeo.tp.swt", "eclipse-rcp"));
 
                factory.processEclipseArchive(Paths.get("swt/rcp/org.argeo.tp.swt", "eclipse-nebula"));
-               // factory.processEclipseArchive(Paths.get("swt/rcp/org.argeo.tp.swt",
-               // "eclipse-equinox"));
                factory.processEclipseArchive(Paths.get("swt/rcp/org.argeo.tp.swt.workbench", "eclipse-rcp"));
                factory.processCategory(Paths.get("swt/rcp/org.argeo.tp.swt.workbench"));