Skip to content

Commit

Permalink
[UPDATE] Prepare for release to Maven
Browse files Browse the repository at this point in the history
  • Loading branch information
rockerhieu committed Feb 2, 2014
1 parent 6129ae6 commit 5233df9
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 22 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.7.+'
classpath 'com.android.tools.build:gradle:0.8.+'
}
}

Expand Down
18 changes: 0 additions & 18 deletions gradle.properties

This file was deleted.

63 changes: 60 additions & 3 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
apply plugin: 'android-library'
apply plugin: 'maven'
apply plugin: 'signing'

versionName = "1.0"
ext.emojiconVersionName = "1.0"
android {
compileSdkVersion 19
buildToolsVersion "19.0.1"
Expand All @@ -10,7 +11,7 @@ android {
minSdkVersion 8
targetSdkVersion 19
versionCode 1
versionName "$versionName"
versionName emojiconVersionName
}
lintOptions {
abortOnError false
Expand All @@ -22,12 +23,68 @@ dependencies {
}

group = 'com.rockerhieu.emojicon'
version = "$versionName"
version = emojiconVersionName
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")

uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "file://$buildDir/aar")
}

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

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}

snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}

pom.project {
artifactId = 'library'
name = 'Emojicon'
description 'A library to show emoji in TextView, EditText (like WhatsApp) for Android'
url 'http://rockerhieu.com/emojicon'

scm {
url 'scm:[email protected]:rockerhieu/emojicon.git'
connection 'scm:[email protected]:rockerhieu/emojicon.git'
developerConnection 'scm:[email protected]:rockerhieu/emojicon.git'
}

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 'rockerhieu'
name 'Hieu Rocker'
}
}
}
}
}
}

task sourcesJar(type: Jar) {
from android.sourceSets.main.allJava
classifier = 'sources'
}

artifacts {
archives sourcesJar
}

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

0 comments on commit 5233df9

Please sign in to comment.