Skip to content

Commit 4edc93f

Browse files
committed
add signing to publish artifact
1 parent fc65662 commit 4edc93f

File tree

2 files changed

+76
-22
lines changed

2 files changed

+76
-22
lines changed

build.gradle

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +0,0 @@
1-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2-
3-
buildscript {
4-
repositories {
5-
jcenter()
6-
}
7-
dependencies {
8-
classpath 'com.android.tools.build:gradle:1.0.0-rc4'
9-
10-
// NOTE: Do not place your application dependencies here; they belong
11-
// in the individual module build.gradle files
12-
}
13-
}
14-
15-
allprojects {
16-
repositories {
17-
jcenter()
18-
}
19-
}

editor/build.gradle

Lines changed: 76 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
}
5+
dependencies {
6+
classpath 'com.android.tools.build:gradle:1.0.0'
7+
}
8+
}
9+
110
apply plugin: 'com.android.library'
11+
apply plugin: 'maven'
12+
apply plugin: 'signing'
13+
14+
repositories {
15+
mavenCentral()
16+
}
217

318
android {
19+
publishNonDefault true
20+
421
compileSdkVersion 21
5-
buildToolsVersion "21.1.2"
22+
buildToolsVersion "21.1.1"
623

724
defaultConfig {
8-
minSdkVersion 15
9-
targetSdkVersion 21
1025
versionCode 1
1126
versionName "1.0"
27+
minSdkVersion 9
28+
targetSdkVersion 21
1229
}
1330
buildTypes {
1431
release {
@@ -21,3 +38,59 @@ android {
2138
dependencies {
2239
compile 'com.android.support:appcompat-v7:21.0.3'
2340
}
41+
42+
signing {
43+
required {
44+
project.properties.containsKey("signing.keyId") && project.properties.containsKey("signing.secretKeyRingFile")
45+
}
46+
sign configurations.archives
47+
}
48+
49+
version android.defaultConfig.versionName
50+
group = "org.wordpress"
51+
archivesBaseName = "editor"
52+
53+
// http://central.sonatype.org/pages/gradle.html
54+
55+
uploadArchives {
56+
repositories {
57+
mavenDeployer {
58+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
59+
60+
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
61+
authentication(userName: project.properties.ossrhUsername, password: project.properties.ossrhPassword)
62+
}
63+
64+
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
65+
authentication(userName: project.properties.ossrhUsername, password: project.properties.ossrhPassword)
66+
}
67+
68+
pom.project {
69+
name 'WordPress-Android-Editor'
70+
packaging 'aar'
71+
description 'A reusable Android rich text editor component'
72+
url 'https://github.com/wordpress-mobile/WordPress-Android-Editor'
73+
scm {
74+
connection 'scm:git:https://github.com/wordpress-mobile/WordPress-Android-Editor.git'
75+
developerConnection 'scm:git:https://github.com/wordpress-mobile/WordPress-Android-Editor.git'
76+
url 'https://github.com/wordpress-mobile/WordPress-Android-Editor'
77+
}
78+
79+
licenses {
80+
license {
81+
name 'The MIT License (MIT)'
82+
url 'http://opensource.org/licenses/MIT'
83+
}
84+
}
85+
86+
developers {
87+
developer {
88+
id 'maxme'
89+
name 'Maxime Biais'
90+
email 'maxime@automattic.com'
91+
}
92+
}
93+
}
94+
}
95+
}
96+
}

0 commit comments

Comments
 (0)