Project/build/packaging adjustments + version 1.3 master
authorMatt McCutchen <matt@mattmccutchen.net>
Tue, 15 Sep 2009 23:46:30 +0000 (19:46 -0400)
committerMatt McCutchen <matt@mattmccutchen.net>
Tue, 15 Sep 2009 23:46:30 +0000 (19:46 -0400)
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.

12 files changed:
.classpath
.gitignore
.project
.settings/org.eclipse.jdt.core.prefs [new file with mode: 0644]
Makefile
README
ooo-api/.classpath [deleted file]
ooo-api/.project [deleted file]
pkg/META-INF/manifest.xml [moved from src/META-INF/manifest.xml with 100% similarity]
pkg/description.xml [new file with mode: 0644]
pkg/extension-description.txt [new file with mode: 0644]
shell-setup

index e2507c7..ee8e4aa 100644 (file)
@@ -4,6 +4,6 @@
        <classpathentry kind="src" path="test"/>
        <classpathentry combineaccessrules="false" kind="src" path="/ooo-api"/>
        <classpathentry kind="lib" path="bin-types"/>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
        <classpathentry kind="output" path="bin"/>
 </classpath>
index 5c52c44..0b4f0b8 100644 (file)
@@ -1,5 +1,6 @@
-/bin
+/urd
+/pkg/measurements.uno.rdb
 /bin-types
+/bin
+/pkg/measurements.uno.jar
 /measurements.oxt
-/pkg
-/urd
index c8c31d2..e20cc9a 100644 (file)
--- a/.project
+++ b/.project
        <natures>
                <nature>org.eclipse.jdt.core.javanature</nature>
        </natures>
+       <!-- Hide the .git directory from Eclipse because it's big and unneeded.
+            Disable this if you want to use an Eclipse git team provider. -->
+       <linkedResources>
+               <link>
+                       <name>.git</name>
+                       <type>2</type>
+                       <location>/usr/share/empty</location>
+               </link>
+       </linkedResources>
 </projectDescription>
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
new file mode 100644 (file)
index 0000000..0e8e816
--- /dev/null
@@ -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
index a139c25..f82ac0b 100644 (file)
--- 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 (file)
--- 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 (file)
index 0243d39..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/ure-link/share/java/java_uno.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/ure-link/share/java/juh.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/ure-link/share/java/jurt.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/ure-link/share/java/ridl.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/ure-link/share/java/unoloader.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/program/classes/agenda.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/program/classes/classes.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/program/classes/commonwizards.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/program/classes/fax.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/program/classes/form.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/program/classes/jut.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/program/classes/letter.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/program/classes/LuceneHelpWrapper.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/program/classes/officebean.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/program/classes/query.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/program/classes/report.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/program/classes/ScriptFramework.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/program/classes/ScriptProviderForJava.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/program/classes/table.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/program/classes/unoil.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/program/classes/web.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/program/classes/xmerge.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/program/classes/XMergeBridge.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/program/classes/XSLTFilter.jar"/>
-       <classpathentry exported="true" kind="lib" path="/usr/lib/openoffice.org/basis3.0/program/classes/XSLTValidate.jar"/>
-       <classpathentry kind="output" path=""/>
-</classpath>
diff --git a/ooo-api/.project b/ooo-api/.project
deleted file mode 100644 (file)
index a54fddb..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>ooo-api</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>org.eclipse.jdt.core.javanature</nature>
-       </natures>
-</projectDescription>
diff --git a/pkg/description.xml b/pkg/description.xml
new file mode 100644 (file)
index 0000000..e0ab4ac
--- /dev/null
@@ -0,0 +1,37 @@
+<description
+       xmlns="http://openoffice.org/extensions/description/2006"
+       xmlns:dep="http://openoffice.org/extensions/description/2006"
+       xmlns:xlink="http://www.w3.org/1999/xlink"
+>
+       <identifier value="net.mattmccutchen.measurements"/>
+
+       <version value="1.3"/>
+
+       <!-- I see no reason why Measurements would not run on every platform
+       on which OOo does.  I'll change this later if necessary. -->
+       <platform value="all"/>
+
+       <!-- Not using registration / simple-license. -->
+
+       <dependencies>
+               <!-- I haven't done the testing to know what minimum OOo version
+               is really needed, so I don't wish to block possibly working
+               configurations.  3.0 should be plenty. -->
+       </dependencies>
+
+       <!-- Not supporting automatic update right now. -->
+
+       <!-- I would appreciate if people who fork Measurements would change
+       this, but it isn't critical. -->
+       <publisher>
+               <name xlink:href="http://mattmccutchen.net/measurements/" lang="en">Matt McCutchen</name>
+       </publisher>
+
+       <display-name>
+               <name lang="en">Measurements</name>
+       </display-name>
+
+       <extension-description>
+               <src xlink:href="extension-description.txt"/>
+       </extension-description>
+</description>
diff --git a/pkg/extension-description.txt b/pkg/extension-description.txt
new file mode 100644 (file)
index 0000000..2c2470e
--- /dev/null
@@ -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
index 357a4f1..9f50e5a 100644 (file)
@@ -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