-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
205 lines (182 loc) · 5.98 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
import java.text.SimpleDateFormat
plugins {
id 'java'
id 'java-library'
id 'org.jetbrains.kotlin.jvm' version '1.4.0'
id("org.jetbrains.dokka") version "1.4.0"
id 'jacoco'
id 'maven-publish'
id "com.github.johnrengelman.shadow" version "6.0.0"
id 'net.nemerosa.versioning' version '2.8.2'
id "com.jfrog.bintray" version "1.8.5"
}
apply plugin: "com.jfrog.bintray"
def artifact_version = '0.1.13'
//mvn jira request https://issues.sonatype.org/browse/OSSRH-60165
group 'com.github.dave99galloway'
version artifact_version
def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
developers {
developer {
id "dave99galloway"
name "dave galloway"
email "dave99galloway@users.noreply.github.com"
}
}
scm {
url "https://github.com/dave99galloway/TypeSafeMapMap"
}
}
publishing {
publications {
mavenPublication(MavenPublication) {
from components.kotlin
// artifact sourcesJar
// artifact javadocJar
groupId 'com.github.dave99galloway.TypeSafeMapMap'
artifactId 'typesafemapmap'
version "$artifact_version"
pom.withXml {
def root = asNode()
root.appendNode('description', 'A type safe Map of Maps where the outer map items are stored by type of the values in the inner maps')
root.appendNode('name', 'TypeSafeMapMap (TSMM)')
root.appendNode('url', 'https://github.com/dave99galloway/TypeSafeMapMap')
root.children().last() + pomConfig
}
}
}
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/dave99galloway/TypeSafeMapMap"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
// maven {
// name = "OSSRH"
// url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
// credentials {
// username = System.getenv("MAVEN_USERNAME")
// password = System.getenv("MAVEN_PASSWORD")
// }
// }
afterEvaluate {
publications {
libJar(MavenPublication) {
from components["kotlin"]
artifact(tasks["sourcesJar"])
pom {
description.set("repro of https://github.com/clarkbw/github-registry-repro/blob/master/build.gradle")
}
}
}
}
}
}
sourceCompatibility = 1.8
repositories {
mavenCentral()
jcenter()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
// https://mvnrepository.com/artifact/org.apache.commons/commons-collections4
compile group: 'org.apache.commons', name: 'commons-collections4', version: '4.4'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile "org.assertj:assertj-core:3.11.1"
dokkaHtmlPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:1.4.0")
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
bintray {
user = System.getProperty('bintray.user')
key = System.getProperty('bintray.key')
publications = ['mavenPublication']
pkg {
repo = 'TSMM'
name = 'TypeSafeMapMap'
userOrg = 'dave99galloway'
licenses = ['Apache-2.0']
vcsUrl = 'git@github.com:dave99galloway/TypeSafeMapMap.git'
version {
name = "$artifact_version"
desc = "$artifact_version"
vcsTag = "$artifact_version"
released = new Date()
}
}
}
test {
useJUnit()
testLogging.showStandardStreams = true
maxHeapSize = '1G'
// listen to events in the test execution lifecycle
beforeTest { descriptor ->
logger.lifecycle("Running test: $descriptor")
}
// listen to standard out and standard error of the test JVM(s)
onOutput { descriptor, event ->
logger.lifecycle("Test: $descriptor produced standard out/err: $event.message")
}
finalizedBy jacocoTestReport
}
jar {
manifest {
attributes(
'Built-By': System.properties['user.name'],
'Build-Timestamp': new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()),
'Build-Revision': versioning.info.commit,
'Created-By': "Gradle ${gradle.gradleVersion}",
'Build-Jdk': "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
'Build-OS': "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}",
'artifact_version': artifact_version,
'manifest-customisation': 'http://andresalmiray.com/customize-jar-manifest-entries-with-maven-gradle/'
)
}
}
task sourcesJar(type: Jar, group: "build", dependsOn: classes) {
archiveClassifier.set("sources")
from(sourceSets.main.allSource)
}
javadoc {
source = sourceSets.main.allJava
classpath = configurations.compile
}
javadoc.failOnError = false
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
shadowJar {
baseName = 'TypeSafeMapMap-shadow'
classifier = ''
archiveVersion = '' // artifact_version
minimize()
exclude 'kotlin.stdlib'
exclude 'kotlin-runtime.jar'
dependencies {
exclude(dependency {
it.moduleGroup == 'org.jetbrains.kotlin'
})
}
}
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
}