Skip to content

Commit 759fa10

Browse files
committed
Gradle use Kotlin DSL
1 parent c0ac3f1 commit 759fa10

File tree

15 files changed

+274
-286
lines changed

15 files changed

+274
-286
lines changed

common-api/build.gradle

Lines changed: 0 additions & 28 deletions
This file was deleted.

common-api/build.gradle.kts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
plugins {
2+
`java-library`
3+
id("io.freefair.lombok") version "9.1.0"
4+
}
5+
6+
group = "bitxon.common"
7+
version = "1.0-SNAPSHOT"
8+
9+
java {
10+
toolchain {
11+
languageVersion.set(JavaLanguageVersion.of(21))
12+
}
13+
}
14+
15+
repositories {
16+
mavenCentral()
17+
}
18+
19+
dependencies {
20+
implementation("jakarta.validation:jakarta.validation-api:3.0.2")
21+
}

common-wiremock/build.gradle

Lines changed: 0 additions & 11 deletions
This file was deleted.

common-wiremock/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
plugins {
2+
`java-library`
3+
}
4+
5+
group = "bitxon.common"
6+
version = "1.0-SNAPSHOT"

dropwizard-app/build.gradle

Lines changed: 0 additions & 74 deletions
This file was deleted.

dropwizard-app/build.gradle.kts

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
plugins {
2+
java
3+
application
4+
id("com.gradleup.shadow") version "9.2.1"
5+
}
6+
7+
group = "bitxon.dropwizard"
8+
version = "1.0-SNAPSHOT"
9+
10+
java {
11+
toolchain {
12+
languageVersion.set(JavaLanguageVersion.of(21))
13+
}
14+
}
15+
16+
repositories {
17+
mavenCentral()
18+
}
19+
20+
dependencies {
21+
implementation(project(":common-api"))
22+
implementation(enforcedPlatform("io.dropwizard:dropwizard-bom:5.0.0"))
23+
implementation("io.dropwizard:dropwizard-core")
24+
implementation("io.dropwizard:dropwizard-client")
25+
implementation("io.dropwizard:dropwizard-validation")
26+
implementation("io.dropwizard:dropwizard-hibernate")
27+
implementation("org.mapstruct:mapstruct:1.6.3")
28+
29+
annotationProcessor("org.projectlombok:lombok:1.18.42")
30+
annotationProcessor("org.mapstruct:mapstruct-processor:1.6.3")
31+
32+
compileOnly("org.projectlombok:lombok:1.18.42")
33+
34+
runtimeOnly("org.postgresql:postgresql:42.7.8")
35+
36+
testImplementation("io.dropwizard:dropwizard-testing")
37+
testImplementation(project(":common-wiremock"))
38+
testImplementation(platform("org.testcontainers:testcontainers-bom:2.0.2"))
39+
testImplementation("org.wiremock:wiremock:3.13.2")
40+
testImplementation("org.testcontainers:testcontainers")
41+
testImplementation("org.testcontainers:testcontainers-junit-jupiter")
42+
testImplementation("org.testcontainers:testcontainers-postgresql")
43+
testImplementation("org.assertj:assertj-core:3.27.6")
44+
testImplementation("io.rest-assured:rest-assured:5.5.6")
45+
testImplementation("org.junit.jupiter:junit-jupiter")
46+
testImplementation("org.junit.jupiter:junit-jupiter-params")
47+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
48+
}
49+
50+
tasks.test {
51+
useJUnitPlatform()
52+
}
53+
54+
application {
55+
mainClass.set("bitxon.dropwizard.DropwizardApplication")
56+
}
57+
58+
tasks.jar {
59+
manifest {
60+
attributes(
61+
"Main-Class" to application.mainClass.get(),
62+
"Build-Jdk-Spec" to java.sourceCompatibility,
63+
"Class-Path" to sourceSets.main.get().runtimeClasspath.files.joinToString(" ") { it.name }
64+
)
65+
}
66+
}
67+
68+
tasks.shadowJar {
69+
mergeServiceFiles()
70+
exclude("META-INF/*.DSA", "META-INF/*.RSA", "META-INF/*.SF")
71+
}
72+
73+
tasks.named<JavaExec>("run") {
74+
args = listOf("server", "classpath:config.yml")
75+
}

loadtest/build.gradle

Lines changed: 0 additions & 24 deletions
This file was deleted.

