Compile with JDK 21 & optimize
This commit is contained in:
parent
c74e10e016
commit
4cab62f66b
25
build.gradle
25
build.gradle
|
@ -1,14 +1,15 @@
|
||||||
plugins {
|
plugins {
|
||||||
id "java"
|
id "java"
|
||||||
id "io.micronaut.application" version "$micronautApplicationVersion"
|
id "io.micronaut.application" version "$micronautApplicationVersion"
|
||||||
|
id "io.micronaut.aot" version "$micronautApplicationVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
version = findProperty('BUILD_VERSION') ?: 'latest'
|
version = findProperty('BUILD_VERSION') ?: 'latest'
|
||||||
group = "com.devsoap"
|
group = "com.devsoap"
|
||||||
|
|
||||||
java {
|
java {
|
||||||
sourceCompatibility = JavaVersion.VERSION_17
|
sourceCompatibility = JavaVersion.VERSION_21
|
||||||
targetCompatibility = JavaVersion.VERSION_17
|
targetCompatibility = JavaVersion.VERSION_21
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
@ -19,17 +20,16 @@ dependencies {
|
||||||
|
|
||||||
annotationProcessor 'org.projectlombok:lombok'
|
annotationProcessor 'org.projectlombok:lombok'
|
||||||
testAnnotationProcessor 'org.projectlombok:lombok'
|
testAnnotationProcessor 'org.projectlombok:lombok'
|
||||||
|
compileOnly 'org.projectlombok:lombok'
|
||||||
|
|
||||||
annotationProcessor(platform("io.micronaut:micronaut-bom:$micronautVersion"))
|
implementation(platform("io.micronaut.platform:micronaut-platform"))
|
||||||
testAnnotationProcessor(platform("io.micronaut:micronaut-bom:$micronautVersion"))
|
|
||||||
|
|
||||||
implementation(platform("io.micronaut:micronaut-bom:$micronautVersion"))
|
|
||||||
implementation 'org.projectlombok:lombok'
|
|
||||||
|
|
||||||
implementation 'com.fasterxml.jackson.core:jackson-databind'
|
implementation 'com.fasterxml.jackson.core:jackson-databind'
|
||||||
implementation 'javax.validation:validation-api'
|
|
||||||
implementation 'io.micronaut.views:micronaut-views-handlebars'
|
implementation 'io.micronaut.views:micronaut-views-handlebars'
|
||||||
|
|
||||||
|
implementation 'jakarta.validation:jakarta.validation-api:3.1.1'
|
||||||
|
implementation 'jakarta.annotation:jakarta.annotation-api:3.0.0'
|
||||||
|
|
||||||
implementation "io.github.resilience4j:resilience4j-micronaut:$resilience4jVersion"
|
implementation "io.github.resilience4j:resilience4j-micronaut:$resilience4jVersion"
|
||||||
implementation "io.github.resilience4j:resilience4j-ratelimiter:$resilience4jVersion"
|
implementation "io.github.resilience4j:resilience4j-ratelimiter:$resilience4jVersion"
|
||||||
implementation "io.github.resilience4j:resilience4j-consumer:$resilience4jVersion"
|
implementation "io.github.resilience4j:resilience4j-consumer:$resilience4jVersion"
|
||||||
|
@ -55,10 +55,17 @@ application {
|
||||||
micronaut {
|
micronaut {
|
||||||
version "$micronautVersion"
|
version "$micronautVersion"
|
||||||
runtime("netty")
|
runtime("netty")
|
||||||
|
aot {
|
||||||
|
cacheEnvironment = true
|
||||||
|
optimizeServiceLoading = true
|
||||||
|
optimizeClassLoading = true
|
||||||
|
convertYamlToJava = true
|
||||||
|
precomputeOperations = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wrapper {
|
wrapper {
|
||||||
gradleVersion = '8.0'
|
gradleVersion = '8.12.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
micronautApplicationVersion=3.7.0
|
micronautApplicationVersion=4.4.5
|
||||||
micronautVersion=3.8.3
|
micronautVersion=4.7.6
|
||||||
julToSlf4jVersion=1.7.29
|
julToSlf4jVersion=1.7.29
|
||||||
guavaVersion=31.0.1-jre
|
guavaVersion=31.0.1-jre
|
||||||
resilience4jVersion=2.0.2
|
resilience4jVersion=2.0.2
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|
|
@ -86,8 +86,7 @@ done
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||||
' "$PWD" ) || exit
|
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
|
|
|
@ -33,10 +33,10 @@ import io.micronaut.http.annotation.*;
|
||||||
import io.micronaut.http.annotation.Error;
|
import io.micronaut.http.annotation.Error;
|
||||||
import io.micronaut.http.server.util.HttpHostResolver;
|
import io.micronaut.http.server.util.HttpHostResolver;
|
||||||
import io.micronaut.views.View;
|
import io.micronaut.views.View;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
|
@ -23,9 +23,9 @@ import com.devsoap.tincheck.tin.TinGenerator;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import io.micronaut.core.annotation.Introspected;
|
import io.micronaut.core.annotation.Introspected;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
|
||||||
@Introspected
|
@Introspected
|
||||||
|
|
|
@ -21,11 +21,9 @@ package com.devsoap.tincheck.routes.requests;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import io.micronaut.core.annotation.Introspected;
|
import io.micronaut.core.annotation.Introspected;
|
||||||
import lombok.Getter;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import lombok.RequiredArgsConstructor;
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
@Introspected
|
@Introspected
|
||||||
public record TinValidateRequest(
|
public record TinValidateRequest(
|
||||||
|
|
|
@ -23,15 +23,14 @@ import com.devsoap.tincheck.tin.TinGenerator;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import io.micronaut.core.annotation.Introspected;
|
import io.micronaut.core.annotation.Introspected;
|
||||||
import jdk.jfr.Timestamp;
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
|
||||||
@Introspected
|
@Introspected
|
||||||
public record GenerationResult(
|
public record GenerationResult(
|
||||||
@JsonProperty("value") String value,
|
@JsonProperty("value") String value,
|
||||||
@JsonProperty("dateOfBirth") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") @Timestamp LocalDate dateOfBirth,
|
@JsonProperty("dateOfBirth") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") LocalDate dateOfBirth,
|
||||||
@JsonProperty("gender") @NotNull TinGenerator.Gender gender,
|
@JsonProperty("gender") @NotNull TinGenerator.Gender gender,
|
||||||
@JsonProperty("availableTokens") Long tokens
|
@JsonProperty("availableTokens") Long tokens
|
||||||
){ }
|
){ }
|
|
@ -24,11 +24,11 @@ import com.devsoap.tincheck.tin.TinGenerator;
|
||||||
import com.devsoap.tincheck.routes.responses.GenerationResult;
|
import com.devsoap.tincheck.routes.responses.GenerationResult;
|
||||||
import com.devsoap.tincheck.routes.responses.ValidationResult;
|
import com.devsoap.tincheck.routes.responses.ValidationResult;
|
||||||
import io.github.resilience4j.micronaut.annotation.RateLimiter;
|
import io.github.resilience4j.micronaut.annotation.RateLimiter;
|
||||||
|
import jakarta.annotation.PostConstruct;
|
||||||
import jakarta.inject.Singleton;
|
import jakarta.inject.Singleton;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
Loading…
Reference in New Issue