-
Notifications
You must be signed in to change notification settings - Fork 818
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UPDATE] Prepare for release to Maven
- Loading branch information
1 parent
6129ae6
commit 5233df9
Showing
3 changed files
with
61 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
|
@@ -10,7 +11,7 @@ android { | |
minSdkVersion 8 | ||
targetSdkVersion 19 | ||
versionCode 1 | ||
versionName "$versionName" | ||
versionName emojiconVersionName | ||
} | ||
lintOptions { | ||
abortOnError false | ||
|
@@ -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 | ||
} |