Improve build and deployment
authorMathieu Baudier <mbaudier@argeo.org>
Wed, 6 Mar 2024 16:13:00 +0000 (17:13 +0100)
committerMathieu Baudier <mbaudier@argeo.org>
Wed, 6 Mar 2024 16:13:00 +0000 (17:13 +0100)
Makefile
jni/Makefile [deleted file]
jni/jni.mk [deleted file]
jni/org_argeo_api_uuid_libuuid/Makefile
org.argeo.slc.cms/src/org/argeo/slc/init/osgi/SlcInitActivator.java
sdk/argeo-build
swt/rap/org.argeo.tool.rap.cli/bnd.bnd

index 65c241c943fbf54954311d3456b10984a4a2279d..07b6e9990a58c6eecd86cd8f205d5aa2279afe42 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,15 @@
 include sdk.mk
 .PHONY: clean all osgi jni
 
-all: osgi jni
+all: osgi-all
        $(MAKE) -f Makefile-rcp.mk all
        
 install: osgi-install
 
 uninstall: osgi-uninstall
 
-jni:
-       $(MAKE) -C jni
+#jni:
+#      $(MAKE) -C jni
 
 A2_CATEGORY = org.argeo.slc
 
@@ -38,9 +38,12 @@ swt/org.argeo.cms \
 swt/rap/org.argeo.cms \
 $(A2_CATEGORY)
 
-clean:
-       rm -rf $(BUILD_BASE)
-       $(MAKE) -C jni clean
+NATIVE_PACKAGES= \
+org_argeo_api_uuid_libuuid
+
+clean: osgi-clean
+#      rm -rf $(BUILD_BASE)
+#      $(MAKE) -C jni clean
        $(MAKE) -f Makefile-rcp.mk clean
 
 native-deps-debian:
diff --git a/jni/Makefile b/jni/Makefile
deleted file mode 100644 (file)
index e0b2ed4..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-include ../sdk.mk
-
-JNIDIRS = org_argeo_api_uuid_libuuid
-
-.PHONY: clean all
-
-all: 
-       $(foreach dir, $(JNIDIRS), $(MAKE) -C $(dir) all;)
-       
-clean:
-       $(foreach dir, $(JNIDIRS), $(MAKE) -C $(dir) clean;)
-
-
-
diff --git a/jni/jni.mk b/jni/jni.mk
deleted file mode 100644 (file)
index e4d7bde..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-include  $(SDK_SRC_BASE)/sdk/argeo-build/osgi.mk
-
-A2_NATIVE_CATEGORY=$(A2_OUTPUT)/lib/linux/$(shell uname -m)/$(A2_CATEGORY)
-TARGET_EXEC := libJava_$(NATIVE_PACKAGE).so
-
-LDFLAGS = -shared -fPIC -Wl,-soname,$(TARGET_EXEC).$(MAJOR).$(MINOR) $(ADDITIONAL_LIBS)
-CFLAGS = -O3 -fPIC
-
-SRC_DIRS := . 
-
-#
-# Generic Argeo
-#
-BUILD_DIR := $(SDK_BUILD_BASE)/jni/$(NATIVE_PACKAGE)
-
-# Every folder in ./src will need to be passed to GCC so that it can find header files
-INC_DIRS := $(shell find $(SRC_DIRS) -type d) $(JAVA_HOME)/include $(JAVA_HOME)/include/linux $(ADDITIONAL_INCLUDES)
-
-
-.PHONY: clean all ide
-all: $(A2_NATIVE_CATEGORY)/$(TARGET_EXEC)
-
-clean:
-       $(RM) $(A2_NATIVE_CATEGORY)/$(TARGET_EXEC)
-
-# Find all the C and C++ files we want to compile
-# Note the single quotes around the * expressions. Make will incorrectly expand these otherwise.
-SRCS := $(shell find $(SRC_DIRS) -name '*.cpp' -or -name '*.c' -or -name '*.s')
-
-# String substitution for every C/C++ file.
-# As an example, hello.cpp turns into ./build/hello.cpp.o
-OBJS := $(SRCS:%=$(BUILD_DIR)/%.o)
-
-# String substitution (suffix version without %).
-# As an example, ./build/hello.cpp.o turns into ./build/hello.cpp.d
-DEPS := $(OBJS:.o=.d)
-
-# Add a prefix to INC_DIRS. So moduleA would become -ImoduleA. GCC understands this -I flag
-INC_FLAGS := $(addprefix -I,$(INC_DIRS))
-
-# The -MMD and -MP flags together generate Makefiles for us!
-# These files will have .d instead of .o as the output.
-CPPFLAGS := $(INC_FLAGS) -MMD -MP
-
-# The final build step.
-$(A2_NATIVE_CATEGORY)/$(TARGET_EXEC): $(OBJS)
-       mkdir -p $(A2_NATIVE_CATEGORY)
-       $(CC) $(OBJS) -o $@ $(LDFLAGS)
-
-# Build step for C source
-$(BUILD_DIR)/%.c.o: %.c
-       mkdir -p $(dir $@)
-       $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
-
-# Build step for C++ source
-$(BUILD_DIR)/%.cpp.o: %.cpp
-       mkdir -p $(dir $@)
-       $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
-
-# Include the .d makefiles. The - at the front suppresses the errors of missing
-# Makefiles. Initially, all the .d files will be missing, and we don't want those
-# errors to show up.
--include $(DEPS)
-
-# MAKEFILE_DIR := $(dir $(firstword $(MAKEFILE_LIST)))
index 2e98253b8379def75e9830575237d9de6ad55a5b..bf9a1ecdc133a02f37d290b5688ee796ae1fe07b 100644 (file)
@@ -2,9 +2,7 @@ A2_CATEGORY = org.argeo.slc
 
 NATIVE_PACKAGE := org_argeo_api_uuid_libuuid
 
