This repository has been archived by the owner on Nov 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 59
/
kotlinLib.gradle
91 lines (81 loc) · 2.9 KB
/
kotlinLib.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
apply plugin: 'kotlin'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply from: "${project.rootDir}/version.gradle"
afterEvaluate {
publishing {
publications {
lib(MavenPublication) {
version = project.version
groupId parent.ext.groupId
artifactId project.getName()
from components.java
afterEvaluate {
artifact sourcesJar
artifact javadocJar
pom {
name = project.getName()
description = "${name} Android extensions"
url = 'https://github.com/tunjid/Android-Extensions'
licenses {
license {
name = 'MIT License'
url = 'https://github.com/tunjid/tunjid/Android-Extensions/develop/license.txt'
}
}
developers {
developer {
id = 'tunjid'
name = 'Adetunji Dahunsi'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:github.com/tunjid/Android-Extensions.git'
developerConnection = 'scm:git:ssh://github.com/tunjid/Android-Extensions.git'
url = 'https://github.com/tunjid/Android-Extensions/tree/main'
}
}
}
}
}
repositories {
parent.ext.publishRepositories.each { repo ->
def props = (repo as ConfigObject).toProperties()
maven {
name = props['name']
url = props['publishUrl']
credentials {
username = props['credentials.username']
password = props['credentials.password']
}
}
}
}
}
signing {
if (parent.ext.publishInfo['signArtifacts']) {
def signingKey = parent.ext.publishInfo['signingKey']
def signingPassword = parent.ext.publishInfo['signingPassword']
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications
}
}
}
// Gradle task to generate sources after building a release aar
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allJava
}
task javadocJar(type: Jar) {
archiveClassifier = 'javadoc'
from javadoc
}
//signing {
// sign publishing.publications.mavenJava
//}
javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}