Skip to content

ewan-sinclair/BuildDrop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

BuildDrop

A simple script to drop android APK files from a local git repo into a directory with a build number and commit ID automatically.

Best used with a service like dropbox as a lightweight and easy way to share APK files while you develop, while keeping tight track of which version of your codebase they were generated by.

This tool is written and used under Linux with Bash with Android ADT and eclipse, and hasn't been tested outside that environment. It depends on egrep and sed being available. If you use it elsewhere with success, do let me know! If you use it without success, please edit and send me a pull request.

Instructions

  • Make sure you have Ruby version 1.9.2+ installed
  • Put builddrop.rb on your machine somewhere and add it to your path. There's no need to store it inside your project directories. I keep mine in /home/me/bin
  • Create the file .builddrop_config.yaml in your project root and configure all the variables to suit your project. See the configuration section for more information
  • Make sure you have a clean git repo with no uncomitted changes (BuildDrop will abort if you don't)
  • Build your android project (it will produce an APK in yourproject/bin/, this is what the script looks for). You should have the bin/ directory in your .gitignore file, so the repo will stay clean.
  • Change directory to your project root and invoke builddrop.rb
  • If all went well, you will see a status message like this: Dropped /home/me/dropbox/my_project/0004-b587b5.apk

Filenames

Files are numbered sequentially, from 0001 and up. Every time you drop a build, this number increments. The second part of the filename is the commit ID of the currently checked out branch. So, 0004-b587b5.apk would be the 4th build you dropped, made from commit ID b587b5.

Configuration

When you invoke BuildDrop, it looks for a file named .builddrop_config.yaml in the current directory. This just has a series of properties which define your settings.

  • git_dir: Where your git repo is. You'll nearly always set this to '.', since you should be running this from the root of your project, which is where your git repo should be initialised.
  • drop_dir: Where to drop the builds.
  • project_name: The name of your project, as it would be set by Eclipse. This
  • roughcut_dir (optional): The name of an auxiliary directory to drop builds that you don't want clogging up your main drop directory.
  • abort_debugwait (optional): Whether to abort if there are any uncommented Androis.os.waitForDebugger() calls in the codebase. This is just a little trick to catch a common error.
  • abort_dirty (optional): Whether to abort the drop if the repo is dirty.

About

A simple script to drop android APK files into a directory with a build number and commit ID automatically.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published