Adapt build to release mechanism

Now it will checkout develop for development builds,
$project-$version for release builds, and construct
API docs from this checkout.

Requires a line matching release\s*=\s*['"](.*)['"] where the release
is captured, and -dev to mark development releases.

Change-Id: Ifd0aba6139879c548edc4214872c0b76951b2941