Adapt to changes in Argeo Build and Argeo Commons
authorMathieu Baudier <mbaudier@argeo.org>
Thu, 7 Mar 2024 15:23:52 +0000 (16:23 +0100)
committerMathieu Baudier <mbaudier@argeo.org>
Thu, 7 Mar 2024 15:23:52 +0000 (16:23 +0100)
Makefile
Makefile-rcp.mk
org.argeo.slc.cms/bnd.bnd
org.argeo.slc.cms/src/org/argeo/slc/cms/deploy/osgi/OsgiCmsDeployment.java
org.argeo.slc.cms/src/org/argeo/slc/init/osgi/SlcInitActivator.java
sdk/argeo-build

index 07b6e9990a58c6eecd86cd8f205d5aa2279afe42..9d48b5e46043c3157bbac360381bdb5a3eed2bd5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -29,7 +29,7 @@ log/syslogger/org.argeo.tp \
 org.argeo.tp \
 org.argeo.tp.httpd \
 org.argeo.tp.sys \
-osgi/api/org.argeo.tp.osgi \
+osgi/equinox/org.argeo.tp.osgi \
 osgi/equinox/org.argeo.tp.eclipse \
 swt/rap/org.argeo.tp.swt \
 swt/rap/org.argeo.tp.swt.workbench \
index eb3fc7042dcd9f6f0dd6080b73fb1bd408a9a32a..43956314738d5a198234eba70e0c2bacc29aacf4 100644 (file)
@@ -12,7 +12,7 @@ swt/rcp/org.argeo.tool.desktop \
 
 DEP_CATEGORIES = \
 org.argeo.tp \
-osgi/api/org.argeo.tp.osgi \
+osgi/equinox/org.argeo.tp.osgi \
 osgi/equinox/org.argeo.tp.eclipse \
 swt/rcp/org.argeo.tp.swt \
 lib/linux/x86_64/swt/rcp/org.argeo.tp.swt \
index 1c0334fb0e121e0e8aa3f264c6a74446ecf9643b..737ccf8cd7f7b7a5ce72095d92f29d0373714bdb 100644 (file)
@@ -6,4 +6,8 @@ org.apache.commons.logging,\
 org.postgresql;version="[42,43)";resolution:=optional,\
 org.apache.commons.vfs2.*;resolution:=optional,\
 org.osgi.*;version="0.0.0",\
+javax.servlet,\
+javax.servlet.http,\
+javax.websocket,\
+javax.websocket.server,\
 *
\ No newline at end of file
index 77d72faf74d564e23106bc364b91becac1a08bec..1c472e70fd8491c5e95a2a24e79c986369843712 100644 (file)
@@ -15,7 +15,9 @@ import java.util.TreeMap;
 import org.argeo.api.a2.A2Source;
 import org.argeo.api.a2.FsA2Source;
 import org.argeo.api.init.InitConstants;
+import org.argeo.api.init.RuntimeContext;
 import org.argeo.cms.CmsDeployProperty;
+import org.argeo.init.osgi.OsgiRuntimeContext;
 import org.argeo.slc.WellKnownConstants;
 import org.argeo.slc.build.Distribution;
 import org.argeo.slc.cms.deploy.CmsDeployedSystem;
