Skip to content

Commit f7fb8a1

Browse files
Migrated to th2 gradle plugin: 0.0.6 (#196)
* Migrated to release version codec:5.5.0-dev
1 parent a4904cc commit f7fb8a1

File tree

8 files changed

+53
-210
lines changed

8 files changed

+53
-210
lines changed
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
name: Build and publish dev-release Java distributions to sonatype.
1+
name: Build and publish dev release jar to sonatype
22

3-
on:
4-
push:
5-
tags:
6-
- \d+.\d+.\d+-dev
3+
on: workflow_dispatch
74

85
jobs:
96
build:
107
uses: th2-net/.github/.github/workflows/compound-java.yml@main
118
with:
129
build-target: 'Sonatype'
13-
runsOn: ubuntu-latest
1410
devRelease: true
11+
createTag: true
1512
secrets:
1613
sonatypeUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
1714
sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
1815
sonatypeSigningKey: ${{ secrets.SONATYPE_GPG_ARMORED_KEY }}
19-
sonatypeSigningPassword: ${{ secrets.SONATYPE_SIGNING_PASSWORD }}
16+
sonatypeSigningPassword: ${{ secrets.SONATYPE_SIGNING_PASSWORD }}
17+
nvd-api-key: ${{ secrets.NVD_APIKEY }}
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
1-
name: Build and release Java distributions to sonatype.
1+
name: Build and publish release jar to sonatype
22

3-
on:
4-
push:
5-
branches:
6-
- master
7-
- version-*
8-
paths:
9-
- gradle.properties
3+
on: workflow_dispatch
104

115
jobs:
126
build:
137
uses: th2-net/.github/.github/workflows/compound-java.yml@main
148
with:
159
build-target: 'Sonatype'
16-
runsOn: ubuntu-latest
10+
devRelease: false
11+
createTag: true
1712
secrets:
1813
sonatypeUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
1914
sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
2015
sonatypeSigningKey: ${{ secrets.SONATYPE_GPG_ARMORED_KEY }}
2116
sonatypeSigningPassword: ${{ secrets.SONATYPE_SIGNING_PASSWORD }}
17+
nvd-api-key: ${{ secrets.NVD_APIKEY }}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: Dev build and publish Java distributions to sonatype snapshot repository
1+
name: Build and publish snapshot jar to sonatype
22

33
on:
44
push:
55
branches-ignore:
6-
- master
7-
- version-*
8-
- dependabot*
6+
- master
7+
- version-*
8+
- dependabot**
99
paths-ignore:
1010
- README.md
1111

@@ -14,9 +14,9 @@ jobs:
1414
uses: th2-net/.github/.github/workflows/compound-java-dev.yml@main
1515
with:
1616
build-target: 'Sonatype'
17-
runsOn: ubuntu-latest
1817
secrets:
1918
sonatypeUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
2019
sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
2120
sonatypeSigningKey: ${{ secrets.SONATYPE_GPG_ARMORED_KEY }}
2221
sonatypeSigningPassword: ${{ secrets.SONATYPE_SIGNING_PASSWORD }}
22+
nvd-api-key: ${{ secrets.NVD_APIKEY }}

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# How it works (5.0.0)
1+
# How it works (5.1.0)
22

33
The th2 codec sailfish component is responsible for encoding and decoding the messages.
44
It operates two instances of encoder/decoder pairs, in which one is used for operational purposes and the other is used for general conversion.
@@ -237,6 +237,15 @@ The filtering can also be applied for pins with `subscribe` attribute.
237237

238238
## Release notes
239239

240+
### 5.1.0
241+
+ Migrated to th2 gradle plugin: `0.0.6`
242+
+ Updated:
243+
+ bom `4.6.1`
244+
+ common: `5.10.1-dev`
245+
+ common-utils: `2.2.3-dev`
246+
+ codec: `5.5.0-dev`
247+
+ sailfish: `3.3.202`
248+
240249
+ 5.0.0
241250
+ Migrate to th2-codec base
242251
+ sailfish: `3.3.169`

build.gradle

Lines changed: 18 additions & 184 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,15 @@
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-
181
plugins {
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

3310
ext {
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")
@@ -44,6 +21,10 @@ ext {
4421
group 'com.exactpro.th2'
4522
version release_version
4623

24+
kotlin {
25+
jvmToolchain(11)
26+
}
27+
4728
ext.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

10283
configurations {
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

11290
dependencies {
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-
258120
dependencyCheck {
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
}

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2020-2023 Exactpro (Exactpro Systems Limited)
2+
# Copyright 2020-2024 Exactpro (Exactpro Systems Limited)
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -16,4 +16,4 @@
1616
kotlin.code.style=official
1717
description='th2 codec-sailfish library'
1818
vcs_url=https://github.com/th2-net/th2-codec-sailfish
19-
release_version=5.0.0
19+
release_version=5.1.0

gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2020-2020 Exactpro (Exactpro Systems Limited)
2+
# Copyright 2020-2024 Exactpro (Exactpro Systems Limited)
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
1515
#
1616

1717
#Tue Apr 14 11:21:33 MSK 2020
18-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
18+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
1919
distributionBase=GRADLE_USER_HOME
2020
distributionPath=wrapper/dists
2121
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)