forked from holgerbrandl/krangl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
162 lines (119 loc) · 4.24 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
buildscript {
ext.kotlin_version = '1.2.70'
ext.dokka_version = '0.9.17'
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.2" }
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 {
compile "org.jetbrains.kotlin:kotlin-stdlib"
compile "org.jetbrains.kotlin:kotlin-reflect"
// compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
compile "org.apache.commons:commons-csv:1.3"
// compile "com.univocity:univocity-parsers:2.7.5"
compile 'com.beust:klaxon:0.30'
// compile 'me.tongfei:progressbar:0.5.5'
testCompile group: 'junit', name: 'junit', version: '4.12'
// testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.9"
testCompile 'io.kotlintest:kotlintest-assertions:3.1.6'
testCompile 'de.mpicbg.scicomp:kutils:0.11'
// 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"
}
// disabled because would require to inherit StringSpec in all test classes
//test {
// useJUnitPlatform()
//}
//Minimal dokka configuration:
dokka {
outputFormat = 'html'
// outputDirectory = "$buildDir/javadoc"
outputDirectory = "$projectDir/javadoc"
// 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
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.10.3'
//version '0.11-SNAPSHOT'
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
}
}
}
}