-
Notifications
You must be signed in to change notification settings - Fork 75
/
publishing.gradle
95 lines (81 loc) · 2.76 KB
/
publishing.gradle
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
91
92
93
94
95
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'org.jetbrains.dokka'
task androidSourcesJar(type: Jar) {
archiveClassifier.set('sources')
if (project.plugins.findPlugin("com.android.library")) {
// For Android libraries
from android.sourceSets.main.java.srcDirs
from android.sourceSets.main.kotlin.srcDirs
} else {
from sourceSets.main.java.srcDirs
from sourceSets.main.kotlin.srcDirs
}
}
task javadocJar(type: Jar, dependsOn: dokkaJavadoc) {
archiveClassifier.set('javadoc')
from dokkaJavadoc.outputDirectory
}
artifacts {
archives androidSourcesJar
archives javadocJar
}
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
groupId project.ext.group
artifactId ARTIFACT_ID
version PUBLISH_VERSION
if (project.plugins.findPlugin("com.android.library")) {
from components.release
} else {
from components.java
}
artifact androidSourcesJar
artifact javadocJar
// metadata
pom {
name = ARTIFACT_ID
description = 'SDK'
url = project.ext.url
licenses {
license {
name = 'MapMe License'
url = 'https://github.com/sabintrademe/MapMe/blob/master/LICENSE'
}
}
developers {
developer {
id = 'sabinmj'
name = 'Sabin Mulakukodiyan'
email = 'sabin.mulakukodiyan@trademe.co.nz'
}
// Add all other devs here...
}
// Version control info - if you're using GitHub, follow the
// format as seen here
scm {
connection = project.ext.connection
developerConnection = project.ext.developerConnection
url = project.ext.url
}
}
}
}
}
}
signing {
if (rootProject.ext["signing.keyId"] && rootProject.ext["signing.key"] && rootProject.ext["signing.password"]) {
useInMemoryPgpKeys(
rootProject.ext["signing.keyId"],
rootProject.ext["signing.key"],
rootProject.ext["signing.password"],
)
sign publishing.publications
}
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}