This repository was archived by the owner on Apr 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
246 lines (202 loc) · 6.52 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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
buildscript {
ext.kotlin_version = '1.1.60'
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
maven { url "http://dl.bintray.com/jetbrains/spek" }
mavenCentral()
}
dependencies {
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:0.9.14'
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0-M4'
classpath 'com.benjaminsproule:swagger-gradle-plugin:0.1.8'
}
}
plugins {
id 'idea'
id 'java'
id 'com.github.johnrengelman.shadow' version '1.2.4'
id 'application'
id "org.jetbrains.kotlin.jvm" version "1.1.60"
id "io.gitlab.arturbosch.detekt" version "1.0.0.RC4-2"
id 'org.hidetake.swagger.generator' version '2.8.0'
}
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'kotlin'
apply plugin: 'org.junit.platform.gradle.plugin'
apply plugin: 'jacoco'
apply plugin: 'com.benjaminsproule.swagger'
swagger {
apiSource {
springmvc = false
locations = ['me.salt.utilities.rest']
basePath = '/api'
outputFormats = 'yaml'
info {
title = 'Students API'
description = 'The super heroic student API.'
version = '1.0'
contact {
email = 'someone@example-rest-api.com'
name = 'Lachezar Balev'
url = 'http://balev.eu'
}
license {
url = 'http://www.apache.org/licenses/LICENSE-2.0.html'
name = 'Apache 2.0'
}
}
securityDefinition {
name = 'Basic Authentication'
type = 'basic'
}
outputPath = "${project.rootDir}/generated/document.html"
swaggerDirectory = "${project.rootDir}/build/swagger-json"
swaggerApiReader = 'com.github.kongchen.swagger.docgen.reader.JaxrsReader'
}
}
swaggerSources {
SaltBot {
inputFile = file('build/swagger-json/swagger.yaml')
code {
language = 'java'
}
ui {
options.docExpansion = 'full'
}
}
}
detekt {
version = "1.0.0.RC4-2"
profile("main") {
input = "$projectDir/src/main/kotlin"
config = "$projectDir/detekt.yml"
filters = ".*test.*,.*/resources/.*,.*/tmp/.*"
}
}
junitPlatform {
reportsDir file("$buildDir/test-results/spek")
filters {
engines {
include 'spek'
}
}
enableStandardTestTask true
}
jacoco {
reportsDir = file("$buildDir/reports/jacoco")
toolVersion = "0.7.4+"
}
jacocoTestReport {
group = "Report"
//
reports {
html.enabled true
xml.enabled true
csv.enabled false
xml.destination = "${buildDir}/reports/spek"
html.destination = "${buildDir}/reports/jacoco"
}
//onlyIf = {
// true
//}
}
//applicationDefaultJvmArgs = ["-Xmx400m"]
// In this section you declare the dependencies for your production and test code
dependencies {
swaggerCodegen 'io.swagger:swagger-codegen-cli:2.2.3'
swaggerUI 'org.webjars:swagger-ui:2.2.10'
// The production code uses the SLF4J logging API at compile time
compile 'com.vdurmont:emoji-java:3.2.0'
compile 'net.dv8tion:JDA:3.3.1_291'
compile 'org.neo4j.driver:neo4j-java-driver:1.2.1'
compile 'org.neo4j:neo4j-ogm-core:2.1.2'
compile 'org.neo4j:neo4j-ogm-bolt-driver:2.1.2'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
compile "com.fasterxml.jackson.module:jackson-module-kotlin:2.9.0"
compile "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.9.0"
compile 'com.rollbar:rollbar-java:1.0.0-beta-2'
compile 'io.javalin:javalin:0.5.4'
compile 'io.swagger:swagger-core:1.5.9'
compile 'javax.ws.rs:javax.ws.rs-api:2.0.1'
compile 'com.github.kongchen:swagger-maven-plugin:3.1.5'
testCompile "org.jetbrains.spek:spek-api:1.1.2"
testCompile "org.jetbrains.spek:spek-junit-platform-engine:1.1.2"
testCompile "org.jetbrains.kotlin:kotlin-test"
testCompile "org.junit.platform:junit-platform-runner:1.0.0-M4"
testCompile "org.junit.jupiter:junit-jupiter-api:5.0.0-M4"
testRuntime "org.junit.jupiter:junit-jupiter-engine:5.0.0-M4"
testCompile "com.winterbe:expekt:0.5.0"
//compile 'org.junit.jupiter:junit-jupiter-api'
}
dokka {
outputFormat = 'html'
outputDirectory = "docs"
jdkVersion = 8
// includeNonPublic = true
linkMapping {
// Source directory
dir = "src/main/kotlin"
// URL showing where the source code can be accessed through the web browser
url = "https://github.com/DevJake/SaltBot-2.0/src/main/kotlin"
// Suffix which is used to append the line number to the URL. Use #L for GitHub
suffix = "#L"
}
linkMapping {
// Source directory
dir = "src/main/java"
// URL showing where the source code can be accessed through the web browser
url = "https://github.com/DevJake/SaltBot-2.0/src/main/java"
// Suffix which is used to append the line number to the URL. Use #L for GitHub
suffix = "#L"
}
}
sourceSets {
main.java.srcDirs = []
main.kotlin.srcDirs = ['src/main/java', 'src/main/kotlin']
main.resources.srcDirs = ['src/main/resources']
}
mainClassName = "me.salt.Main"
version = "1.0"
// In this section you declare where to find the dependencies of your project
repositories {
// Use 'jcenter' for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
mavenCentral()
}
test {
finalizedBy jacocoTestReport
}
compileJava.options.encoding = 'UTF-8'
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
detektFormat.dependsOn detektCheck
check.dependsOn detektFormat
configurations { codacy }
repositories {
maven { url "https://jitpack.io" }
maven { url "http://dl.bintray.com/typesafe/maven-releases" }
}
dependencies {
codacy 'com.github.codacy:codacy-coverage-reporter:-SNAPSHOT'
}
task sendCoverageToCodacy(type: JavaExec) {
main = "com.codacy.CodacyCoverageReporter"
classpath = configurations.codacy
args = [
"-l",
"Java",
"-r",
"${buildDir}/reports/test-results/junit-platform/TEST-spek.xml"
]
}