1- import com.github.jk1.license.filter.LicenseBundleNormalizer
2- import com.github.jk1.license.render.JsonReportRenderer
3-
4- buildscript {
5- repositories {
6- mavenCentral()
7- }
8-
9- ext {
10- kotlin_version = " 1.8.22"
11- }
12-
13- dependencies {
14- classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:${ kotlin_version} "
15- }
16- }
17-
181plugins {
19- id ' java'
20- id ' java-library'
21- id ' maven-publish'
22- id " io.github.gradle-nexus.publish-plugin" version " 1.3.0"
23- id ' signing'
24- id ' org.jetbrains.kotlin.jvm' version " ${ kotlin_version} "
25- id " org.owasp.dependencycheck" version " 8.4.0"
26- id " com.gorylenko.gradle-git-properties" version " 2.4.1"
27- id " com.github.jk1.dependency-license-report" version " 2.5"
28- id " de.undercouch.download" version " 5.5.0"
29- }
2+ id " org.jetbrains.kotlin.jvm" version " 1.8.22"
3+ id " org.jetbrains.kotlin.kapt" version " 1.8.22"
4+ id(" java-library" )
5+ id(" maven-publish" )
306
31- apply plugin : ' kotlin-kapt'
7+ id " com.exactpro.th2.gradle.publish" version " 0.0.6"
8+ }
329
3310ext {
3411 genDir = file(' src/gen' )
35- sailfishVersion = ' 3.3.169 '
12+ sailfishVersion = ' 3.3.202 '
3613 excludeSailfish = { rcd ->
3714 rcd. excludeModule(" com.exactpro.sf" , " sailfish-core" )
3815 rcd. excludeModule(" com.exactpro.sf" , " sailfish-common" )
4421group ' com.exactpro.th2'
4522version release_version
4623
24+ kotlin {
25+ jvmToolchain(11 )
26+ }
27+
4728ext. excludeSailfish = { rcd ->
4829 rcd. excludeModule(" com.exactpro.sf" , " sailfish-core" )
4930 rcd. excludeModule(" com.exactpro.sf" , " sailfish-common" )
@@ -93,31 +74,27 @@ repositories {
9374
9475 configurations. configureEach {
9576 resolutionStrategy {
96- cacheChangingModulesFor 0 , ' seconds'
97- cacheDynamicVersionsFor 0 , ' seconds'
77+ resolutionStrategy . cacheChangingModulesFor 0 , ' seconds'
78+ resolutionStrategy . cacheDynamicVersionsFor 0 , ' seconds'
9879 }
9980 }
10081}
10182
10283configurations {
103- compileClasspath {
104- resolutionStrategy. activateDependencyLocking()
105- }
10684 implementation {
10785 exclude group : ' com.fasterxml.jackson.dataformat' , module : ' jackson-dataformat-yaml' // because of the vulnerability
10886 exclude group : ' junit' , module : ' junit' // because of the vulnerability
10987 }
11088}
11189
11290dependencies {
113- api platform(' com.exactpro.th2:bom:4.5.0' )
114- implementation(' com.exactpro.th2:common:5.7.2-dev' ) {
91+ implementation(' com.exactpro.th2:common:5.10.1-dev' ) {
11592 because(' sending to direct queues' )
11693 exclude group : ' com.exactpro.th2' , module : ' task-utils'
11794 }
11895
119- implementation ' com.exactpro.th2:codec:5.4.1 -dev'
120- implementation ' com.exactpro.th2:common-utils:2.2.2 -dev'
96+ implementation ' com.exactpro.th2:codec:5.5.0 -dev'
97+ implementation ' com.exactpro.th2:common-utils:2.2.3 -dev'
12198 implementation ' com.exactpro.th2:sailfish-utils:4.1.1-dev'
12299 implementation " com.exactpro.sf:sailfish-core:${ sailfishVersion} "
123100
@@ -127,8 +104,8 @@ dependencies {
127104 testCompileOnly ' com.google.auto.service:auto-service-annotations:1.1.1'
128105 kaptTest ' com.google.auto.service:auto-service:1.1.1'
129106
130- testImplementation ' org.junit.jupiter:junit-jupiter:5.10.0 '
131- testImplementation ' org.mockito.kotlin:mockito-kotlin:5.1.0 '
107+ testImplementation ' org.junit.jupiter:junit-jupiter:5.10.2 '
108+ testImplementation ' org.mockito.kotlin:mockito-kotlin:5.3.1 '
132109 testImplementation ' org.mockito:mockito-inline:5.2.0'
133110 testImplementation ' org.jetbrains.kotlin:kotlin-test-junit5'
134111}
@@ -140,149 +117,6 @@ test {
140117 }
141118}
142119
143- jar {
144- manifest {
145- attributes(
146- ' Created-By' : " ${ System.getProperty('java.version')} (${ System.getProperty('java.vendor')} )" ,
147- ' Specification-Title' : ' ' ,
148- ' Specification-Vendor' : ' Exactpro Systems LLC' ,
149- ' Implementation-Title' : project. archivesBaseName,
150- ' Implementation-Vendor' : ' Exactpro Systems LLC' ,
151- ' Implementation-Vendor-Id' : ' com.exactpro' ,
152- ' Implementation-Version' : project. version
153- )
154- }
155- }
156-
157- java {
158- sourceCompatibility = 11
159- targetCompatibility = 11
160-
161- withJavadocJar()
162- withSourcesJar()
163- }
164-
165- // conditionals for publications
166- tasks. withType(PublishToMavenRepository ). configureEach {
167- onlyIf {
168- (repository == publishing. repositories. nexusRepository &&
169- project. hasProperty(' nexus_user' ) &&
170- project. hasProperty(' nexus_password' ) &&
171- project. hasProperty(' nexus_url' )) ||
172- (repository == publishing. repositories. sonatype &&
173- project. hasProperty(' sonatypeUsername' ) &&
174- project. hasProperty(' sonatypePassword' ))
175- }
176- }
177- tasks. withType(Sign ). configureEach {
178- onlyIf {
179- project. hasProperty(' signingKey' ) &&
180- project. hasProperty(' signingPassword' )
181- }
182- }
183- // disable running task 'initializeSonatypeStagingRepository' on a gitlab
184- tasks. configureEach { task ->
185- if (task. name == ' initializeSonatypeStagingRepository' &&
186- ! (project. hasProperty(' sonatypeUsername' ) && project. hasProperty(' sonatypePassword' ))
187- ) {
188- task. enabled = false
189- }
190- }
191-
192- publishing {
193- publications {
194- mavenJava(MavenPublication ) {
195- from(components. java)
196- pom {
197- name = rootProject. name
198- packaging = ' jar'
199- description = rootProject. description
200- url = vcs_url
201- scm {
202- url = vcs_url
203- }
204- licenses {
205- license {
206- name = ' The Apache License, Version 2.0'
207- url = ' http://www.apache.org/licenses/LICENSE-2.0.txt'
208- }
209- }
210- developers {
211- developer {
212- id = ' developer'
213- name = ' developer'
214- email = ' developer@exactpro.com'
215- }
216- }
217- scm {
218- url = vcs_url
219- }
220- }
221- }
222- }
223- repositories {
224- // Nexus repo to publish from gitlab
225- maven {
226- name = ' nexusRepository'
227- credentials {
228- username = project. findProperty(' nexus_user' )
229- password = project. findProperty(' nexus_password' )
230- }
231- url = project. findProperty(' nexus_url' )
232- }
233- }
234- }
235-
236- nexusPublishing {
237- repositories {
238- sonatype {
239- nexusUrl. set(uri(" https://s01.oss.sonatype.org/service/local/" ))
240- snapshotRepositoryUrl. set(uri(" https://s01.oss.sonatype.org/content/repositories/snapshots/" ))
241- }
242- }
243- }
244-
245- signing {
246- String signingKey = findProperty(" signingKey" )
247- String signingPassword = findProperty(" signingPassword" )
248- useInMemoryPgpKeys(signingKey, signingPassword)
249- sign publishing. publications. mavenJava
250- }
251-
252- compileKotlin {
253- kotlinOptions. jvmTarget = " 11"
254- }
255-
256- compileTestKotlin. kotlinOptions. jvmTarget = " 11"
257-
258120dependencyCheck {
259- formats = [' SARIF' , ' JSON' , ' HTML' ]
260- failBuildOnCVSS = 5
261121 suppressionFile = file(' suppressions.xml' )
262- analyzers {
263- assemblyEnabled = false
264- nugetconfEnabled = false
265- nodeEnabled = false
266- }
267- }
268-
269- licenseReport {
270- def licenseNormalizerBundlePath = " $buildDir /license-normalizer-bundle.json"
271-
272- if (! file(licenseNormalizerBundlePath). exists()) {
273- download. run {
274- src ' https://raw.githubusercontent.com/th2-net/.github/main/license-compliance/gradle-license-report/license-normalizer-bundle.json'
275- dest " $buildDir /license-normalizer-bundle.json"
276- overwrite false
277- }
278- }
279-
280- filters = [
281- new LicenseBundleNormalizer (licenseNormalizerBundlePath, false )
282- ]
283- renderers = [
284- new JsonReportRenderer (' licenses.json' , false ),
285- ]
286- excludeOwnGroup = false
287- allowedLicensesFile = new URL (" https://raw.githubusercontent.com/th2-net/.github/main/license-compliance/gradle-license-report/allowed-licenses.json" )
288122}
0 commit comments