anathema/anathema — pull request #248 by curttasker (2012-07-12 05:20:27+00:00)
Title: Tag and Upload tasks are done

### Changes
- Rewrote the `tag` task to work on all platforms (provided git is installed properly).
- Wrote `upload` task that uploads to sourceforge (cross platform, provided scp is installed properly).
- Changed location of release artifacts from `/build/` to `/build/Anathema_${versionString} {versionName}/` (only uses version name for .0 releases)
- This allows us to use scp to recursively upload the release artifact directory directly to sourceforge.
- Enhanced the readme.md parser to snag the release notes only for the version being built (as specified in [gradle.properties](https://github.com/anathema/anathema/blob/master/gradle.properties)) rather than the most recent version in the file.

### Discussion

So after getting tagging working in #245, I figured I'd try my hand at uploading. It currently uses a very basic approach, calling scp via exec. It works, but there's no progress bar, and the password prompt gets a little obscured by the gradle build output.

I do have a working local build that uses the [ant scp task](http://ant.apache.org/manual/Tasks/scp.html) loaded via maven to do this, but I was unhappy with it:
- The progress bar gets hidden due to gradle intercepting all ant output.
- Does not accept the recursive option, and thus cannot create folders on the destination. This means we need to jump through hoops to create the directory on the destination.
- Sourceforge doesn't really like the ant ssh task's commands, for various reasons, and thus there is no easy way to create the directory.

Rsync would be a better option than scp, but I didn't have time to fool around with it this evening. Also, while scp is included with git-bash (the git for windows unix-esque prompt), rsync is not. Cygwin does have it, but I'm not sure we should require windows developers use it. And unfortunately, there is no maven or ant rsync task.

Anyways, the current scp over exec method does work, and I tested it thoroughly in my own upload folder on sourceforge. It takes about ~2 minutes to do an upload of all 4 files, though there's zero feedback while its happening (unless you run gradle with the debug flag). I did perform a single upload test to the anathema releases folder and it worked fine.

So now we can change the release process in the wiki:
- Change step 3 to: Run `gradlew upload` and enter your Sourceforge username and password when prompted.
- Change step 5 to: Run `gradlew tag`
- Remove step 6

So really at this point, it could be shortened to something like:
1. Change the version numbers and version name in [gradle.properties](https://github.com/anathema/anathema/blob/master/gradle.properties)
2. Run `gradlew clean release tag upload` to do a clean build of all release artifacts, tag the release on github, and upload the release artifacts to sourceforge. [Requires contributor status on github.com/anathema and release manager status on sourceforge.net/projects/anathema]
3. Tag all releases properly on sourceforge (descriptions and OS checkboxes) [Requires release manager status on sourceforge.net/projects/anathema]

We're to the point now that we could combine steps 1 and 2, but step 3 is still a bit of a stumbling block.