-ADDITIONAL_INCLUDES = /usr/include/uuid
-ADDITIONAL_LIBS = -luuid
+DEP_NATIVE=uuid
 
 include ../../sdk.mk
-include ../jni.mk
-
+include  $(SDK_SRC_BASE)/sdk/argeo-build/jni.mk
index 553cb7ea68d50f0f8d581e8e359e5d33dbe7cbe2..7c6de1ced557318c8aec539f5565441654467e87 100644 (file)
@@ -1,6 +1,10 @@
 package org.argeo.slc.init.osgi;
 
+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;
@@ -15,7 +19,7 @@ public class SlcInitActivator implements BundleActivator {
 
        @Override
        public void start(BundleContext context) throws Exception {
-//             Path userHome = Paths.get(System.getProperty("user.home"));
+               Path userHome = Paths.get(System.getProperty("user.home"));
 //             OsgiCmsDeployment.main(new String[0]);
                runtimeManagerSt = new ServiceTracker<>(context, RuntimeManager.class, null) {
 
@@ -36,21 +40,21 @@ public class SlcInitActivator implements BundleActivator {
                                                        config.put(CmsDeployProperty.SSHD_PORT.getProperty(), "2222");
                                                        config.put(CmsDeployProperty.HTTP_PORT.getProperty(), "7070");
                                                        config.put(CmsDeployProperty.HOST.getProperty(), "host1");
-//                                                     Path instanceData = userHome
-//                                                                     .resolve("dev/git/unstable/argeo-slc/sdk/exec/cms-deployment/data");
-//                                                     config.put(OsgiBoot.PROP_OSGI_INSTANCE_AREA, instanceData.toUri().toString());
-//                                                     config.put("argeo.directory", "dc=example,dc=com.ldif");
-
 //                                                     for (String key : config.keySet()) {
 //                                                             System.out.println(key + "=" + config.get(key));
 ////                                                           log.debug(() -> key + "=" + config.get(key));
 //                                                     }
                                                });
-                                               runtimeManager.startRuntime("cms/test2", (config) -> {
+                                               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.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:///");
+//                                                     Path instanceData = userHome
+//                                                                     .resolve("dev/git/unstable/argeo-slc/sdk/exec/cms-deployment/data");
+//                                                     config.put(InitConstants.PROP_OSGI_INSTANCE_AREA, instanceData.toUri().toString());
                                                });
                                        }
                                }.start();
index 08bc9ba6656515e235eb269c31bc2b1e93748055..6f8e29e850f9fcfa5149e296e650355fab930752 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 08bc9ba6656515e235eb269c31bc2b1e93748055
+Subproject commit 6f8e29e850f9fcfa5149e296e650355fab930752
index bc893fe0bcd77bc06f463fd9abd6dc62f5780cc8..246564bb152eb9e43147c44a3289410a60fc6367 100644 (file)
@@ -2,4 +2,6 @@ Import-Package: \
 javax.websocket.server,\
 org.eclipse.jetty.util.component,\
 org.eclipse.jetty.ee8.nested,\
+org.eclipse.jetty.session,\
+org.eclipse.jetty.ee8.security,\
 *
\ No newline at end of file