-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.gradle
168 lines (140 loc) · 5.34 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
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
// classpath group: 'org.jetbrains.kotlin', name: 'kotlin-gradle-plugin', version: version_kotlin
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$version_dokka"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.12.0"
}
}
plugins {
id "org.jetbrains.kotlin.jvm" version "1.3.72" apply false
id 'nebula.maven-resolved-dependencies' version '9.2.0' apply false
}
apply from: "$rootDir/project-settings.gradle"
apply from: "$rootDir/gradle/sonatype-top.gradle"
subprojects {
apply from: "$rootDir/gradle/kotlin-settings.gradle"
apply from: "$rootDir/gradle/idea.gradle"
apply plugin: 'nebula.maven-resolved-dependencies'
apply from: "$rootDir/gradle/sonatype-subproj.gradle"
apply from: "$rootDir/gradle/bintray.gradle"
repositories {
// maven { url "https://dl.bintray.com/kodein-framework/Kodein-DI/" }
jcenter()
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$version_kotlin"
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$version_kotlin"
testCompile "junit:junit:$version_junit"
testCompile "org.jetbrains.kotlin:kotlin-test:$version_kotlin"
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$version_kotlin"
// testCompile "org.slf4j:slf4j-api:$version_slf4j"
// testCompile "org.jetbrains.kotlin:kotlin-reflect:$version_kotlin"
// testRuntime "ch.qos.logback:logback-classic:$version_logback"
}
//noinspection GroovyAssignabilityCheck
configurations.all {
// kill all logging anything else might bring in, all of our projects use slf4j if any
exclude group: "org.slf4j", module: "slf4j-simple"
exclude group: "commons-logging"
exclude group: "log4j"
exclude group: "com.google.code.findbugs"
exclude group: "org.slf4j", module: "slf4j-log4j12"
resolutionStrategy {
cacheDynamicVersionsFor 12, 'hours' // things with wildcard version numbers
cacheChangingModulesFor 0, 'hours'
// things with same version, but content of module changes, i.e. SNAPSHOT
}
}
}
subprojects { subproj ->
def pomOnlyModule = !(new File("${projectDir.toString()}/src/main/kotlin").exists())
if (pomOnlyModule) {
println("Project $name is POM ONLY (has no code of its own)")
task jars() {
dependsOn build
}
artifacts {}
} else {
apply plugin: 'org.jetbrains.dokka'
def dirname = subproj.projectDir.absoluteFile.name
def moduleName = subproj.name
def dokkaOutputBase = "${rootDir}/docs"
def dokkaLinkDir = "${projectDir}/src/main/kotlin"
def dokkaLinkUrl = "https://github.com/kohesive/klutter/blob/master/${dirname}/src/main/kotlin"
def dokkaLinkSuffix = "#L"
def dokkaIncludes = [ "${projectDir}/README.md" ]
// our form of JavaDoc for JARs in Maven (from Java perspective, not good docs for Kotlin)
dokka {
outputFormat = "javadoc"
outputDirectory = "${buildDir}/javadoc"
configuration {
sourceLink {
path = dokkaLinkDir
url = dokkaLinkUrl
lineSuffix = dokkaLinkSuffix
}
}
}
// output to docs directory: HTML format
task dokkaHtml(type: org.jetbrains.dokka.gradle.DokkaTask) {
outputFormat = "html"
outputDirectory = "${dokkaOutputBase}/${outputFormat}/${moduleName}"
configuration {
sourceLink {
path = dokkaLinkDir
url = dokkaLinkUrl
lineSuffix = dokkaLinkSuffix
}
}
}
// output to docs directory: Markdown format
task dokkaMarkdown(type: org.jetbrains.dokka.gradle.DokkaTask) {
outputFormat = "markdown"
outputDirectory = "${dokkaOutputBase}/${outputFormat}/${moduleName}"
// includes = dokkaIncludes
configuration {
sourceLink {
path = dokkaLinkDir
url = dokkaLinkUrl
lineSuffix = dokkaLinkSuffix
}
}
}
// output to docs directory: Javadoc format
task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
outputFormat = "javadoc"
outputDirectory = "${dokkaOutputBase}/${outputFormat}/${moduleName}"
configuration {
sourceLink {
path = dokkaLinkDir
url = dokkaLinkUrl
lineSuffix = dokkaLinkSuffix
}
}
}
task dokkaAll() {
// dependsOn dokkaHtml
dependsOn dokkaMarkdown
// dependsOn dokkaJavadoc
}
task jars() {
dependsOn build
dependsOn javadoc
dependsOn dokkaAll
}
javadoc.dependsOn(dokka)
}
}
task wrapper(type: Wrapper) {
gradleVersion = "$version_gradle"
}
task jars() {
dependsOn subprojects.jars
}
defaultTasks 'clean', 'build', 'check'