--- /dev/null
+buildscript {
+ repositories {
+ maven { url 'http://repo1.maven.org/maven2' }
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:0.4'
+ }
+}
+apply plugin: 'android-library'
+
+dependencies {
+ compile fileTree(dir: 'libs', include: '*.jar')
+}
+
+android {
+ sourceSets {
+ main {
+ manifest.srcFile 'AndroidManifest.xml'
+
+ java.srcDirs 'src'
+ res.srcDirs 'res'
+ }
+ }
+
+ compileSdkVersion 17
+ buildToolsVersion "17"
+
+ defaultConfig {
+ minSdkVersion 7
+ targetSdkVersion 16
+ }
+}
+
+
+apply plugin: 'maven'
+apply plugin: 'signing'
+
+signing {
+ sign configurations.archives
+}
+
+'git remote -v'.execute(null, new File(file('.').absolutePath)).getText().find('git@github.com:(.*?)/(.*?).git') {
+ match ->
+ user = match[1]
+ repo = match[2]
+}
+
+repoInfo = new groovy.json.JsonSlurper().parseText(new URL('https://api.github.com/repos/' + ext.user + '/' + ext.repo).getText())
+
+group = 'com.koushikdutta.' + repo.toLowerCase()
+android_manifest = new XmlParser(false, false).parseText(new File('AndroidManifest.xml').getText())
+version = android_manifest.'@android:versionName'
+
+uploadArchives {
+ repositories {
+ mavenDeployer {
+ beforeDeployment { MavenDeployment deployment -> signPom(deployment) }
+
+ repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
+ authentication(userName: sonatypeUsername, password: sonatypePassword)
+ }
+
+ pom.project {
+ name repo
+ packaging 'jar'
+ description repoInfo.description
+ url repoInfo.html_url
+
+ scm {
+ url repoInfo.git_url
+ connection repoInfo.git_url
+ developerConnection repoInfo.ssh_url
+ }
+
+ licenses {
+ license {
+ name 'The Apache Software License, Version 2.0'
+ url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+ distribution 'repo'
+ }
+ }
+
+ developers {
+ developer {
+ id user
+ name user
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file