-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
175 lines (149 loc) · 5.01 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
import com.github.jk1.license.filter.LicenseBundleNormalizer
import com.github.jk1.license.render.JsonReportRenderer
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id 'com.palantir.docker' version '0.25.0'
id 'org.jetbrains.kotlin.jvm' version '1.8.22'
id 'application'
id "org.owasp.dependencycheck" version "8.3.1"
id "com.gorylenko.gradle-git-properties" version "2.4.1"
id 'com.github.jk1.dependency-license-report' version '2.5'
id "de.undercouch.download" version "5.4.0"
}
dependencyCheck {
formats = ['SARIF', 'JSON', 'HTML']
failBuildOnCVSS = 5
// suppressionFile = file('suppressions.xml')
analyzers {
assemblyEnabled = false
nugetconfEnabled = false
nodeEnabled = false
}
}
ext {
sailfishVersion = '3.3.132'
}
ext.excludeSailfish = { rcd ->
rcd.excludeModule("com.exactpro.sf", "sailfish-core")
rcd.excludeModule("com.exactpro.sf", "sailfish-common")
rcd.excludeModule("com.exactpro.sf", "sailfish-rest-api-client")
rcd.excludeModule("com.exactpro.sf", "service-http")
}
group = 'com.exactpro.th2'
version = release_version
repositories {
maven {
name 'Sonatype_snapshots'
url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
content {
excludeSailfish(it)
}
}
// ignoreGradleMetadataRedirection is used for sonatype because
// Sailfish dependencies have constrains that interfere with our BOM
// so we exclude Gradle metadata for this repositories.
// We've checked these versions - they are compatible and safe to use
maven {
name 'Sonatype_snapshots'
url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
metadataSources {
mavenPom()
artifact()
ignoreGradleMetadataRedirection()
}
}
maven {
name 'Sonatype_releases'
url 'https://s01.oss.sonatype.org/content/repositories/releases/'
content {
excludeSailfish(it)
}
}
maven {
name 'Sonatype_releases'
url 'https://s01.oss.sonatype.org/content/repositories/releases/'
metadataSources {
mavenPom()
artifact()
ignoreGradleMetadataRedirection()
}
}
mavenCentral()
mavenLocal()
configurations.configureEach {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
}
}
jar {
manifest {
attributes(
'Created-By': "${System.getProperty('java.version')} (${System.getProperty('java.vendor')})",
'Specification-Title': '',
'Specification-Vendor': 'Exactpro Systems LLC',
'Implementation-Title': project.archivesBaseName,
'Implementation-Vendor': 'Exactpro Systems LLC',
'Implementation-Vendor-Id': 'com.exactpro',
'Implementation-Version': project.version
)
}
}
sourceCompatibility = 11
targetCompatibility = 11
tasks.withType(KotlinCompile).configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
}
}
dependencies {
api platform('com.exactpro.th2:bom:4.5.0')
implementation 'com.exactpro.th2:common:5.4.0-dev'
implementation 'com.exactpro.th2:sailfish-utils:4.1.0-dev'
implementation 'com.exactpro.th2:common-utils:2.2.0-dev'
implementation group: 'io.reactivex.rxjava3', name: 'rxjava', version: '3.0.4'
implementation 'org.slf4j:slf4j-api'
implementation 'io.prometheus:simpleclient'
implementation("com.exactpro.sf:sailfish-core:${sailfishVersion}")
testImplementation('org.apache.logging.log4j:log4j-slf4j2-impl') {
because('logging in testing')
}
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.0'
}
test {
useJUnitPlatform()
testLogging {
showStandardStreams = true
}
}
application {
mainClass.set('com.exactpro.th2.conn.MicroserviceMain')
}
applicationName = 'service'
distTar {
archiveFileName.set("${applicationName}.tar")
}
dockerPrepare {
dependsOn distTar
}
docker {
copySpec.from(tarTree("$buildDir/distributions/${applicationName}.tar"))
}
licenseReport {
def licenseNormalizerBundlePath = "$buildDir/license-normalizer-bundle.json"
if (!file(licenseNormalizerBundlePath).exists()) {
download.run {
src 'https://raw.githubusercontent.com/th2-net/.github/main/license-compliance/gradle-license-report/license-normalizer-bundle.json'
dest "$buildDir/license-normalizer-bundle.json"
overwrite false
}
}
filters = [
new LicenseBundleNormalizer(licenseNormalizerBundlePath, false)
]
renderers = [
new JsonReportRenderer('licenses.json', false),
]
excludeOwnGroup = false
allowedLicensesFile = new URL("https://raw.githubusercontent.com/th2-net/.github/main/license-compliance/gradle-license-report/allowed-licenses.json")
}