From 23f8ad3bd6e59bcba1328db133af6d1a3d6272e1 Mon Sep 17 00:00:00 2001 From: Matt McCutchen Date: Mon, 7 Jan 2008 21:05:59 -0500 Subject: [PATCH] Bring packaging process up to date for OpenOffice 2.3. I noticed that installing Measurements 1 into OpenOffice 2.3 gave an error and the demo spreadsheet did not work. Evidently something about extensions was changed between earlier OpenOffice 2.x and OpenOffice 2.3. I rearranged the packaging process to follow the CalcAddins example in the SDK. Now the types and the implementation are in the same jar. --- .classpath | 4 +-- .gitignore | 11 +++----- Makefile | 55 ++++++++++++++++++++------------------- README | 2 +- pkg/META-INF/manifest.xml | 6 ----- src/META-INF/manifest.xml | 6 +++++ 6 files changed, 41 insertions(+), 43 deletions(-) delete mode 100644 pkg/META-INF/manifest.xml create mode 100644 src/META-INF/manifest.xml diff --git a/.classpath b/.classpath index e0a9d41..e2507c7 100644 --- a/.classpath +++ b/.classpath @@ -3,7 +3,7 @@ - - + + diff --git a/.gitignore b/.gitignore index 92c166d..5c52c44 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,5 @@ -*.urd -/types.rdb -pkg/types.rdb -pkg/types.jar -pkg/component.jar /bin -/idl-classes -measurements.uno.pkg +/bin-types +/measurements.oxt +/pkg +/urd diff --git a/Makefile b/Makefile index 680b515..78a8851 100644 --- a/Makefile +++ b/Makefile @@ -1,44 +1,45 @@ +NAME:=measurements empty:= - OO:=/usr/lib/openoffice.org -#export PATH+=:$(OO)/sdk/linux/bin -#export LD_LIBRARY_PATH=$(OO)/program - -#IDL_TYPES:=net/mattmccutchen/measurements/XExampleAddIn IDL_TYPES:=net/mattmccutchen/measurements/XMeasurementsAddIn -all: measurements.uno.pkg +all: $(NAME).oxt + +# Compile src -> bin using Eclipse's Java Builder. + +urd/%.urd: src/%.idl + mkdir -p $(dir $@) + idlc -C -I$(OO)/sdk/idl -O$(dir $@) $< -%.urd: %.idl - idlc -I$(OO)/sdk/idl $< +%/.: + mkdir -p $* -types.rdb: $(patsubst %,src/%.urd,$(IDL_TYPES)) +pkg/$(NAME).uno.rdb: $(patsubst %,urd/%.urd,$(IDL_TYPES)) pkg/. regmerge $@ /UCR $^ -.PHONY: idl-classes -idl-classes: types.rdb - rm -rf idl-classes - mkdir -p $(addprefix idl-classes/,$(dir $(IDL_TYPES))) +.PHONY: bin-types +bin-types: pkg/$(NAME).uno.rdb + rm -rf $@ + mkdir -p $(addprefix $@/,$(dir $(IDL_TYPES))) # javamaker is temperamental and demands the ./ - javamaker -O./idl-classes -T$(subst /,.,$(subst $(empty) ,;,$(IDL_TYPES))) -nD -BUCR $(OO)/program/types.rdb types.rdb + javamaker -BUCR -nD -T$(subst /,.,$(subst $(empty) ,;,$(IDL_TYPES))) -O./$@ $(OO)/program/types.rdb $< -pkg/types.rdb: types.rdb - cat $< >$@ - -.PHONY: pkg/types.jar -pkg/types.jar: idl-classes - cd idl-classes && fastjar -cMf ../$@ $(addsuffix .class,$(IDL_TYPES)) +# We collect both types and implementation into this jar. +# It seems that the manifest has to be first, so handle it specially. +.PHONY: pkg/$(NAME).uno.jar +pkg/$(NAME).uno.jar: bin-types pkg/. + cd bin && fastjar -cMf ../$@ META-INF/MANIFEST.MF + cd bin-types && fastjar -uMf ../$@ $(addsuffix .class,$(IDL_TYPES)) + cd bin && find . -name '*.class' | LC_COLLATE=C sort | fastjar -uMf ../$@ -@ -.PHONY: pkg/component.jar -pkg/component.jar: - cd bin && find . -name '*.class' -or -wholename './META-INF/MANIFEST.MF' | LC_COLLATE=C sort | fastjar -cMf ../$@ -@ +PKG_FILES:=META-INF/manifest.xml $(NAME).uno.jar $(NAME).uno.rdb -PKG_FILES:=META-INF/manifest.xml types.rdb types.jar component.jar +pkg/META-INF/manifest.xml: src/META-INF/manifest.xml pkg/META-INF/. + cat $< >$@ -measurements.uno.pkg: $(addprefix pkg/,$(PKG_FILES)) +$(NAME).oxt: $(addprefix pkg/,$(PKG_FILES)) cd pkg && fastjar -cMf ../$@ $(PKG_FILES) clean: - rm -rf idl-classes types.rdb pkg/{types.rdb,types.jar,component.jar} - find src -name '*.urd' -delete + rm -rf urd bin-types pkg $(NAME).oxt diff --git a/README b/README index f12ed6c..1257e7e 100644 --- a/README +++ b/README @@ -3,7 +3,7 @@ functions for tracking units of measure and significant figures. See: http://mattmccutchen.net/measurements/ -This is version 1. +This is version 1.1. Legal ----- diff --git a/pkg/META-INF/manifest.xml b/pkg/META-INF/manifest.xml deleted file mode 100644 index 91c55c3..0000000 --- a/pkg/META-INF/manifest.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/META-INF/manifest.xml b/src/META-INF/manifest.xml new file mode 100644 index 0000000..080b1f8 --- /dev/null +++ b/src/META-INF/manifest.xml @@ -0,0 +1,6 @@ + + + + + + -- 2.34.1