solution: use gradle 7.2
Co-authored-by: Brian McGee <brian@41north.dev>
This commit is contained in:
189
build.gradle
189
build.gradle
@@ -1,19 +1,10 @@
|
||||
import io.gitlab.arturbosch.detekt.Detekt
|
||||
|
||||
import java.time.Instant
|
||||
import java.time.ZoneId
|
||||
import java.time.format.DateTimeFormatter
|
||||
import java.time.temporal.ChronoUnit
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30'
|
||||
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.12'
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'groovy'
|
||||
@@ -21,13 +12,13 @@ plugins {
|
||||
id 'application'
|
||||
id 'jacoco'
|
||||
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.3.70'
|
||||
id 'com.google.cloud.tools.jib' version "2.5.0"
|
||||
id 'org.springframework.boot' version '2.3.5.RELEASE'
|
||||
id 'io.spring.dependency-management' version '1.0.6.RELEASE'
|
||||
id 'com.palantir.git-version' version '0.12.2'
|
||||
id "com.google.protobuf" version "0.8.12"
|
||||
id "org.jlleitschuh.gradle.ktlint" version "10.2.0"
|
||||
alias(libs.plugins.kotlin)
|
||||
alias(libs.plugins.jib)
|
||||
alias(libs.plugins.spring)
|
||||
alias(libs.plugins.git)
|
||||
alias(libs.plugins.protobuf)
|
||||
alias(libs.plugins.ktlint)
|
||||
alias(libs.plugins.detekt)
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +26,7 @@ group = 'io.emeraldpay.dshackle'
|
||||
|
||||
// Version schema:
|
||||
// x.x.x for production, following SemVer model
|
||||
// x.x-SNAPSHOT for development
|
||||
// x.x.x-SNAPSHOT for development
|
||||
version = '0.11.0-SNAPSHOT'
|
||||
|
||||
java {
|
||||
@@ -46,7 +37,6 @@ java {
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
maven { url "https://repo.spring.io/snapshot" }
|
||||
maven { url "https://repo.spring.io/milestone" }
|
||||
maven { url "https://maven.emrld.io" }
|
||||
@@ -62,81 +52,51 @@ configurations {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "io.emeraldpay:emerald-api:0.10.0"
|
||||
implementation libs.bundles.kotlin
|
||||
|
||||
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
|
||||
implementation "io.grpc:grpc-stub:${grpcVersion}"
|
||||
implementation "io.grpc:grpc-netty:${grpcVersion}"
|
||||
|
||||
implementation "io.netty:netty-transport:$nettyVersion"
|
||||
implementation "io.netty:netty-common:$nettyVersion"
|
||||
implementation "io.netty:netty-handler:$nettyVersion"
|
||||
implementation "io.netty:netty-handler-proxy:$nettyVersion"
|
||||
implementation "io.netty:netty-resolver:$nettyVersion"
|
||||
implementation "io.netty:netty-resolver-dns:$nettyVersion"
|
||||
implementation "io.netty:netty-codec:$nettyVersion"
|
||||
implementation "io.netty:netty-codec-http2:$nettyVersion"
|
||||
implementation "io.netty:netty-codec-http:$nettyVersion"
|
||||
implementation "io.netty:netty-buffer:$nettyVersion"
|
||||
implementation "io.netty:netty-tcnative:2.0.39.Final"
|
||||
implementation "io.netty:netty-tcnative-boringssl-static:2.0.39.Final"
|
||||
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
||||
implementation "org.jetbrains.kotlin:kotlin-reflect"
|
||||
|
||||
implementation("org.springframework.boot:spring-boot-starter:$springBootVersion") {
|
||||
implementation libs.bundles.grpc
|
||||
implementation libs.bundles.netty
|
||||
implementation(libs.bundles.spring.framework) {
|
||||
exclude module: 'spring-boot-starter-logging'
|
||||
}
|
||||
implementation "org.springframework.security:spring-security-core:$springSecurtyVersion"
|
||||
implementation "org.springframework.security:spring-security-web:$springSecurtyVersion"
|
||||
implementation "org.springframework.security:spring-security-config:$springSecurtyVersion"
|
||||
implementation "io.projectreactor:reactor-core:$reactorVersion"
|
||||
implementation "io.projectreactor.netty:reactor-netty:1.0.11"
|
||||
implementation 'io.projectreactor.addons:reactor-extra:3.4.5'
|
||||
implementation 'io.projectreactor.kotlin:reactor-kotlin-extensions:1.1.4'
|
||||
implementation "com.salesforce.servicelibs:reactor-grpc-stub:$reactiveGrpcVersion"
|
||||
implementation 'io.micrometer:micrometer-registry-prometheus:1.5.6'
|
||||
implementation 'io.lettuce:lettuce-core:5.2.2.RELEASE'
|
||||
|
||||
implementation "io.emeraldpay.etherjar:etherjar-domain:$etherjarVersion"
|
||||
implementation "io.emeraldpay.etherjar:etherjar-hex:$etherjarVersion"
|
||||
implementation "io.emeraldpay.etherjar:etherjar-rpc-api:$etherjarVersion"
|
||||
implementation "io.emeraldpay.etherjar:etherjar-rpc-http:$etherjarVersion"
|
||||
implementation "io.emeraldpay.etherjar:etherjar-rpc-ws:$etherjarVersion"
|
||||
implementation "io.emeraldpay.etherjar:etherjar-tx:$etherjarVersion"
|
||||
implementation "io.emeraldpay.etherjar:etherjar-contract:$etherjarVersion"
|
||||
implementation "io.emeraldpay.etherjar:etherjar-erc20:$etherjarVersion"
|
||||
implementation 'org.bitcoinj:bitcoinj-core:0.15.8'
|
||||
implementation libs.bundles.reactor
|
||||
|
||||
implementation 'org.yaml:snakeyaml:1.24'
|
||||
implementation 'org.apache.httpcomponents:httpmime:4.5.8'
|
||||
implementation 'org.apache.httpcomponents:httpclient:4.5.8'
|
||||
implementation "com.fasterxml.jackson.core:jackson-core:$jacksonVersion"
|
||||
implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
|
||||
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:$jacksonVersion"
|
||||
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion"
|
||||
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion"
|
||||
implementation 'commons-io:commons-io:2.6'
|
||||
implementation 'org.apache.commons:commons-lang3:3.9'
|
||||
implementation 'org.apache.commons:commons-collections4:4.3'
|
||||
implementation 'javax.annotation:javax.annotation-api:1.3.2'
|
||||
implementation 'org.bouncycastle:bcprov-jdk15on:1.61'
|
||||
implementation 'com.github.ben-manes.caffeine:caffeine:2.8.5'
|
||||
implementation(libs.reactor.grpc.stub)
|
||||
|
||||
implementation "org.slf4j:slf4j-api:$slf4jVersion"
|
||||
implementation "org.apache.logging.log4j:log4j-slf4j-impl:2.11.1"
|
||||
implementation "org.slf4j:jul-to-slf4j:$slf4jVersion"
|
||||
implementation "org.slf4j:jcl-over-slf4j:$slf4jVersion"
|
||||
implementation libs.micrometer.registry.prometheus
|
||||
implementation libs.lettuce.core
|
||||
|
||||
testImplementation 'cglib:cglib-nodep:3.3.0'
|
||||
testImplementation "org.spockframework:spock-core:$spockVersion"
|
||||
testImplementation "io.grpc:grpc-testing:${grpcVersion}"
|
||||
testImplementation "io.projectreactor:reactor-test:$reactorVersion"
|
||||
testImplementation 'org.objenesis:objenesis:3.1'
|
||||
testImplementation 'org.mock-server:mockserver-netty:5.11.2'
|
||||
testImplementation "org.java-websocket:Java-WebSocket:1.5.1"
|
||||
testImplementation "nl.jqno.equalsverifier:equalsverifier:3.3"
|
||||
testImplementation "org.codehaus.groovy:groovy:${groovyVersion}"
|
||||
implementation libs.bundles.etherjar
|
||||
|
||||
implementation(libs.emerald.api) {
|
||||
exclude group: 'com.salesforce.servicelibs', module: 'reactor-grpc'
|
||||
}
|
||||
|
||||
implementation libs.bitcoinj
|
||||
|
||||
implementation libs.snake.yaml
|
||||
implementation libs.bundles.httpcomponents
|
||||
implementation libs.bundles.jackson
|
||||
|
||||
implementation libs.bundles.apache.commons
|
||||
implementation libs.bouncycastle
|
||||
implementation libs.caffeine
|
||||
implementation libs.javax.annotations
|
||||
|
||||
implementation libs.bundles.slf4j
|
||||
|
||||
testImplementation libs.cglib.nodep
|
||||
testImplementation libs.spockframework.core
|
||||
testImplementation libs.grpc.testing
|
||||
testImplementation libs.reactor.test
|
||||
testImplementation libs.objgenesis
|
||||
testImplementation libs.mockserver.netty
|
||||
testImplementation libs.java.websocket
|
||||
testImplementation libs.equals.verifier
|
||||
testImplementation libs.groovy
|
||||
|
||||
detektPlugins libs.detekt.formatting
|
||||
}
|
||||
|
||||
compileKotlin {
|
||||
@@ -173,7 +133,7 @@ test {
|
||||
}
|
||||
|
||||
application {
|
||||
mainClassName = 'io.emeraldpay.dshackle.StarterKt'
|
||||
getMainClass().set('io.emeraldpay.dshackle.StarterKt')
|
||||
}
|
||||
|
||||
jib {
|
||||
@@ -192,8 +152,8 @@ jib {
|
||||
'/dshackle:',
|
||||
'snapshot'
|
||||
].join('')
|
||||
tags = [project.version].with (true) {
|
||||
add "t"+ DateTimeFormatter.ofPattern("yyyyMMddHHmm").withZone(ZoneId.of('UTC')).format(Instant.now())
|
||||
tags = [project.version].with(true) {
|
||||
add "t" + DateTimeFormatter.ofPattern("yyyyMMddHHmm").withZone(ZoneId.of('UTC')).format(Instant.now())
|
||||
add project.version.toString().replaceAll('(\\d+\\.\\d+).+', '$1')
|
||||
}
|
||||
auth {
|
||||
@@ -202,9 +162,7 @@ jib {
|
||||
}
|
||||
}
|
||||
container {
|
||||
jvmFlags = [
|
||||
'-Xms1024m',
|
||||
]
|
||||
jvmFlags = ['-Xms1024m']
|
||||
mainClass = 'io.emeraldpay.dshackle.StarterKt'
|
||||
args = []
|
||||
ports = ['2448', '2449', '8545']
|
||||
@@ -212,7 +170,7 @@ jib {
|
||||
}
|
||||
|
||||
jar {
|
||||
enabled=true
|
||||
enabled = true
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
@@ -222,7 +180,11 @@ afterEvaluate {
|
||||
}
|
||||
|
||||
protobuf {
|
||||
protoc { artifact = "com.google.protobuf:protoc:${protocVersion}" }
|
||||
protoc {
|
||||
// if $PROTOC_PATH is set then locally installed protoc is used otherwise it is downloaded remotely
|
||||
path = System.getenv("PROTOC_PATH") ?: null
|
||||
artifact = System.getenv("PROTOC_PATH") == null ? "com.google.protobuf:protoc:${libs.versions.protoc.get()}" : null
|
||||
}
|
||||
plugins {
|
||||
}
|
||||
generateProtoTasks {
|
||||
@@ -235,7 +197,7 @@ sourceSets {
|
||||
}
|
||||
}
|
||||
|
||||
task generateVersion() {
|
||||
task generateVersion() {
|
||||
group = 'Build'
|
||||
description = 'Generate project version'
|
||||
|
||||
@@ -267,7 +229,7 @@ tasks.withType(Test) {
|
||||
}
|
||||
}
|
||||
afterTest { TestDescriptor descriptor, TestResult result ->
|
||||
if(result.resultType == org.gradle.api.tasks.testing.TestResult.ResultType.FAILURE){
|
||||
if (result.resultType == org.gradle.api.tasks.testing.TestResult.ResultType.FAILURE) {
|
||||
failedTests << "${descriptor.className} > ${descriptor.name}"
|
||||
if (!stdout.isEmpty()) {
|
||||
println("-------- ${descriptor.className} > ${descriptor.name} OUTPUT ".padRight(120, "-"))
|
||||
@@ -278,7 +240,7 @@ tasks.withType(Test) {
|
||||
}
|
||||
}
|
||||
gradle.buildFinished {
|
||||
if(!failedTests.empty){
|
||||
if (!failedTests.empty) {
|
||||
println "Failed tests for ${project.name}:"
|
||||
failedTests.each { failedTest ->
|
||||
println failedTest
|
||||
@@ -290,8 +252,8 @@ gradle.buildFinished {
|
||||
jacocoTestReport {
|
||||
dependsOn test
|
||||
reports {
|
||||
xml.enabled true
|
||||
html.enabled true
|
||||
xml.required.set true
|
||||
html.required.set true
|
||||
}
|
||||
afterEvaluate {
|
||||
classDirectories.setFrom(files(classDirectories.files.collect {
|
||||
@@ -301,4 +263,27 @@ jacocoTestReport {
|
||||
}
|
||||
jacoco {
|
||||
toolVersion = "0.8.7"
|
||||
}
|
||||
}
|
||||
|
||||
detekt {
|
||||
toolVersion = "1.18.1"
|
||||
parallel = false
|
||||
basePath = projectDir
|
||||
debug = false
|
||||
ignoreFailures = true
|
||||
|
||||
reports {
|
||||
xml {
|
||||
enabled = true
|
||||
destination = file("build/reports/detekt/detekt.xml")
|
||||
}
|
||||
html {
|
||||
enabled = true
|
||||
destination = file("build/reports/detekt/detekt.html")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(Detekt).configureEach {
|
||||
jvmTarget = "13"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user