From 6a66d43d76bea7d48bd951fc71ac1a7ee66fff2b Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Wed, 6 Mar 2024 17:13:00 +0100 Subject: [PATCH] Improve build and deployment --- Makefile | 15 +++-- jni/Makefile | 14 ---- jni/jni.mk | 65 ------------------- jni/org_argeo_api_uuid_libuuid/Makefile | 6 +- .../argeo/slc/init/osgi/SlcInitActivator.java | 20 +++--- sdk/argeo-build | 2 +- swt/rap/org.argeo.tool.rap.cli/bnd.bnd | 2 + 7 files changed, 26 insertions(+), 98 deletions(-) delete mode 100644 jni/Makefile delete mode 100644 jni/jni.mk diff --git a/Makefile b/Makefile index 65c241c94..07b6e9990 100644 --- 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 index e0b2ed4bb..000000000 --- a/jni/Makefile +++ /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 index e4d7bdec9..000000000 --- a/jni/jni.mk +++ /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))) diff --git a/jni/org_argeo_api_uuid_libuuid/Makefile b/jni/org_argeo_api_uuid_libuuid/Makefile index 2e98253b8..bf9a1ecdc 100644 --- a/jni/org_argeo_api_uuid_libuuid/Makefile +++ b/jni/org_argeo_api_uuid_libuuid/Makefile @@ -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 diff --git a/org.argeo.slc.cms/src/org/argeo/slc/init/osgi/SlcInitActivator.java b/org.argeo.slc.cms/src/org/argeo/slc/init/osgi/SlcInitActivator.java index 553cb7ea6..7c6de1ced 100644 --- a/org.argeo.slc.cms/src/org/argeo/slc/init/osgi/SlcInitActivator.java +++ b/org.argeo.slc.cms/src/org/argeo/slc/init/osgi/SlcInitActivator.java @@ -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(); diff --git a/sdk/argeo-build b/sdk/argeo-build index 08bc9ba66..6f8e29e85 160000 --- a/sdk/argeo-build +++ b/sdk/argeo-build @@ -1 +1 @@ -Subproject commit 08bc9ba6656515e235eb269c31bc2b1e93748055 +Subproject commit 6f8e29e850f9fcfa5149e296e650355fab930752 diff --git a/swt/rap/org.argeo.tool.rap.cli/bnd.bnd b/swt/rap/org.argeo.tool.rap.cli/bnd.bnd index bc893fe0b..246564bb1 100644 --- a/swt/rap/org.argeo.tool.rap.cli/bnd.bnd +++ b/swt/rap/org.argeo.tool.rap.cli/bnd.bnd @@ -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 -- 2.30.2