forked from kinecosystem/kin-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
106 lines (86 loc) · 3.4 KB
/
build.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
96
97
98
99
100
101
102
103
104
105
106
apply plugin: 'java-library'
apply plugin: 'kotlin'
apply plugin: 'maven-publish'
apply plugin: "signing"
enableJacoco(project, 'debug')
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation deps.kotlin_stdlib
api project(":design:viewmodel-tools")
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
task testDebugUnitTest(type: Test)
task testReleaseUnitTest(type: Test)
version = libraryVersion
group = groupId
afterEvaluate {
publishing {
publications {
normal(MavenPublication) {
artifact sourcesJar
artifact javadocJar
artifact jar
pom {
packaging 'jar'
name = 'base-viewmodel'
description = "Kin Android SDK View Model"
url = 'https://github.com/kinecosystem/kin-android/tree/master/base-viewmodel'
licenses {
license {
name = 'MIT License'
url = 'https://github.com/kinecosystem/kin-android/blob/master/LICENSE.md'
}
}
scm {
connection = 'scm:git:github.com/kinecosystem/kin-android.git'
developerConnection = 'scm:git:ssh://github.com/kinecosystem/kin-android.git'
url = 'https://github.com/kinecosystem/kin-android/tree/master/base-viewmodel'
}
developers {
developer {
id = 'kin-ci'
name = 'Kin CI'
email = '[email protected]'
}
}
withXml {
def root = asNode()
root.children().last() //+ pomConfig
def depsNode = root["dependencies"][0] ?: root.appendNode("dependencies")
def addDep = {
if (it.group == null) return // Avoid empty dependency nodes
def dependencyNode = depsNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
if (it.hasProperty('optional') && it.optional) {
dependencyNode.appendNode('optional', 'true')
}
dependencyNode.appendNode("scope", "runtime")
}
configurations.implementation.dependencies.each addDep
}
}
}
}
}
}
ext["signing.keyId"] = rootProject.ext["signing.keyId"]
ext["signing.password"] = rootProject.ext["signing.password"]
ext["signing.secretKeyRingFile"] = rootProject.ext["signing.secretKeyRingFile"]
signing {
sign publishing.publications
}