Simplify and improve TP packaging
authorMathieu Baudier <mbaudier@argeo.org>
Wed, 19 Oct 2022 06:34:13 +0000 (08:34 +0200)
committerMathieu Baudier <mbaudier@argeo.org>
Wed, 19 Oct 2022 06:34:13 +0000 (08:34 +0200)
.gitmodules
rebuild/org.argeo.tp/Makefile
rebuild/org.argeo.tp/src/.gitignore [new file with mode: 0644]
repackage/Make.java [deleted file]
repackage/Makefile
sdk/argeo-build
src/org.argeo.tp/ee4j-mail [deleted submodule]

index 8ee8d8ccd73565329fc552e20c42263d5a932ab3..07b10cacb00393eff6d61e695fefe2acf9ab0577 100644 (file)
@@ -2,6 +2,3 @@
        path = sdk/argeo-build
        url = http://git.argeo.org/cc0/argeo-build.git
        branch = unstable
-[submodule "src/org.argeo.tp/ee4j-mail"]
-       path = src/org.argeo.tp/ee4j-mail
-       url = https://github.com/eclipse-ee4j/mail.git
index 7cbbc1e9ceba2c233ba260c6639b23a62f4d1b9f..67463cf27a88068e73512bf6b3c99ff8785ff3a9 100644 (file)
@@ -1,10 +1,19 @@
 include ../../sdk.mk
 .PHONY: clean all osgi
 
-all: prepare osgi
+all: retrieve-ee4j-mbox osgi
 
-prepare:
-       rsync -a --exclude module-info.java $(SDK_SRC_BASE)/src/org.argeo.tp/ee4j-mail/mbox/src/main/java/ com.sun.mail.mbox/src
+retrieve-ee4j-mbox: SRC_DIR=src/ee4j-mail
+retrieve-ee4j-mbox:
+       rm -rf $(SRC_DIR)
+       mkdir -p $(SRC_DIR)
+       #git -C $(SRC_DIR) init
+       #git -C $(SRC_DIR) remote add -f origin https://github.com/eclipse-ee4j/mail.git
+       #git -C $(SRC_DIR) config core.sparseCheckout true
+       #echo "mbox" >> $(SRC_DIR)/.git/info/sparse-checkout
+       #git -C $(SRC_DIR) pull origin 1.6.7
+       git clone --branch 1.6.7 https://github.com/eclipse-ee4j/mail.git $(SRC_DIR)
+       rsync -a --delete --exclude module-info.java $(SRC_DIR)/mbox/src/main/java/ com.sun.mail.mbox/src
 
 A2_CATEGORY = org.argeo.tp
 
diff --git a/rebuild/org.argeo.tp/src/.gitignore b/rebuild/org.argeo.tp/src/.gitignore
new file mode 100644 (file)
index 0000000..ca46c96
--- /dev/null
@@ -0,0 +1 @@
+ee4j-mail/
\ No newline at end of file
diff --git a/repackage/Make.java b/repackage/Make.java
deleted file mode 100644 (file)
index 11c7bcd..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-import java.nio.file.Path;
-import java.nio.file.Paths;
-
-import org.argeo.slc.factory.A2Factory;
-
-class Make {
-       public static void main(String[] args) {
-               if (args.length < 1) {
-                       System.err.println("Usage: <path to a2 output dir>");
-                       System.exit(1);
-               }
-               Path a2Base = Paths.get(args[0]).toAbsolutePath().normalize();
-               Path descriptorsBase = Paths.get("./tp").toAbsolutePath().normalize();
-               A2Factory factory = new A2Factory(a2Base, descriptorsBase, true);
-
-               // SDK
-               factory.processCategory(Paths.get("org.argeo.tp.sdk"));
-
-               // 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("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"));
-
-               factory.processEclipseArchive(Paths.get("swt/rcp/org.argeo.tp.swt", "eclipse-rcp"));
-
-               factory.processEclipseArchive(Paths.get("lib/linux/x86_64/swt/rcp/org.argeo.tp.swt", "eclipse-rcp"));
-               factory.processEclipseArchive(Paths.get("lib/linux/aarch64/swt/rcp/org.argeo.tp.swt", "eclipse-rcp"));
-               factory.processEclipseArchive(Paths.get("lib/win32/x86_64/swt/rcp/org.argeo.tp.swt", "eclipse-rcp"));
-               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.workbench", "eclipse-rcp"));
-               factory.processCategory(Paths.get("swt/rcp/org.argeo.tp.swt.workbench"));
-
-               // Maven
-               factory.processCategory(Paths.get("org.argeo.tp"));
-               factory.processCategory(Paths.get("org.argeo.tp.apache"));
-               factory.processCategory(Paths.get("org.argeo.tp.jetty"));
-               factory.processCategory(Paths.get("org.argeo.tp.jcr"));
-               factory.processCategory(Paths.get("org.argeo.tp.formats"));
-               factory.processCategory(Paths.get("org.argeo.tp.poi"));
-               factory.processCategory(Paths.get("org.argeo.tp.gis"));
-       }
-
-}
\ No newline at end of file
index 40aef3e534666a4cb6a9d339b25b6da0ab042efa..2985e0d1543823373d6fe2518bfa3815231fbef5 100644 (file)
@@ -1,8 +1,6 @@
 include ../sdk.mk
 .PHONY: clean all
 
