OSDN Git Service

build.gradle
authorKoushik Dutta <koushd@gmail.com>
Thu, 30 May 2013 17:27:22 +0000 (10:27 -0700)
committerKoushik Dutta <koushd@gmail.com>
Thu, 30 May 2013 17:27:22 +0000 (10:27 -0700)
Change-Id: Ifb6363e847e41929f5fafcac9af0067b2637b493

Widgets/build.gradle [new file with mode: 0644]

diff --git a/Widgets/build.gradle b/Widgets/build.gradle
new file mode 100644 (file)
index 0000000..9bd30c1
--- /dev/null
@@ -0,0 +1,92 @@
+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