loadtest/build.gradle.kts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
plugins {
2+
java
3+
id("io.gatling.gradle") version "3.14.9"
4+
}
5+
6+
group = "bitxon"
7+
version = "1.0-SNAPSHOT"
8+
9+
java {
10+
toolchain {
11+
languageVersion.set(JavaLanguageVersion.of(21))
12+
}
13+
}
14+
15+
repositories {
16+
mavenCentral()
17+
}
18+
19+
gatling {
20+
enterprise.closureOf<Any> {
21+
// Enterprise Cloud (https://cloud.gatling.io/) configuration reference: https://gatling.io/docs/gatling/reference/current/extensions/gradle_plugin/#working-with-gatling-enterprise-cloud
22+
// Enterprise Self-Hosted configuration reference: https://gatling.io/docs/gatling/reference/current/extensions/gradle_plugin/#working-with-gatling-enterprise-self-hosted
23+
}
24+
}
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ plugins {
55
id("io.micronaut.aot") version "4.6.1"
66
}
77

8-
group = 'bitxon.micronaut'
9-
version = '1.0-SNAPSHOT'
8+
group = "bitxon.micronaut"
9+
version = "1.0-SNAPSHOT"
1010

1111
java {
1212
toolchain {
13-
languageVersion = JavaLanguageVersion.of(21)
13+
languageVersion.set(JavaLanguageVersion.of(21))
1414
}
1515
}
1616

@@ -19,7 +19,7 @@ repositories {
1919
}
2020

2121
dependencies {
22-
implementation project(":common-api")
22+
implementation(project(":common-api"))
2323
annotationProcessor("org.projectlombok:lombok")
2424
annotationProcessor("org.mapstruct:mapstruct-processor:1.5.3.Final")
2525
annotationProcessor("io.micronaut.data:micronaut-data-processor")
@@ -44,20 +44,21 @@ dependencies {
4444
testImplementation("org.testcontainers:junit-jupiter")
4545
testImplementation("org.testcontainers:postgresql")
4646
testImplementation("org.testcontainers:testcontainers")
47-
testImplementation project(":common-wiremock")
47+
testImplementation(project(":common-wiremock"))
4848
testImplementation("org.wiremock:wiremock:3.13.2")
49-
testImplementation 'org.eclipse.jetty:jetty-servlet:11.0.26' // wiremock dependency conflict workaround
50-
testImplementation 'org.eclipse.jetty:jetty-servlets:11.0.26' // wiremock dependency conflict workaround
51-
testImplementation 'org.eclipse.jetty:jetty-webapp:11.0.26' // wiremock dependency conflict workaround
52-
testImplementation 'org.eclipse.jetty.http2:http2-server:11.0.26' // wiremock dependency conflict workaround
49+
testImplementation("org.eclipse.jetty:jetty-servlet:11.0.26") // wiremock dependency conflict workaround
50+
testImplementation("org.eclipse.jetty:jetty-servlets:11.0.26") // wiremock dependency conflict workaround
51+
testImplementation("org.eclipse.jetty:jetty-webapp:11.0.26") // wiremock dependency conflict workaround
52+
testImplementation("org.eclipse.jetty.http2:http2-server:11.0.26") // wiremock dependency conflict workaround
5353
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
5454
}
5555

5656
application {
5757
mainClass.set("bitxon.micronaut.MicronautApplication")
5858
}
5959

60-
graalvmNative.toolchainDetection = false
60+
graalvmNative.toolchainDetection.set(false)
61+
6162
micronaut {
6263
version("4.10.3")
6364
runtime("netty")
@@ -69,18 +70,17 @@ micronaut {
6970
aot {
7071
// Please review carefully the optimizations enabled below
7172
// Check https://micronaut-projects.github.io/micronaut-aot/latest/guide/ for more details
72-
optimizeServiceLoading = false
73-
convertYamlToJava = false
74-
precomputeOperations = true
75-
cacheEnvironment = true
76-
optimizeClassLoading = true
77-
deduceEnvironment = true
78-
optimizeNetty = true
79-
replaceLogbackXml = true
73+
optimizeServiceLoading.set(false)
74+
convertYamlToJava.set(false)
75+
precomputeOperations.set(true)
76+
cacheEnvironment.set(true)
77+
optimizeClassLoading.set(true)
78+
deduceEnvironment.set(true)
79+
optimizeNetty.set(true)
80+
replaceLogbackXml.set(true)
8081
}
8182
}
8283

83-
tasks.named("dockerfileNative") {
84+
tasks.named<io.micronaut.gradle.docker.NativeImageDockerfile>("dockerfileNative") {
8485
jdkVersion = "21"
8586
}
86-

0 commit comments

Comments
 (0)