Skip to content

Commit e0d1927

Browse files
committed
add central maven config
1 parent 94d1dbb commit e0d1927

File tree

2 files changed

+56
-11
lines changed

2 files changed

+56
-11
lines changed

WordPressUtils/build.gradle

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
buildscript {
32
repositories {
43
mavenCentral()
@@ -10,10 +9,10 @@ buildscript {
109

1110
apply plugin: 'com.android.library'
1211
apply plugin: 'maven'
12+
apply plugin: 'signing'
1313

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

1918
dependencies {
@@ -29,23 +28,64 @@ android {
2928
buildToolsVersion "21.1.1"
3029

3130
defaultConfig {
32-
versionName "1.2.0"
31+
versionName "1.3.0"
3332
minSdkVersion 14
3433
targetSdkVersion 19
3534
}
3635
}
3736

37+
signing {
38+
required {
39+
project.properties.containsKey("signing.keyId") && project.properties.containsKey("signing.secretKeyRingFile")
40+
}
41+
sign configurations.archives
42+
}
43+
44+
version android.defaultConfig.versionName
45+
group = "org.wordpress"
46+
archivesBaseName = "utils"
47+
48+
// http://central.sonatype.org/pages/gradle.html
49+
3850
uploadArchives {
3951
repositories {
4052
mavenDeployer {
41-
def repo_url = ""
42-
if (project.hasProperty("repository")) {
43-
repo_url = project.repository
53+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
54+
55+
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
56+
authentication(userName: project.properties.ossrhUsername, password: project.properties.ossrhPassword)
57+
}
58+
59+
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
60+
authentication(userName: project.properties.ossrhUsername, password: project.properties.ossrhPassword)
61+
}
62+
63+
pom.project {
64+
name 'PersistentEditText'
65+
packaging 'aar'
66+
description 'Android EditText subclass with persistence'
67+
url 'https://github.com/wordpress-mobile/WordPress-Utils-Android'
68+
scm {
69+
connection 'scm:git:https://github.com/wordpress-mobile/WordPress-Utils-Android.git'
70+
developerConnection 'scm:git:https://github.com/wordpress-mobile/WordPress-Utils-Android.git'
71+
url 'https://github.com/wordpress-mobile/WordPress-Utils-Android'
72+
}
73+
74+
licenses {
75+
license {
76+
name 'The MIT License (MIT)'
77+
url 'http://opensource.org/licenses/MIT'
78+
}
79+
}
80+
81+
developers {
82+
developer {
83+
id 'maxme'
84+
name 'Maxime Biais'
85+
email 'maxime@automattic.com'
86+
}
87+
}
4488
}
45-
repository(url: repo_url)
46-
pom.version = android.defaultConfig.versionName
47-
pom.groupId = "org.wordpress"
48-
pom.artifactId = "wordpress-utils"
4989
}
5090
}
5191
}
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
repository=file:///Users/max/work/automattic/WordPress-Android-gh-pages/
1+
ossrhUsername=hello
2+
ossrhPassword=world
3+
4+
signing.keyId=byebye
5+
signing.password=secret
6+
signing.secretKeyRingFile=/home/user/secret.gpg

0 commit comments

Comments
 (0)