From 0aa80534d9c4ae90476dcec0ca7d4ccbeb476025 Mon Sep 17 00:00:00 2001 From: Matt McCutchen Date: Tue, 15 Sep 2009 19:46:30 -0400 Subject: [PATCH] Project/build/packaging adjustments + version 1.3 User-visible stuff: - Bump version to 1.3. - Add a description.xml with nice human-readable metadata. - Build against Java 1.5 for greater compatibility. Developer stuff: - Hide .git from Eclipse with a linked resource. - In shell-setup, try to detect any OOo 3.* SDK. - ooo-api project is moving to a separate ref. --- .classpath | 2 +- .gitignore | 7 ++--- .project | 9 +++++++ .settings/org.eclipse.jdt.core.prefs | 8 ++++++ Makefile | 39 +++++++++++++--------------- README | 2 +- ooo-api/.classpath | 29 --------------------- ooo-api/.project | 17 ------------ {src => pkg}/META-INF/manifest.xml | 0 pkg/description.xml | 37 ++++++++++++++++++++++++++ pkg/extension-description.txt | 1 + shell-setup | 19 +++++++++++--- 12 files changed, 95 insertions(+), 75 deletions(-) create mode 100644 .settings/org.eclipse.jdt.core.prefs delete mode 100644 ooo-api/.classpath delete mode 100644 ooo-api/.project rename {src => pkg}/META-INF/manifest.xml (100%) create mode 100644 pkg/description.xml create mode 100644 pkg/extension-description.txt diff --git a/.classpath b/.classpath index e2507c7..ee8e4aa 100644 --- a/.classpath +++ b/.classpath @@ -4,6 +4,6 @@ - + diff --git a/.gitignore b/.gitignore index 5c52c44..0b4f0b8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ -/bin +/urd +/pkg/measurements.uno.rdb /bin-types +/bin +/pkg/measurements.uno.jar /measurements.oxt -/pkg -/urd diff --git a/.project b/.project index c8c31d2..e20cc9a 100644 --- a/.project +++ b/.project @@ -14,4 +14,13 @@ org.eclipse.jdt.core.javanature + + + + .git + 2 + /usr/share/empty + + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..0e8e816 --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Tue Sep 15 18:19:49 EDT 2009 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/Makefile b/Makefile index a139c25..f82ac0b 100644 --- a/Makefile +++ b/Makefile @@ -1,50 +1,47 @@ -NAME:=measurements -empty:= +NAME := measurements +empty := -# $(OO) is now taken from shell-setup. -ifeq ($(OO),) +ifeq ($(OOO_BASIS),) $(error You must source "shell-setup" in the shell before running make.) endif -IDL_TYPES:=net/mattmccutchen/measurements/XMeasurementsAddIn - all: $(NAME).oxt -# Compile src -> bin using Eclipse's Java Builder. +IDL_TYPES := net/mattmccutchen/measurements/XMeasurementsAddIn urd/%.urd: src/%.idl mkdir -p $(dir $@) - idlc -C -I$(OO)/sdk/idl -O$(dir $@) $< - -%/.: - mkdir -p $* + idlc -C -I$(OOO_BASIS)/sdk/idl -O$(dir $@) $< -pkg/$(NAME).uno.rdb: $(patsubst %,urd/%.urd,$(IDL_TYPES)) pkg/. +pkg/$(NAME).uno.rdb: $(patsubst %,urd/%.urd,$(IDL_TYPES)) regmerge $@ /UCR $^ -.PHONY: bin-types bin-types: pkg/$(NAME).uno.rdb rm -rf $@ mkdir -p $(addprefix $@/,$(dir $(IDL_TYPES))) # javamaker is temperamental and demands the ./ - javamaker -BUCR -nD -T$(subst /,.,$(subst $(empty) ,;,$(IDL_TYPES))) -O./$@ $(OO)/ure-link/share/misc/types.rdb $< + javamaker -BUCR -nD -T$(subst /,.,$(subst $(empty) ,;,$(IDL_TYPES))) -O./$@ $(OOO_BASIS)/ure-link/share/misc/types.rdb $< +.PHONY: bin-types + +bin: src bin-types + # The Eclipse Java builder must be run externally to update "$@". +.PHONY: bin # 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/. +pkg/$(NAME).uno.jar: bin-types bin 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/$(NAME).uno.jar -PKG_FILES:=META-INF/manifest.xml $(NAME).uno.jar $(NAME).uno.rdb - -pkg/META-INF/manifest.xml: src/META-INF/manifest.xml pkg/META-INF/. - cat $< >$@ +PKG_FILES := description.xml extension-description.txt \ + META-INF/manifest.xml $(NAME).uno.rdb $(NAME).uno.jar $(NAME).oxt: $(addprefix pkg/,$(PKG_FILES)) cd pkg && fastjar -cMf ../$@ $(PKG_FILES) clean: - rm -rf urd bin-types pkg $(NAME).oxt + # Clean "bin" with the Eclipse Java builder if desired. + rm -rf urd pkg/$(NAME).uno.rdb bin-types pkg/$(NAME).uno.jar $(NAME).oxt diff --git a/README b/README index 9bdaa61..1aa2605 100644 --- a/README +++ b/README @@ -9,7 +9,7 @@ This OpenOffice.org Calc add-in provides a basic set of spreadsheet functions for manipulating scientific measurements, tracking units of measure and significant figures. -This is version 1.2. +This is version 1.3. To use ------ diff --git a/ooo-api/.classpath b/ooo-api/.classpath deleted file mode 100644 index 0243d39..0000000 --- a/ooo-api/.classpath +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ooo-api/.project b/ooo-api/.project deleted file mode 100644 index a54fddb..0000000 --- a/ooo-api/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - ooo-api - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/src/META-INF/manifest.xml b/pkg/META-INF/manifest.xml similarity index 100% rename from src/META-INF/manifest.xml rename to pkg/META-INF/manifest.xml diff --git a/pkg/description.xml b/pkg/description.xml new file mode 100644 index 0000000..e0ab4ac --- /dev/null +++ b/pkg/description.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + Matt McCutchen + + + + Measurements + + + + + + diff --git a/pkg/extension-description.txt b/pkg/extension-description.txt new file mode 100644 index 0000000..2c2470e --- /dev/null +++ b/pkg/extension-description.txt @@ -0,0 +1 @@ +Provides a basic set of spreadsheet functions for manipulating scientific measurements, tracking units of measure and significant figures. \ No newline at end of file diff --git a/shell-setup b/shell-setup index 357a4f1..9f50e5a 100644 --- a/shell-setup +++ b/shell-setup @@ -1,5 +1,18 @@ # No shebang; it makes no sense to execute this standalone. -export OO=/usr/lib/openoffice.org/basis3.0 -export PATH=$OO/sdk/bin:$PATH -export LD_LIBRARY_PATH=$OO/ure-link/lib +if [ -z "$OOO_BASIS" ]; then + basis="$(echo /usr/lib/openoffice.org/basis*)" + if ! [ -d "$basis" ]; then + echo >&2 "Could not find /usr/lib/openoffice.org/basis* dir." + echo >&2 "Make sure you have the OOo SDK installed." + return 1 + fi + export OOO_BASIS="$basis" + + # One would hope PATH is set, but we'll use the same test for consistency. + export PATH="$OOO_BASIS/sdk/bin:$OOO_BASIS/ure-link/bin${PATH+:${PATH}}" + + # Seems to be no longer needed in OOo 3.1: the executables have the + # library path coded into them. + #export LD_LIBRARY_PATH="$OOO_BASIS/ure-link/lib${LD_LIBRARY_PATH+:${LD_LIBRARY_PATH}}" +fi -- 2.34.1