-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
195 lines (171 loc) · 4.76 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
buildscript {
ext.kotlin_version = '1.2.21'
ext.dokka_version = '0.9.14'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.2'
classpath "org.jetbrains.dokka:dokka-gradle-plugin:${dokka_version}"
}
}
plugins {
id 'net.researchgate.release' version '2.6.0'
id "com.jfrog.bintray" version "1.7.3"
}
apply plugin: 'kotlin'
apply plugin: "jacoco"
apply plugin: 'org.junit.platform.gradle.plugin'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'org.jetbrains.dokka'
repositories {
mavenCentral()
jcenter()
}
group = 'org.dustinl.argparse4k'
description = 'The Kotlin command-line argument parser library'
def repoUrl = 'https://github.com/dustinliu/argparse4k'
def vcsUrl = 'https://github.com/dustinliu/argparse4k.git'
dependencies {
compile 'org.slf4j:slf4j-api:1.7.25'
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile 'net.sourceforge.argparse4j:argparse4j:0.8.1'
testCompile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
testCompile 'org.junit.jupiter:junit-jupiter-api:5.0.2'
testRuntime("org.junit.jupiter:junit-jupiter-engine:5.0.2")
testCompile 'org.mockito:mockito-inline:2.13.0'
testRuntime 'ch.qos.logback:logback-classic:1.2.3'
testRuntime 'org.codehaus.groovy:groovy-all:2.4.13'
testCompile 'org.mockito:mockito-inline:2.13.0'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
test {
jacoco {
append = false
destinationFile = file("$buildDir/jacoco/junitPlatformTest.exec")
}
}
junitPlatform {
platformVersion '1.0.2' // optional, defaults to plugin version
reportsDir file('build/test-results/junit-platform') // this is the default
selectors {
packages 'org.dustinl.argparse4k'
}
}
jacoco {
toolVersion = "0.8.0"
reportsDir = file("$buildDir/jacoco/")
applyTo junitPlatformTest
}
jacocoTestReport {
classDirectories = fileTree(
dir: '${buildDir}/classes',
excludes: [
'**/test/**/*.class'
]
)
reports {
xml.enabled true
xml.destination = file("${buildDir}/reports/jacoco/report.xml")
csv.enabled false
html.enabled true
html.destination = file("${buildDir}/reports/jacoco/html")
}
}
dokka {
outputFormat = 'javadoc'
outputDirectory = javadoc.destinationDir
}
task kdocJar(type: Jar, dependsOn: dokka) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
archives kdocJar
}
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_API_KEY')
publications = ['mavenRelease']
publish = true
override = false
pkg {
repo = 'maven'
name = project.name
desc = project.description
websiteUrl = repoUrl
issueTrackerUrl = '${repoUrl}/issues'
licenses = ['BSD 3-clause']
vcsUrl = vcsUrl
}
pkg.version {
name = version
gpg {
sign = true
}
mavenCentralSync {
sync = true
user = System.getenv('OSS_USER')
password = System.getenv('OSS_PW')
}
}
}
def pomConfig = {
licenses {
license {
name 'BSD 3-clause "New" or "Revised" License'
url 'https://github.com/dustinliu/argparse4k/blob/master/LICENSE'
distribution 'repo'
}
}
developers {
developer {
id 'dustinliu'
name 'Min Lun Liu'
email 'liu.minlun@gmail.com'
}
}
scm {
connection "scm:git:${vcsUrl}"
developerConnection "scm:git:${vcsUrl}"
url repoUrl
}
}
publishing {
publications {
mavenRelease(MavenPublication) {
from components.java
artifact sourcesJar
artifact kdocJar
pom.withXml {
def root = asNode()
root.appendNode('description', project.description)
root.appendNode('name', project.name)
root.appendNode('url', repoUrl)
root.children().last() + pomConfig
}
}
}
}
release {
failOnUnversionedFiles = false
failOnCommitNeeded = true
tagTemplate = '$name-$version'
newVersionCommitMessage = '[Gradle Release Plugin] [skip ci] bump version for next release :'
}
afterReleaseBuild.dependsOn bintrayUpload
install.dependsOn sourcesJar
install.dependsOn kdocJar
test.dependsOn junitPlatformTest