-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpublish.gradle
More file actions
90 lines (82 loc) · 2.97 KB
/
Copy pathpublish.gradle
File metadata and controls
90 lines (82 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
allprojects {
apply plugin: 'maven-publish'
apply plugin: 'signing'
if (project == rootProject) {
apply plugin: 'io.github.gradle-nexus.publish-plugin'
}
}
subprojects {
if (!project.findProperty("ARTIFACT_VERSION")) {
return
}
apply plugin: 'com.android.library'
def targetProject = findProperty "target"
if ("${project.name}" == targetProject) {
nexusPublishing.repositories {
sonatype {
def profileId = findProperty('stagingProfileId')
stagingProfileId = profileId
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
android {
publishing {
singleVariant("release") {
withSourcesJar()
withJavadocJar()
}
}
}
def artifactVersion = ARTIFACT_VERSION
def projectURL = findProperty("url")
def groupID = findProperty("groupId")
group = groupID
version = artifactVersion
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
groupId = groupID
artifactId = "driver-$project.name"
version artifactVersion
if (project.plugins.findPlugin("com.android.library")) {
from components.release
} else {
artifact("$buildDir/outputs/aar/$project.name-release.aar")
}
pom {
name = "driver-$project.name"
description = "driver-$project.name"
url = projectURL
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = "luke.go"
name = "Luke Go"
email = "sangch.go@gmail.com"
}
}
scm {
url = projectURL
connection = "scm:${projectURL}.git"
developerConnection = "scm:${projectURL}.git"
}
}
}
}
signing {
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications
}
}
}
}