Skip to content
This repository has been archived by the owner on Mar 19, 2020. It is now read-only.

Commit

Permalink
Enabled maven release
Browse files Browse the repository at this point in the history
  • Loading branch information
frapontillo committed Feb 21, 2014
1 parent 1bbfa16 commit b21c06d
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 6 deletions.
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Wed Apr 10 15:27:10 PDT 2013
#Fri Feb 21 10:28:36 CET 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 4 additions & 3 deletions location-hub/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

apply plugin: 'android-library'
apply from: '../maven_push.gradle'

android {
compileSdkVersion rootProject.compileSdkVersion
Expand All @@ -23,8 +24,8 @@ android {
defaultConfig {
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
versionCode 1
versionName "1.0"
versionCode Integer.parseInt(VERSION_CODE)
versionName VERSION_NAME
}
release {
runProguard false
Expand All @@ -34,4 +35,4 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
}
}
26 changes: 26 additions & 0 deletions location-hub/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
VERSION_NAME=0.0.1-SNAPSHOT
VERSION_CODE=1

GROUP_ID=net.frakbot.android.location
POM_ARTIFACT_ID=location-hub
POM_NAME=net.frakbot.android.location

POM_PACKAGING=aar
POM_DESCRIPTION=Unified API for managing Android Location services.
POM_URL=https://github.com/frakbot/AndroidLocationHub

POM_SCM_URL=https://github.com/frakbot/AndroidLocationHub
POM_SCM_CONNECTION=scm:[email protected]:frakbot/AndroidLocationHub.git
POM_SCM_DEV_CONNECTION=scm:[email protected]:frakbot/AndroidLocationHub.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_DEVELOPER_1_ID=frapontillo
POM_DEVELOPER_1_NAME=Francesco Pontillo
POM_DEVELOPER_1_EMAIL[email protected]

POM_DEVELOPER_2_ID=rock3r
POM_DEVELOPER_2_NAME=Sebastiano Poggi
POM_DEVELOPER_2_EMAIL[email protected]
1 change: 0 additions & 1 deletion location-hub/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />

<application android:allowBackup="true"
android:label="@string/app_name"
Expand Down
101 changes: 101 additions & 0 deletions maven_push.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
apply plugin: 'maven'
apply plugin: 'signing'

def sonatypeRepositoryUrl

def isReleaseBuild() {
return VERSION_NAME.contains("SNAPSHOT") == false
}

if (isReleaseBuild()) {
println 'RELEASE BUILD'
sonatypeRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
} else {
println 'DEBUG BUILD'
sonatypeRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
}

afterEvaluate { project ->

configurations {
archives {
extendsFrom configurations.default
}
}

signing {
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}

uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

repository(url: 'file://' + new File(System.getProperty('user.home'), '.m2/repository').absolutePath)

/*repository(url: sonatypeRepositoryUrl) {
authentication(userName: nexusUsername, password: nexusPassword)
}*/

pom.project {
name POM_NAME
description POM_DESCRIPTION
artifactId = POM_ARTIFACT_ID
groupId GROUP_ID
version VERSION_NAME

packaging POM_PACKAGING
url POM_URL

scm {
url POM_SCM_URL
connection POM_SCM_CONNECTION
developerConnection POM_SCM_DEV_CONNECTION
}

licenses {
license {
name POM_LICENCE_NAME
url POM_LICENCE_URL
distribution POM_LICENCE_DIST
}
}

developers {
for(i in 1..2) {
developer {
id getProperty('POM_DEVELOPER_'+ i + '_ID')
name getProperty('POM_DEVELOPER_'+ i + '_NAME')
email getProperty('POM_DEVELOPER_'+ i + '_EMAIL')
}
}
}
}
}
}
}

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 androidSourcesJar
archives androidJavadocsJar
}
}
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
* limitations under the License.
*/

include ':location-hub', ':location-hub-demo', ':location-hub-gms'
include ':location-hub', ':location-hub-demo', ':location-hub-gms'

0 comments on commit b21c06d

Please sign in to comment.