Steps for creating a GeoAPI milestone in a Unix environment

Prepare environment

Defines the version number for the GeoAPI milesone. The example below uses 3.1-M06. Please edit as needed.

export GEOAPI_SNAPSHOT=3.1-SNAPSHOT
export GEOAPI_VERSION=3.1-M06

Prepare the code

If not already done, ensure that the geoapi/src/main/javadoc/content.html file is up to date. The following commands assume that the current directory (pwd) is the local checkout of GeoAPI.

export CLASSPATH=$PWD/geoapi/target/geoapi-$GEOAPI_SNAPSHOT.jar:\
$PWD/geoapi-pending/target/geoapi-pending-$GEOAPI_SNAPSHOT.jar:\
$PWD/tools/target/tools-$GEOAPI_SNAPSHOT.jar

cd geoapi/src/main/java
find . -name "*.java" -print | xargs apt -nocompile -factory org.opengis.tools.apt.IndexGenerator
cd -
git status
git commit --all --message "Updated the list of GeoAPI classes and methods."

If the geoapi-openoffice module got significant changes, edit the version number in the following files:

  • geoapi-openoffice/src/main/unopkg/description.xml
  • geoapi-openoffice/src/site/resources/update.xml

Create the tag and deploy

Create a temporary branch. We will delete that branch later, before to push.

git checkout -b deployment

Edit the version number on that branch only: (Note: BSD variant of sed expects -i '' parameter instead of --in-place='')

find . -name "pom.xml" -print | xargs sed --in-place='' "s/$GEOAPI_SNAPSHOT/$GEOAPI_VERSION/g"
git clean --force
git diff
git add --update

Test the build. If successful, commit, tag, and deploy. For milestones, we create lightweight tags rather than annotated tags.

mvn clean install
git status
git commit --message "Set the version number to $GEOAPI_VERSION."
git tag $GEOAPI_VERSION
mvn clean deploy

In case of mistake:

  • the tag can be deleted with git tag --delete $GEOAPI_VERSION
  • the last commit can be unstaged with git reset HEAD^
  • the local changes can be discarded with git checkout -- .

If everything is okay, push the tag. This action is irreversible, so do it only when sure.

git checkout 3.1.x
git branch -D deployment
git show $GEOAPI_VERSION
git push origin $GEOAPI_VERSION

Create the javadoc and the ZIP files

Generate javadoc. Note that the content of geoapi/src/main/javadoc/ is not copied automatically (Maven documentation said that it should be copied, but it doesn't seem to be the case as of Maven 2.1.0), so we need to copy ourself.

mvn javadoc:javadoc
cp geoapi/src/main/javadoc/content.html  geoapi/target/site/apidocs/
cp geoapi/src/main/javadoc/UML-java.html geoapi/target/site/apidocs/

Creates a ZIP file and deploy on the download area (todo: which download area?)

cd geoapi/target/site/
zip -r9 ../geoapi-$GEOAPI_VERSION.zip apidocs/
cd ..
zip -9 geoapi-$GEOAPI_VERSION.zip geoapi-$GEOAPI_VERSION.jar

Create the list of API changes since previous releases

Edit the version numbers declared in the ChangeReport.java file, then apply the instructions documented in the tools page.

Final clean

Only at this point, the working directory can be cleaned:

cd ../..
mvn clean

Do not forget to edit the src/site/apt/changes/index.apt file on trunk.