-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
201 lines (166 loc) · 5.18 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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.18"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detekt_version"
}
}
plugins {
id 'kotlin'
id 'maven-publish'
}
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'io.gitlab.arturbosch.detekt'
repositories {
jcenter()
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
test {
useJUnitPlatform()
}
sourceSets {
integrationTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/kotlin')
}
resources.srcDir file('src/integration-test/resources')
}
}
configurations {
integrationTestRuntimeOnly.extendsFrom testRuntimeOnly
integrationTestImplementation.extendsFrom testImplementation
}
detekt {
toolVersion = detekt_version
input = files("src/main/kotlin", "src/test/kotlin", "src/integration-test/kotlin")
filters = ".*/resources/.*,.*/build/.*"
config = files("$rootDir/detekt-config.yml")
}
tasks["detekt"].dependsOn(":custom-detekt-rules:assemble")
dokka {
moduleName = 'core'
outputFormat = 'html'
outputDirectory = "$buildDir/kdoc"
includes = ['packages.md']
jdkVersion = 8
linkMapping {
dir = "src/main/kotlin"
url = "https://github.com/acmerobotics/motion-planner/blob/master/core/src/main/kotlin"
suffix = "#L"
}
}
task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
outputFormat = 'javadoc'
outputDirectory = "$buildDir/javadoc"
}
dokka.dependsOn dokkaJavadoc
shadowJar {
baseName = 'road-runner-core'
destinationDir = buildDir
classifier = null
version = road_runner_version
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation "org.apache.commons:commons-math3:3.6.1"
implementation "com.fasterxml.jackson.core:jackson-databind:2.9.6"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.9.6"
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.9.6"
testImplementation "org.junit.jupiter:junit-jupiter-api:5.2.0"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.2.0"
testImplementation "org.assertj:assertj-core:3.11.1"
testImplementation "org.knowm.xchart:xchart:3.5.2"
integrationTestImplementation "org.junit.jupiter:junit-jupiter-api:5.2.0"
integrationTestRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.2.0"
integrationTestImplementation "org.assertj:assertj-core:3.11.1"
integrationTestImplementation "org.knowm.xchart:xchart:3.5.2"
detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:$detekt_version"
detektPlugins "io.gitlab.arturbosch.detekt:detekt-cli:$detekt_version"
detektPlugins project(':custom-detekt-rules')
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task dokkaJar(type: Jar) {
from dokka
classifier = 'javadoc'
}
def pomConfig = {
licenses {
license {
name "The MIT License"
url "https://opensource.org/licenses/MIT"
distribution "repo"
}
}
developers {
developer {
id "rbrott"
name "Ryan Brott"
email "[email protected]"
}
}
scm {
url "https://github.com/acmerobotics/road-runner"
}
}
publishing {
publications {
maven(MavenPublication) {
from components.java
artifact sourcesJar
artifact dokkaJar
groupId = 'com.acmerobotics.roadrunner'
artifactId = 'core'
version road_runner_version
pom.withXml {
def root = asNode()
root.appendNode('description', '2D mobile robot motion planning library written in Kotlin')
root.appendNode('name', 'Road Runner')
root.appendNode('url', 'https://github.com/acmerobotics/road-runner')
root.children().last() + pomConfig
}
}
}
}
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
publish = true
pkg {
repo = 'maven'
name = 'road-runner'
userOrg = 'acmerobotics'
licenses = ['MIT']
vcsUrl = 'https://github.com/acmerobotics/road-runner.git'
version {
name = road_runner_version
released = new Date()
}
publications = ['maven']
}
}
task integrationTest(type: Test) {
useJUnitPlatform()
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
outputs.upToDateWhen { false }
}
tasks["clean"].doFirst {
delete file("graphs")
delete file("csv")
}