Skip to content

Instantly share code, notes, and snippets.

@aaalaniz
aaalaniz / MainThreadBus.java
Created June 10, 2014 05:22
Otto Main Thread Bus
public class MainThreadBus extends Bus {
private final Bus mBus;
private final Handler mHandler = new Handler(Looper.getMainLooper());
public MainThreadBus(final Bus bus) {
if (bus == null) {
throw new NullPointerException("bus must not be null");
}
mBus = bus;
}
@aaalaniz
aaalaniz / pom.xml
Created May 22, 2014 02:38
Example Android pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>my-awesome-app</artifactId>
<version>1.0.0</version>
<packaging>apk</packaging>
<name>My Awesome Android Application</name>
<dependencies>
@aaalaniz
aaalaniz / perform_release.sh
Created May 21, 2014 04:32
Performing Android Release with Maven
# Create a release branch
RELEASE_VERSION=`mvn help:evaluate -Dexpression=project.version | grep -v INFO | grep SNAPSHOT | cut -d '-' -f 1`
git checkout -b release/$RELEASE_VERSION
# Prepare a release (Note we do not push any tags just yet)
mvn -B release:prepare -DpushChanges=false -DremoteTagging=false -DscmCommentPrefix= -P release
# The project has been built and now we want to deploy
# but we need to ensure our manifest stays in line with our releases
git reset HEAD~1