Skip to content

Instantly share code, notes, and snippets.

View christopherperry's full-sized avatar

Christopher Perry christopherperry

View GitHub Profile

Gimmie teh R00by

$ rvm install ruby-2.0.0 

WTF!

...
@rkistner
rkistner / myapp_pom.xml
Created December 6, 2012 12:32
Android library project + lightweight application using it with Maven
<?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/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>myproject</artifactId>
<groupId>com.example</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>myapp</artifactId>
@pplante
pplante / robolectric-library-resource-loading.java
Created August 28, 2012 20:23
Robolectric does not support loading resources from an Android Library project such as ActionBarSherlock of FlyInMenu, so this patch allows you to specify a library project to load resources in tests.
// In ResourceLoader.java I added the following method:
//
public void loadLibraryProjectResources(File libraryProjectRoot) throws Exception {
File systemResourceDir = getSystemResourceDir(getPathToAndroidResources());
File localValueResourceDir = getValueResourceDir(libraryProjectRoot);
File systemValueResourceDir = getValueResourceDir(systemResourceDir);
loadStringResources(localValueResourceDir, systemValueResourceDir);
loadPluralsResources(localValueResourceDir, systemValueResourceDir);
loadValueResources(localValueResourceDir, systemValueResourceDir);