Skip to content
This repository has been archived by the owner on Dec 18, 2022. It is now read-only.

Developer notes

Yves Zoundi edited this page May 10, 2015 · 2 revisions

Development setup

  • JDK 1.7+: The project is slowly moving towards JDK8 for compatibility reasons and other potential build concerns.
  • Apache Ant (1.8.0+): You may have random failures with Ant 1.7.x. Double-check your local version or the one bundled in your IDE.
  • Git: Any version should do to clone the project. Use a Git front-end if you don’t like the command line.
  • An IDE if you need one (IntelliJ, Eclipse, NetBeans, etc.). There is Ivy integration for some of those IDEs (http://ant.apache.org/ivy/links.html). I use occasionally an IDE(any of the 3 mentioned previously) or Emacs(with Eclim for smart code completion).

Contributing

  • General K&R style with 8 spaces(no tabs).
  • Explicit names for variables, call a cat “cat”, write code with intent and comment if you feel like comments are needed.
  • Add unit tests to verify changes as you see fit, not just to increase code coverage.
  • Add integration tests for new Ant tasks, as it’s a good way to ensure that it will work for other people.
  • Test locally and send a pull-request.

Perform a release

Clean project tree

Make sure that your Git tree is clean by issuing a git status using the command line or the Git front-end of your choice.

Adjust the library version

This project uses semantic versioning.

The build file contains few Ant tasks to appropriately set the library version accordingly to the changes introduced.

  • release-prepare-fix for regular bug fixes.
  • release-prepare-feature if new features were added.
  • release-prepare-major for breaking changes, huge redesign, etc.

You can see the above mentioned Ant targets by running ant -p at the root of the project folder.

Perform the release and set the snapshot property to false.

Whether or not the build is a snapshot is controlled by the snapshot property in the properties/release.properties file. You need to set this flag to false to ensure the following:

  • Name of the generated jar artifact (whether or not it will end with snapshot.jar)
  • Some git checks are run to ensure that the project tree is not dirty. When performing a release, the expectation is that ideally only the release properties file is updated prior creating an SCM tag, publishing, etc.
  • If the build is a snapshot, the artifacts get automatically pushed the the Sonatype snapshots repository, otherwise they are sent to the release staging repository.

Example for a release The commands below will update the library version, compile the code, tag it in Git and push the build artifacts to the Sonatype Maven repository.

ant release-prepare-fix
ant -Dsnapshot=false clean maven-publish-remote

Push to Maven central

Login to oss.sonatype.org and perform a release accordingly to their instructions, using the Nexus UI.

Clone this wiki locally