diff --git a/build.gradle b/build.gradle index 95971647..6b42096f 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:0.7.+' + classpath 'com.android.tools.build:gradle:0.8.+' } } diff --git a/gradle.properties b/gradle.properties deleted file mode 100644 index 5d08ba75..00000000 --- a/gradle.properties +++ /dev/null @@ -1,18 +0,0 @@ -# Project-wide Gradle settings. - -# IDE (e.g. Android Studio) users: -# Settings specified in this file will override any Gradle settings -# configured through the IDE. - -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html - -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -# Default value: -Xmx10248m -XX:MaxPermSize=256m -# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 - -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true \ No newline at end of file diff --git a/library/build.gradle b/library/build.gradle index 247a3c83..0555ccd7 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -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:git@github.com:rockerhieu/emojicon.git' + connection 'scm:git@github.com:rockerhieu/emojicon.git' + developerConnection 'scm:git@github.com: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 } \ No newline at end of file