Skip to content

Commit

Permalink
New Gradle configuration files
Browse files Browse the repository at this point in the history
  • Loading branch information
smarek committed Oct 12, 2013
1 parent 1929771 commit 8a6557a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION_NAME=1.4.4-SNAPSHOT
VERSION_CODE=2
VERSION_CODE=144
GROUP=com.loopj.android

POM_DESCRIPTION=An Asynchronous HTTP Library for Android
Expand All @@ -9,4 +9,4 @@ POM_SCM_CONNECTION=scm:[email protected]:loopj/android-async-http.git
POM_SCM_DEV_CONNECTION=scm:[email protected]:loopj/android-async-http.git
POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo
POM_LICENCE_DIST=repo
34 changes: 30 additions & 4 deletions maven_push.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
apply plugin: 'maven'
apply plugin: 'signing'

configurations {
archives {
extendsFrom configurations.default
}
}

def sonatypeRepositoryUrl
if (isReleaseBuild()) {
println 'RELEASE BUILD'
Expand All @@ -10,6 +16,24 @@ if (isReleaseBuild()) {
sonatypeRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
}

if (!signing.hasProperty('password')) {
if (System.console())
allprojects {
ext.set('signing.password', System.console().readPassword("\n\$ Type in GPG key password: "))
}
else
allprojects { ext.set('signing.password', 'dummy') }
}

if (!project.ext.hasProperty('nexusPassword')) {
if (System.console())
allprojects {
project.ext.set('nexusPassword', new String(System.console().readPassword("\n\$ Type in password for Sonatype nexus account ${nexusUsername}: ")))
}
else
allprojects { project.ext.set('nexusPassword', 'dummy') }
}

afterEvaluate { project ->
uploadArchives {
repositories {
Expand Down Expand Up @@ -62,25 +86,27 @@ afterEvaluate { project ->
sign configurations.archives
}

task androidReleaseJar(type: Jar) {
from "$buildDir/classes/release/"
}

task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.allJava
}

task androidJavadocsJar(type: Jar) {
classifier = 'javadoc'
//basename = artifact_id
from androidJavadocs.destinationDir
}

task androidSourcesJar(type: Jar) {
classifier = 'sources'
//basename = artifact_id
from android.sourceSets.main.allSource
}

artifacts {
//archives packageReleaseJar
archives androidReleaseJar
archives androidSourcesJar
archives androidJavadocsJar
}
}
}

0 comments on commit 8a6557a

Please sign in to comment.