include sdk.mk
-.PHONY: clean all
+.PHONY: clean all bootstrap
-all: distribution
+all: bootstrap distribution
BOOTSTRAP_BASE=$(SDK_BUILD_BASE)/bootstrap
A2_OUTPUT = $(SDK_BUILD_BASE)/a2
-distribution: bootstrap
+distribution:
make -C repackage all
make -C rebuild all
-bootstrap :
+bootstrap:
+ make -C bootstrap bootstrap-download-sources all
+
+bootstrap-old :
mkdir -p $(SDK_BUILD_BASE)/bootstrap
wget -c -O $(BOOTSTRAP_BASE)/ecj.jar https://repo1.maven.org/maven2/org/eclipse/jdt/ecj/3.32.0/ecj-3.32.0.jar
wget -c -O $(BOOTSTRAP_BASE)/slf4j-api.jar https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar
wget -c -O $(BOOTSTRAP_BASE)/bndlib.jar https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bndlib/5.3.0/biz.aQute.bndlib-5.3.0.jar
clean:
- rm -rf $(BOOTSTRAP_BASE)
+ make -C bootstrap clean
make -C repackage clean
make -C rebuild clean
+
clean-origin-cache:
rm -rf $(HOME)/.cache/argeo/build
--- /dev/null
+include ../sdk.mk
+include ../common.mk
+
+ECJ_VERSION=4.26
+BND_VERSION=5.3.0
+
+ORIGIN_BASE=$(HOME)/.cache/argeo/build/origin
+BOOTSTRAP_BASE=$(SDK_BUILD_BASE)/bootstrap
+
+ECJ_BASE=$(BOOTSTRAP_BASE)/ecj
+ECJ_SRC=$(ECJ_BASE)/OSGI-OPT/src
+
+BNDLIB_BASE=$(BOOTSTRAP_BASE)/bndlib
+BNDLIB_SRC=$(BNDLIB_BASE)/OSGI-OPT/src
+
+bootstrap-download-sources: $(ORIGIN_BASE)/ecjsrc-$(ECJ_VERSION).jar $(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz
+
+$(ORIGIN_BASE)/ecjsrc-$(ECJ_VERSION).jar:
+ mkdir -p $(ORIGIN_BASE)
+ wget -c -O $(ORIGIN_BASE)/ecjsrc-$(ECJ_VERSION).jar https://ftp-stud.hs-esslingen.de/Mirrors/eclipse/eclipse/downloads/drops4/R-4.26-202211231800/ecjsrc-$(ECJ_VERSION).jar
+
+$(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz:
+ mkdir -p $(ORIGIN_BASE)
+ wget -c -O $(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz https://github.com/bndtools/bnd/archive/refs/tags/$(BND_VERSION).REL.tar.gz
+
+all: ecj-build bndlib-build
+ make -C org.argeo.tp.build all
+
+ecj: ecj-build
+
+ecj-build:
+ mkdir -p $(ECJ_BASE)
+ cd $(ECJ_BASE) && jar -xf $(ORIGIN_BASE)/ecjsrc-$(ECJ_VERSION).jar
+ # remove ant-dependent class
+ $(RM) $(ECJ_BASE)/org/eclipse/jdt/core/JDTCompilerAdapter.java
+ # clean up
+ $(RM) $(ECJ_BASE)/*.jar
+ $(RM) $(ECJ_BASE)/build.xml
+ $(RM) $(ECJ_BASE)/ecj.1
+ $(RM) -rf $(ECJ_BASE)/scripts
+ # TODO: keep the service files
+ $(RM) -rf $(ECJ_BASE)/META-INF
+ # list sources
+ find $(ECJ_BASE)/org | grep "\.java" > $(BOOTSTRAP_BASE)/ecj.todo
+ # copy sources
+ mkdir -p $(ECJ_SRC)
+ cp -r $(ECJ_BASE)/org $(ECJ_SRC)
+ # build
+ $(JAVA_HOME)/bin/javac -d $(ECJ_BASE) -source 17 -target 17 -Xlint:none @$(BOOTSTRAP_BASE)/ecj.todo
+ # remove sources
+ cd $(ECJ_BASE) && find . -name "*.java" -name "*.html" -type f -exec rm -f {} \;
+
+bndlib-build: ecj-build
+ # copy sources
+ cd $(BOOTSTRAP_BASE) && tar -xzf $(ORIGIN_BASE)/bnd-$(BND_VERSION).tar.gz
+ mkdir -p $(BNDLIB_SRC)
+ cp -r $(BOOTSTRAP_BASE)/bnd-$(BND_VERSION).REL/aQute.libg/src/* $(BNDLIB_SRC)
+ cp -r $(BOOTSTRAP_BASE)/bnd-$(BND_VERSION).REL/biz.aQute.bndlib/src/* $(BNDLIB_SRC)
+ cp -r $(BOOTSTRAP_BASE)/bnd-$(BND_VERSION).REL/biz.aQute.bnd.annotation/src/* $(BNDLIB_SRC)
+ rm -rf $(BOOTSTRAP_BASE)/bnd-$(BND_VERSION).REL
+
+ # clean up
+ rm -rf $(BNDLIB_SRC)/aQute/bnd/junit
+
+ # build
+ $(JAVA_HOME)/bin/java -cp $(ECJ_BASE) org.eclipse.jdt.internal.compiler.batch.Main -nowarn \
+ -cp $(BND_CLASSPATH) \
+ -source 17 -target 17 \
+ $(BNDLIB_SRC) \
+ -d $(BNDLIB_BASE)
+
+
+clean:
+ rm -rf $(BOOTSTRAP_BASE)
+ make -C org.argeo.tp.build clean
--- /dev/null
+include ../../sdk.mk
+include ../../common.mk
+
+.PHONY: clean all osgi
+
+A2_OUTPUT := $(SDK_BUILD_BASE)/a2
+JVM ?= $(JAVA_HOME)/bin/java
+
+ARGEO_MAKE := $(JVM) -cp $(BOOTSTRAP_BASE)/ecj:$(BOOTSTRAP_BASE)/bndlib:$(BND_CLASSPATH) $(SDK_SRC_BASE)/sdk/argeo-build/src/org/argeo/build/Make.java
+
+A2_CATEGORY = org.argeo.tp.build
+
+all: osgi
+
+osgi:
+ cp -r $(BOOTSTRAP_BASE)/ecj/OSGI-OPT/src org.eclipse.jdt.core.compiler.batch
+ cp -r $(BOOTSTRAP_BASE)/bndlib/OSGI-OPT/src biz.aQute.bndlib
+ $(ARGEO_MAKE) all --category $(A2_CATEGORY) --bundles org.eclipse.jdt.core.compiler.batch biz.aQute.bndlib
+
+clean:
+ $(RM) -rf org.eclipse.jdt.core.compiler.batch/src
+ $(RM) -rf biz.aQute.bndlib/src
\ No newline at end of file
--- /dev/null
+/src/
+/bin/
\ No newline at end of file
--- /dev/null
+major: 5
+minor: 3
+micro: 0
+qualifier:
+
+Bundle-License: Apache-2.0
--- /dev/null
+/src/
+/bin/
\ No newline at end of file
--- /dev/null
+major: 3
+minor: 32
+micro: 0
+qualifier:
+
+Bundle-License: EPL-2.0
+Main-Class: org.eclipse.jdt.internal.compiler.batch.Main
--- /dev/null
+BOOTSTRAP_BASE=$(SDK_BUILD_BASE)/bootstrap
+
+ifneq (,$(wildcard /etc/redhat-release))
+# dnf install slf4j osgi-core osgi-annotation osgi-compendium
+BND_CLASSPATH=/usr/share/java/slf4j/slf4j-api.jar:/usr/share/java/osgi-core/osgi.core.jar:/usr/share/java/osgi-annotation/osgi.annotation.jar:/usr/share/java/osgi-compendium/osgi.cmpn.jar
+else
+# sudo apt install libslf4j-java libosgi-core-java libosgi-annotation-java libosgi-compendium-java
+BND_CLASSPATH=/usr/share/java/slf4j-api.jar:/usr/share/java/osgi.core.jar:/usr/share/java/osgi.annotation.jar:/usr/share/java/osgi.cmpn.jar
+endif
+
include ../sdk.mk
+include ../common.mk
+
.PHONY: clean all
BOOTSTRAP_BASE=$(SDK_BUILD_BASE)/bootstrap
$(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 \
+ #$(JVM) -cp \
+ # $(BOOTSTRAP_BASE)/bndlib.jar:$(BOOTSTRAP_BASE)/slf4j-api.jar
+ $(JVM) -cp $(A2_OUTPUT)/org.argeo.tp.build/biz.aQute.bndlib.5.3.jar:$(BND_CLASSPATH) \
$(SDK_SRC_BASE)/sdk/argeo-build/src/org/argeo/build/Repackage.java $(A2_OUTPUT) $(CATEGORIES_TO_REPACKAGE)
touch $(BUILD_BASE)/repackaged