forked from holgerbrandl/krangl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
180 lines (134 loc) · 4.9 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
buildscript {
ext.kotlin_version = '1.4.21'
ext.dokka_version = '0.10.0' // see https://github.com/Kotlin/dokka/issues/656
repositories {
maven { url 'https://dl.bintray.com/kotlin/dokka' }
mavenCentral()
}
dependencies {
classpath "org.jetbrains.dokka:dokka-gradle-plugin:${dokka_version}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins { id "com.jfrog.bintray" version "1.8.1" }
apply plugin: 'kotlin'
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'application'
//apply plugin: 'maven'
apply plugin: 'maven-publish'
// not neeeded but does not work without
mainClassName = "foo.Bar" // not needed but does not work without
repositories {
mavenCentral()
// mavenLocal()
jcenter()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib"
implementation "org.jetbrains.kotlin:kotlin-reflect"
// compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
// needed to work around https://youtrack.jetbrains.com/issue/KT-15064
compileOnly "org.jetbrains.kotlin:kotlin-script-runtime:$kotlin_version"
// testCompile "org.jetbrains.kotlin:kotlin-script-runtime:$kotlin_version"
api "org.apache.commons:commons-csv:1.6" // cant upgrade to 1.8 because of https://issues.apache.org/jira/browse/CSV-257
// compile "com.univocity:univocity-parsers:2.7.5"
api 'org.apache.poi:poi-ooxml:4.1.1' // For Excel read/write
api 'com.beust:klaxon:5.0.1'// compile 'me.tongfei:progressbar:0.5.5'
testImplementation group: 'junit', name: 'junit', version: '4.12'
testImplementation("io.kotest:kotest-assertions-core:4.2.6")
testImplementation 'com.h2database:h2:1.4.200'
testImplementation "org.jetbrains.kotlin:kotlin-script-runtime:1.4.21"
// testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.9"
}
// disabled because would require to inherit StringSpec in all test classes
//test {
// useJUnitPlatform()
//}
test {
// Tests would fail with default memory settings
// See https://stackoverflow.com/questions/20490105/gradleworkermain-outofmemoryerror
maxHeapSize = "2048m"
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
}
}
//Minimal dokka configuration:
dokka {
outputFormat = 'html'
// outputDirectory = "$buildDir/javadoc"
outputDirectory = "$projectDir/javadoc"
configuration {
// sourceDirs = files('src/test/kotlin')
samples = ['src/test/kotlin/krangl/samples']
// Emit warnings about not documented members. Applies globally, also can be overridden by packageOptions
reportUndocumented = false
// http://kotlinlang.org/docs/reference/kotlin-doc.html#module-and-package-documentation
includes = ['docs/packages_info.md']
}
}
// http://stackoverflow.com/questions/11474729/how-to-build-sources-jar-with-gradle
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
//task javadocJar(type: Jar, dependsOn: javadoc) {
// classifier = 'javadoc'
// from javadoc.destinationDir
//}
// see https://github.com/Kotlin/dokka/issues/42
task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
outputFormat = 'javadoc'
outputDirectory = javadoc.destinationDir
configuration {
reportUndocumented = false
samples = ['src/test/kotlin/krangl/samples']
}
inputs.dir 'src/main/kotlin'
}
task javadocJar(type: Jar, dependsOn: dokkaJavadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
//http://stackoverflow.com/questions/34377367/why-is-gradle-install-replacing-my-version-with-unspecified
group 'de.mpicbg.scicomp'
//version '0.16-SNAPSHOT'
version '0.15'
artifacts {
archives sourcesJar
archives javadocJar
}
publishing {
publications {
maven(MavenPublication) {
from components.java
artifact sourcesJar { classifier "sources" }
artifact javadocJar
}
}
}
if (hasProperty('bintray_user') && hasProperty('bintray_key')) {
bintray {
// property must be set in ~/.gradle/gradle.properties
user = bintray_user
key = bintray_key
publications = ['maven'] //When uploading configuration files
dryRun = false //Whether to run this as dry-run, without deploying
publish = true // If version should be auto published after an upload
pkg {
repo = 'mpicbg-scicomp'
name = 'krangl'
vcsUrl = 'https://github.com/holgerbrandl/krangl'
licenses = ['MIT']
publicDownloadNumbers = true
//Optional version descriptor
version {
name = project.version //Bintray logical version name
desc = '.'
released = new Date()
vcsTag = 'v' + project.version
}
}
}
}