Skip to content

Instantly share code, notes, and snippets.

@FrozenCow
Last active December 18, 2015 11:08
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save FrozenCow/5773016 to your computer and use it in GitHub Desktop.
Save FrozenCow/5773016 to your computer and use it in GitHub Desktop.
apply plugin: 'android-library'
repositories {
mavenLocal()
}
dependencies {
compile 'com.google.android:support-v4:r7'
}
apply plugin: 'maven'
uploadArchives {
repositories {
mavenDeployer {
repository url: 'file://' + new File(System.getProperty('user.home'), '.m2/repository').absolutePath
}
}
}
task install(dependsOn: uploadArchives)
android {
compileSdkVersion 14
buildToolsVersion '17'
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="...org.you.yourpackage...">
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="17" <!-- Use same targetSdk as ActionBarSherlock -->
/>
<application></application> <!-- You *need* <application> even if your project is a library. Without this line 'gradle build' will crash for me with a RuntimeException: https://code.google.com/p/android/issues/detail?id=40248 -->
</manifest>
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4.2'
}
}
apply plugin: 'android-library'
version='1.0'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
compile 'com.actionbarsherlock:actionbarsherlock:4.3.2-SNAPSHOT'
}
android {
compileSdkVersion 17
buildToolsVersion "17.0"
}
@morristech
Copy link

thank you for example, really made a difference!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment