forked from hashgraph/hedera-mirror-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
158 lines (147 loc) · 6.64 KB
/
build.gradle.kts
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
/*-
*
* Hedera Mirror Node
*
* Copyright (C) 2019 - 2023 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
description = "Hedera Mirror Node imports data from consensus nodes and serves it via an API"
plugins {
id("idea")
id("java-platform")
id("org.sonarqube")
}
// Can't use typed variable syntax due to Dependabot limitations
extra.apply {
set("gson.version", "2.8.9") // Temporary until Apache jclouds supports gson 2.9
set("mapStructVersion", "1.5.3.Final")
set("postgresql.version", "42.5.1") // Temporary fix for transient dependency security issue
set("protobufVersion", "3.22.0")
set("reactorGrpcVersion", "1.2.3")
set("snakeyaml.version", "1.33") // Temporary fix for transient dependency security issue
set("testcontainersSpringBootVersion", "2.3.1")
}
// Creates a platform/BOM with specific versions so subprojects don't need to specify a version when using a dependency
dependencies {
constraints {
val mapStructVersion: String by rootProject.extra
val protobufVersion: String by rootProject.extra
val reactorGrpcVersion: String by rootProject.extra
val testcontainersSpringBootVersion: String by rootProject.extra
api("com.esaulpaugh:headlong:9.2.0")
api("com.github.meanbeanlib:meanbean:3.0.0-M9")
api("com.github.vertical-blank:sql-formatter:2.0.3")
api("com.github.vladimir-bukhtoyarov:bucket4j-core:7.6.0")
api("com.google.cloud:spring-cloud-gcp-dependencies:3.4.5")
api("com.google.guava:guava:31.1-jre")
api("com.google.protobuf:protobuf-java:$protobufVersion")
api("com.graphql-java-generator:graphql-java-client-dependencies:1.18.10")
api("com.graphql-java:graphql-java-extended-scalars:20.0")
api("com.graphql-java:graphql-java-extended-validation:20.0-validator-6.2.0.Final")
api("com.hedera.evm:hedera-evm:0.34.0")
api("com.hedera.hashgraph:hedera-protobuf-java-api:0.35.0")
api("com.hedera.hashgraph:sdk:2.19.0")
api("com.ongres.scram:client:2.1")
api("com.playtika.testcontainers:embedded-google-pubsub:$testcontainersSpringBootVersion")
api("com.playtika.testcontainers:embedded-postgresql:$testcontainersSpringBootVersion")
api("com.playtika.testcontainers:embedded-redis:$testcontainersSpringBootVersion")
api("com.salesforce.servicelibs:reactor-grpc-stub:$reactorGrpcVersion")
api("com.vladmihalcea:hibernate-types-55:2.21.1")
api("commons-beanutils:commons-beanutils:1.9.4")
api("commons-io:commons-io:2.11.0")
api("io.cucumber:cucumber-bom:7.11.1")
api("io.github.mweirauch:micrometer-jvm-extras:0.2.2")
api("io.grpc:grpc-bom:1.53.0")
api("io.swagger:swagger-annotations:1.6.9")
api("io.vertx:vertx-pg-client:4.4.0")
api("javax.inject:javax.inject:1")
api("net.devh:grpc-spring-boot-starter:2.14.0.RELEASE")
api("net.java.dev.jna:jna:5.13.0")
api("org.apache.commons:commons-compress:1.22")
api("org.apache.commons:commons-math3:3.6.1")
api("org.apache.tuweni:tuweni-bytes:2.3.1")
api("org.apache.velocity:velocity-engine-core:2.3")
api("org.gaul:s3proxy:2.0.0")
api("org.hyperledger.besu:secp256k1:0.6.1")
api("org.hyperledger.besu:evm:22.7.6")
api("org.mapstruct:mapstruct:$mapStructVersion")
api("org.mapstruct:mapstruct-processor:$mapStructVersion")
api("org.msgpack:jackson-dataformat-msgpack:0.9.3")
api("org.springdoc:springdoc-openapi-webflux-ui:1.6.14")
api("org.springframework.cloud:spring-cloud-dependencies:2021.0.5")
api("org.testcontainers:junit-jupiter:1.17.6")
api("software.amazon.awssdk:bom:2.20.17")
api("uk.org.webcompere:system-stubs-jupiter:2.0.2")
}
}
allprojects {
apply(plugin = "jacoco")
apply(plugin = "org.sonarqube")
sonarqube {
properties {
property("sonar.host.url", "https://sonarcloud.io")
property("sonar.organization", "hashgraph")
property("sonar.projectKey", rootProject.name)
property("sonar.issue.ignore.multicriteria", "e1,e2,e3,e4,e5")
property("sonar.issue.ignore.multicriteria.e1.resourceKey", "**/*.java")
property("sonar.issue.ignore.multicriteria.e1.ruleKey", "java:S6212")
property("sonar.issue.ignore.multicriteria.e2.resourceKey", "**/*.java")
property("sonar.issue.ignore.multicriteria.e2.ruleKey", "java:S125")
property("sonar.issue.ignore.multicriteria.e3.resourceKey", "**/*.java")
property("sonar.issue.ignore.multicriteria.e3.ruleKey", "java:S2187")
property("sonar.issue.ignore.multicriteria.e4.resourceKey", "**/*.js")
property("sonar.issue.ignore.multicriteria.e4.ruleKey", "javascript:S3758")
property("sonar.issue.ignore.multicriteria.e5.resourceKey", "**/stateproof/*.sql")
property("sonar.issue.ignore.multicriteria.e5.ruleKey", "plsql:S1192")
}
}
}
idea {
module {
isDownloadJavadoc = true
isDownloadSources = true
}
}
fun replaceVersion(files: String, match: String) {
ant.withGroovyBuilder {
"replaceregexp"(
"match" to match,
"replace" to project.version,
"flags" to "gm"
) {
"fileset"(
"dir" to rootProject.projectDir,
"includes" to files,
"excludes" to "**/node_modules/"
)
}
}
}
// Replace release version in files
project.tasks.register("release") {
doLast {
replaceVersion("charts/**/Chart.yaml", "(?<=^(appVersion|version): ).+")
replaceVersion("docker-compose.yml", "(?<=gcr.io/mirrornode/hedera-mirror-.+:).+")
replaceVersion("gradle.properties", "(?<=^version=).+")
replaceVersion(
"hedera-mirror-rest/**/package*.json",
"(?<=\"@hashgraph/(check-state-proof|mirror-rest|mirror-monitor)\",\\s{3,7}\"version\": \")[^\"]+"
)
replaceVersion("hedera-mirror-rest/**/openapi.yml", "(?<=^ version: ).+")
}
}
tasks.sonar {
dependsOn(tasks.build)
}