This repository has been archived by the owner on Apr 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
236 lines (199 loc) · 6.76 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
/*
* This file was generated by the Gradle "init" task.
*
* This generated file contains a sample Kotlin library project to get you started.
*/
plugins {
// Apply the Kotlin JVM plugin to add support for Kotlin.
id "org.jetbrains.kotlin.jvm" version "$kotlinVersion"
id "org.jetbrains.kotlin.kapt" version "$kotlinVersion"
id "org.jetbrains.kotlin.plugin.allopen" version "$kotlinVersion"
id "org.jlleitschuh.gradle.ktlint" version "$ktlintVersion"
id "io.gitlab.arturbosch.detekt" version "1.11.0-RC1"
id "org.jetbrains.dokka" version "1.4.10.2"
id "com.jfrog.bintray" version "1.8.5"
// Apply the java-library plugin for API and implementation separation.
id "java-library"
id "maven-publish"
id "java"
}
group "no.studentmediene"
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
mavenCentral()
}
configurations {
detekt
// for dependencies that are needed for development only
developmentOnly
}
dependencies {
// Align versions of all Kotlin components
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
// Micronaut
kapt(platform("io.micronaut:micronaut-bom:$micronautVersion"))
kapt("io.micronaut:micronaut-inject-java")
kapt("io.micronaut:micronaut-validation")
kapt("io.micronaut.security:micronaut-security-annotations")
implementation(platform("io.micronaut:micronaut-bom:$micronautVersion"))
implementation("io.micronaut:micronaut-inject")
implementation("io.micronaut:micronaut-validation")
implementation("io.micronaut:micronaut-management")
implementation("io.micronaut.kotlin:micronaut-kotlin-runtime")
implementation("io.micronaut:micronaut-runtime:$micronautVersion")
implementation("javax.annotation:javax.annotation-api")
// Azure
implementation("com.azure:azure-storage-queue:$azureStorageQueueVersion")
// Logging
runtimeOnly("ch.qos.logback:logback-classic")
implementation("net.logstash.logback:logstash-logback-encoder:6.4")
// Jackson
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jacksonVersion")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:$jacksonVersion")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion")
// Test libraries
kaptTest(enforcedPlatform("io.micronaut:micronaut-bom:$micronautVersion"))
kaptTest("io.micronaut:micronaut-inject-java")
testImplementation(enforcedPlatform("io.micronaut:micronaut-bom:$micronautVersion"))
testImplementation("org.junit.jupiter:junit-jupiter-api")
testImplementation("io.micronaut.test:micronaut-test-junit5")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
testImplementation("io.mockk:mockk:$mockkVersion")
// Better assertion methods
testImplementation("io.strikt:strikt-core:$striktVersion")
testImplementation("org.testcontainers:testcontainers:$testContainersVersion")
testImplementation("org.testcontainers:localstack:$testContainersVersion")
testImplementation("org.testcontainers:junit-jupiter:$testContainersVersion")
}
test.classpath += configurations.developmentOnly
// use JUnit 5 platform
test {
useJUnitPlatform()
}
java {
sourceCompatibility = JavaVersion.toVersion('11')
}
allOpen {
annotation("io.micronaut.aop.Around")
}
compileKotlin {
kotlinOptions {
jvmTarget = '11'
//Will retain parameter names for Java reflection
javaParameters = true
languageVersion = "1.4"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = '11'
javaParameters = true
}
}
kapt {
arguments {
arg("micronaut.processing.incremental", true)
arg("micronaut.processing.annotations", "no.studentmediene.no.studentmediene.micronautazurequeue.*")
arg("micronaut.processing.group", "no.studentmediene.no.studentmediene.micronautazurequeue")
arg("micronaut.processing.module", "no.studentmediene.micronautazurequeue")
}
}
subprojects {
apply(plugin = "org.jlleitschuh.gradle.ktlint")
ktlint {
debug.set(true)
}
}
detekt {
toolVersion = "1.11.0"
config = files("detekt.yml")
parallel = false
debug = false
ignoreFailures = false
reports {
html {
enabled = true
destination = file("build/reports/detekt.html")
}
txt {
enabled = true
destination = file("build/reports/detekt.txt")
}
}
}
java {
withSourcesJar()
}
def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
developers {
}
scm {
url vcsUrl
}
}
publishing {
publications {
micronautStorareQueue(MavenPublication) {
from components.java
groupId group
artifactId rootProject.name
version version
pom.withXml {
def root = asNode()
root.appendNode('description', description)
root.appendNode('name', rootProject.name)
root.appendNode('url', vcsUrl)
root.children().last() + pomConfig
}
}
}
}
bintray {
user = project.findProperty("BINTRAY_USER") ?: System.getenv("BINTRAY_USER")
key = project.findProperty("BINTRAY_TOKEN") ?: System.getenv("BINTRAY_TOKEN")
publications = ['micronautStorareQueue']
dryRun = false
override = false
pkg {
repo = rootProject.name
name = "${rootProject.name}"
websiteUrl = vcsUrl
desc = description
userOrg = 'studentmediene'
licenses = ['Apache-2.0']
publicDownloadNumbers = false
labels = ["micronaut", "azure", "azurestoragequeue"]
vcsUrl = "${vcsUrl}.git"
githubRepo = "studentmediene/${rootProject.name}"
githubReleaseNotesFile = "README.md"
version {
name = project.version
vcsTag = version
desc = "Build ${version}"
released = new Date()
}
}
publish = true
}
tasks.withType(JavaExec) {
classpath += configurations.developmentOnly
jvmArgs('-XX:TieredStopAtLevel=1', '-Dcom.sun.management.jmxremote')
if (gradle.startParameter.continuous) {
systemProperties(
'micronaut.io.watch.restart':'true',
'micronaut.io.watch.enabled':'true',
"micronaut.io.watch.paths":"src/main"
)
}
}