-all: distribution
-
 BOOTSTRAP_BASE=$(SDK_BUILD_BASE)/bootstrap
 
 A2_OUTPUT = $(SDK_BUILD_BASE)/a2
@@ -29,22 +27,29 @@ org.argeo.tp.formats \
 org.argeo.tp.poi \
 org.argeo.tp.gis \
 
+TODOS_REPACKAGE = $(foreach category, $(CATEGORIES),$(BUILD_BASE)/$(category)/to-repackage) 
+
+BUILD_BASE = $(SDK_BUILD_BASE)/$(shell basename $(SDK_SRC_BASE))
+
+all: $(BUILD_BASE)/repackaged 
 
-distribution:
+.SECONDEXPANSION:
+
+$(BUILD_BASE)/repackaged : CATEGORIES_TO_REPACKAGE = $(subst $(abspath $(BUILD_BASE))/,, $(subst to-repackage,, $?))
+$(BUILD_BASE)/repackaged : $(TODOS_REPACKAGE)
        $(JVM) -cp \
-        $(BOOTSTRAP_BASE)/bndlib.jar:$(BOOTSTRAP_BASE)/slf4j-api.jar:$(BOOTSTRAP_BASE)/org.argeo.slc.api/bin:$(BOOTSTRAP_BASE)/org.argeo.slc.factory/bin \
-        $(SDK_SRC_BASE)/sdk/argeo-build/src/org/argeo/build/Repackage.java $(A2_OUTPUT) $(CATEGORIES)
+        $(BOOTSTRAP_BASE)/bndlib.jar:$(BOOTSTRAP_BASE)/slf4j-api.jar \
+        $(SDK_SRC_BASE)/sdk/argeo-build/src/org/argeo/build/Repackage.java $(A2_OUTPUT) $(CATEGORIES_TO_REPACKAGE)
+       touch $(BUILD_BASE)/repackaged
+
+$(BUILD_BASE)/%/to-repackage : $$(shell find % -type f )
+       @rm -rf $(dir $@)
+       @mkdir -p $(dir $@) 
+       @touch $@
 
 clean:
-       rm -rf $(A2_OUTPUT)/org.argeo.tp
-       rm -rf $(A2_OUTPUT)/org.argeo.tp.*
-       rm -rf $(A2_OUTPUT)/*/org.argeo.tp
-       rm -rf $(A2_OUTPUT)/*/org.argeo.tp.*
-       rm -rf $(A2_OUTPUT)/*/*/org.argeo.tp
-       rm -rf $(A2_OUTPUT)/*/*/org.argeo.tp.*
-       rm -rf $(A2_OUTPUT)/*/*/*/org.argeo.tp
-       rm -rf $(A2_OUTPUT)/*/*/*/org.argeo.tp.*
-       rm -rf $(A2_OUTPUT)/*/*/*/*/org.argeo.tp
-       rm -rf $(A2_OUTPUT)/*/*/*/*/org.argeo.tp.*
+       $(foreach category, $(CATEGORIES), rm -rf $(A2_OUTPUT)/$(category))
+       $(foreach category, $(CATEGORIES), rm -rf $(BUILD_BASE)/$(category))
+       rm -f $(BUILD_BASE)/repackaged
 
 include  $(SDK_SRC_BASE)/sdk/argeo-build/osgi.mk
\ No newline at end of file
index 74232bbbcd17259fcaf4b3ff29e30e7a795bc945..011962b1bb63d375622dbe79a50c45f16374b0a1 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 74232bbbcd17259fcaf4b3ff29e30e7a795bc945
+Subproject commit 011962b1bb63d375622dbe79a50c45f16374b0a1
diff --git a/src/org.argeo.tp/ee4j-mail b/src/org.argeo.tp/ee4j-mail
deleted file mode 160000 (submodule)
index 33c6745..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 33c67452393344c7e761242a26fb8f04f993d830