@@ -38,6 +40,8 @@ public class OsgiCmsDeployment implements Deployment {
 
        private CmsDeployedSystem deployedSystem;
 
+       private OsgiRuntimeContext runtimeContext;
+
        @Override
        public void run() {
                try {
@@ -100,8 +104,8 @@ public class OsgiCmsDeployment implements Deployment {
                        }
 
                        // FIXME use runtime manager
-//                     runtimeContext = new OsgiRuntimeContext(config);
-//                     runtimeContext.run();
+                       runtimeContext = new OsgiRuntimeContext(config);
+                       runtimeContext.run();
 
 //                     deployedSystem = new OsgiCmsDeployedSystem(runtimeContext.getFramework().getBundleContext(), distribution,
 //                                     targetData, deploymentData);
@@ -132,7 +136,20 @@ public class OsgiCmsDeployment implements Deployment {
                this.distribution = (A2Distribution) distribution;
        }
 
+       public OsgiRuntimeContext getRuntimeContext() {
+               return runtimeContext;
+       }
+
        public static void main(String[] args) {
+               RuntimeContext runtimeContext = test();
+               try {
+                       runtimeContext.waitForStop(0);
+               } catch (InterruptedException e) {
+                       e.printStackTrace();
+               }
+       }
+
+       public static RuntimeContext test() {
                try {
                        Path userHome = Paths.get(System.getProperty("user.home"));
 
@@ -187,7 +204,7 @@ public class OsgiCmsDeployment implements Deployment {
                        boolean multiple = true;
                        if (multiple) {
                                // wait a bit
-                               Thread.sleep(5000);
+//                             Thread.sleep(5000);
 
                                Path instanceData2 = userHome.resolve("dev/git/unstable/argeo-slc/sdk/exec/cms-deployment2/data");
                                Files.createDirectories(instanceData2);
@@ -200,11 +217,11 @@ public class OsgiCmsDeployment implements Deployment {
                                deployment2.run();
                        }
 
-                       // deployment.getRuntimeContext().waitForStop(0);
-
-               } catch (IOException | InterruptedException e) {
+                       return deployment.getRuntimeContext();
+               } catch (IOException e) {
                        e.printStackTrace();
                        System.exit(1);
+                       return null;
                }
        }
 
index 7c6de1ced557318c8aec539f5565441654467e87..542aac91c99867bf280f6be8c4fb2808e839d3a1 100644 (file)
@@ -4,7 +4,6 @@ import java.nio.file.Path;
 import java.nio.file.Paths;
 
 import org.argeo.api.cms.CmsLog;
-import org.argeo.api.init.InitConstants;
 import org.argeo.api.init.RuntimeManager;
 import org.argeo.cms.CmsDeployProperty;
 import org.osgi.framework.BundleActivator;
@@ -20,7 +19,22 @@ public class SlcInitActivator implements BundleActivator {
        @Override
        public void start(BundleContext context) throws Exception {
                Path userHome = Paths.get(System.getProperty("user.home"));
-//             OsgiCmsDeployment.main(new String[0]);
+
+//             {
+//                     EquinoxFactory equinoxFactory = new EquinoxFactory();
+//                     Map<String, String> config = new HashMap<>();
+//                     config.put("osgi.console", "host1:2023");
+//                     config.put("osgi.frameworkParentClassloader", "app");
+//                     config.put("osgi.parentClassLoader", "app");
+//                     RuntimeManager.loadConfig(Paths.get("/usr/local/etc/argeo/user/cms/test3"), config);
+//                     Framework framework = equinoxFactory.newFramework(config);
+//                     framework.start();
+//                     OsgiBoot osgiBoot = new OsgiBoot(framework.getBundleContext());
+//                     osgiBoot.bootstrap(config);
+//             }
+
+               // OsgiCmsDeployment.test();
+
                runtimeManagerSt = new ServiceTracker<>(context, RuntimeManager.class, null) {
 
                        @Override
@@ -35,7 +49,7 @@ public class SlcInitActivator implements BundleActivator {
 //                                                     return;
 //                                             }
 
-                                               runtimeManager.startRuntime("cms/test1", (config) -> {
+                                               runtimeManager.startRuntime("native/test1", (config) -> {
                                                        config.put("osgi.console", "host1:2023");
                                                        config.put(CmsDeployProperty.SSHD_PORT.getProperty(), "2222");
                                                        config.put(CmsDeployProperty.HTTP_PORT.getProperty(), "7070");
@@ -44,14 +58,15 @@ public class SlcInitActivator implements BundleActivator {
 //                                                             System.out.println(key + "=" + config.get(key));
 ////                                                           log.debug(() -> key + "=" + config.get(key));
 //                                                     }
+//                                                     config.put("argeo.osgi.start.6", "org.argeo.swt.minidesktop");
                                                });
                                                runtimeManager.startRuntime("native/test2", (config) -> {
                                                        config.put("osgi.console", "host2:2023");
                                                        config.put(CmsDeployProperty.SSHD_PORT.getProperty(), "2222");
                                                        // config.put(CmsDeployProperty.HTTP_PORT.getProperty(), "7070");
                                                        config.put(CmsDeployProperty.HOST.getProperty(), "host2");
-                                                       config.put("argeo.osgi.start.6", "org.argeo.swt.minidesktop");
-//                                                     config.put("argeo.directory", "ipa:///");
+//                                                     config.put("argeo.osgi.start.6", "org.argeo.swt.minidesktop");
+////                                                   config.put("argeo.directory", "ipa:///");
 //                                                     Path instanceData = userHome
 //                                                                     .resolve("dev/git/unstable/argeo-slc/sdk/exec/cms-deployment/data");
 //                                                     config.put(InitConstants.PROP_OSGI_INSTANCE_AREA, instanceData.toUri().toString());
index 6f8e29e850f9fcfa5149e296e650355fab930752..e021d17c09f8586a68177e9eb40d9caa088c37b1 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 6f8e29e850f9fcfa5149e296e650355fab930752
+Subproject commit e021d17c09f8586a68177e9eb40d9caa088c37b1