This repository was archived by the owner on Jan 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
145 lines (118 loc) · 3.65 KB
/
build.gradle
File metadata and controls
145 lines (118 loc) · 3.65 KB
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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.17"
}
}
plugins {
// Like --scan option to gradle; should be placed before any other plugins
id 'com.gradle.build-scan' version '2.1'
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.3.21'
// Gradle dependency update checker; run by "dependencyUpdates" task
id "com.github.ben-manes.versions" version "0.20.0"
// Release version with "gradle release"
id 'net.researchgate.release' version '2.6.0'
// Upload and release library to JFrog BinTray
id "com.jfrog.bintray" version "1.8.1"
}
apply plugin: "maven-publish"
apply plugin: "java-library"
apply plugin: 'org.jetbrains.dokka'
group 'de.debuglevel.sparkmicroserviceutils'
repositories {
jcenter()
}
dependencies {
// Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
// Tests
testCompile 'org.junit.jupiter:junit-jupiter-api:5.4.0'
testRuntime 'org.junit.jupiter:junit-jupiter-engine:5.4.0'
testCompile 'org.junit.jupiter:junit-jupiter-params:5.4.0'
testCompile 'org.assertj:assertj-core:3.12.0'
// Logging
// See http://saltnlight5.blogspot.com/2013/08/how-to-configure-slf4j-with-different.html for a quick introduction to slf4j
implementation 'io.github.microutils:kotlin-logging:1.6.25'
implementation 'org.slf4j:slf4j-api:1.7.25'
implementation 'org.slf4j:slf4j-simple:1.7.25'
// Configuration
implementation "com.natpryce:konfig:1.6.10.0"
// Spark (REST server)
implementation "com.sparkjava:spark-kotlin:1.0.0-alpha"
}
// Java configuration
java {
sourceCompatibility = JavaVersion.VERSION_1_8 // Source is Java 8 code
targetCompatibility = JavaVersion.VERSION_1_8 // Byte code will be JVM 8
}
// Kotlin configuration (implies compileKotlin and compileTestKotlin)
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8 // Byte code will be JVM 8
}
}
// Configuration of com.gradle.build-scan plugin
buildScan {
// Accept the license agreement for com.gradle.build-scan plugin
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
// Always publish scan (no more need for --scan option)
publishAlways()
}
// Configuration of net.researchgate.release plugin
release {
failOnCommitNeeded = false
failOnUnversionedFiles = false
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
reports {
html.enabled = true
}
}
dokka {
outputFormat = 'html'
outputDirectory = "$buildDir/javadoc"
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier 'sources'
}
task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
outputFormat = 'javadoc'
outputDirectory = javadoc.destinationDir
inputs.dir 'src/main/kotlin'
}
task javadocJar(type: Jar, dependsOn: dokkaJavadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
publishing {
publications {
javaMaven(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_API_KEY')
publications = ['javaMaven']
publish = true
override = true
pkg {
repo = 'maven'
name = 'sparkmicroserviceutils'
licenses = ['MIT']
vcsUrl = 'https://github.com/debuglevel/sparkmicroserviceutils.git'
}
}