Skip to content

Commit

Permalink
add central maven config
Browse files Browse the repository at this point in the history
  • Loading branch information
maxme committed Feb 5, 2015
1 parent 94d1dbb commit e0d1927
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 11 deletions.
60 changes: 50 additions & 10 deletions WordPressUtils/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

buildscript {
repositories {
mavenCentral()
Expand All @@ -10,10 +9,10 @@ buildscript {

apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'signing'

repositories {
mavenCentral()
maven { url 'http://wordpress-mobile.github.io/WordPress-Android' }
}

dependencies {
Expand All @@ -29,23 +28,64 @@ android {
buildToolsVersion "21.1.1"

defaultConfig {
versionName "1.2.0"
versionName "1.3.0"
minSdkVersion 14
targetSdkVersion 19
}
}

signing {
required {
project.properties.containsKey("signing.keyId") && project.properties.containsKey("signing.secretKeyRingFile")
}
sign configurations.archives
}

version android.defaultConfig.versionName
group = "org.wordpress"
archivesBaseName = "utils"

// http://central.sonatype.org/pages/gradle.html

uploadArchives {
repositories {
mavenDeployer {
def repo_url = ""
if (project.hasProperty("repository")) {
repo_url = project.repository
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: project.properties.ossrhUsername, password: project.properties.ossrhPassword)
}

snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: project.properties.ossrhUsername, password: project.properties.ossrhPassword)
}

pom.project {
name 'PersistentEditText'
packaging 'aar'
description 'Android EditText subclass with persistence'
url 'https://github.com/wordpress-mobile/WordPress-Utils-Android'
scm {
connection 'scm:git:https://github.com/wordpress-mobile/WordPress-Utils-Android.git'
developerConnection 'scm:git:https://github.com/wordpress-mobile/WordPress-Utils-Android.git'
url 'https://github.com/wordpress-mobile/WordPress-Utils-Android'
}

licenses {
license {
name 'The MIT License (MIT)'
url 'http://opensource.org/licenses/MIT'
}
}

developers {
developer {
id 'maxme'
name 'Maxime Biais'
email 'maxime@automattic.com'
}
}
}
repository(url: repo_url)
pom.version = android.defaultConfig.versionName
pom.groupId = "org.wordpress"
pom.artifactId = "wordpress-utils"
}
}
}
7 changes: 6 additions & 1 deletion WordPressUtils/gradle.properties-example
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
repository=file:///Users/max/work/automattic/WordPress-Android-gh-pages/
ossrhUsername=hello
ossrhPassword=world

signing.keyId=byebye
signing.password=secret
signing.secretKeyRingFile=/home/user/secret.gpg

0 comments on commit e0d1927

Please sign in to comment.