Skip to content

Commit e209f94

Browse files
authored
Migrated to th2 gradle plugin: 0.1.1 (#36)
* updated th2-codec version (added gRPC interface) * transport protocol, book&page, gRPC (#29) * migration to book and pages * th2 transport protocol support * gRPC connection support * dependencies updated * gradle updated * th2 gradle plugin updated * wordkflows updated * version updated
1 parent 042b6a7 commit e209f94

File tree

8 files changed

+45
-61
lines changed

8 files changed

+45
-61
lines changed

.github/workflows/ci-unwelcome-words.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ on:
55

66
jobs:
77
test:
8-
runs-on: ubuntu-20.04
8+
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2
11-
with:
12-
ref: ${{ github.sha }}
13-
- name: Checkout tool
14-
uses: actions/checkout@v2
15-
with:
16-
repository: exactpro-th2/ci-github-action
17-
ref: master
18-
token: ${{ secrets.PAT_CI_ACTION }}
19-
path: ci-github-action
20-
- name: Run CI action
21-
uses: ./ci-github-action
22-
with:
23-
ref: ${{ github.sha }}
10+
- uses: actions/checkout@v4
11+
with:
12+
ref: ${{ github.sha }}
13+
- name: Checkout tool
14+
uses: actions/checkout@v4
15+
with:
16+
repository: exactpro-th2/ci-github-action
17+
ref: master
18+
token: ${{ secrets.PAT_CI_ACTION }}
19+
path: ci-github-action
20+
- name: Run CI action
21+
uses: ./ci-github-action
22+
with:
23+
ref: ${{ github.sha }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM gradle:7.6-jdk11 AS build
1+
FROM gradle:8.7-jdk11 AS build
22
ARG release_version
33
COPY ./ .
44
RUN gradle build dockerPrepare \

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Csv codec (5.3.1)
1+
# Csv codec (5.4.0)
22

33
## Description
44

@@ -53,11 +53,7 @@ into
5353
{
5454
"A": 1,
5555
"B": 2,
56-
"V": [
57-
3,
58-
4,
59-
5
60-
],
56+
"V": [ 3, 4, 5 ],
6157
"G": 6,
6258
"D": 7
6359
}
@@ -141,6 +137,11 @@ spec:
141137

142138
## Release notes
143139

140+
### 5.4.0
141+
+ Migrated to th2 gradle plugin: `0.1.1`
142+
+ Updated common: `5.14.0-dev`
143+
+ Updated kotlin-logging: `5.1.4`
144+
144145
### 5.3.1
145146
+ Migrated to th2 gradle plugin: `0.0.8`
146147

@@ -214,4 +215,4 @@ spec:
214215
default configuration
215216
+ update Cradle version. Introduce async API for storing events
216217
+ removed gRPC event loop handling
217-
+ fixed dictionary reading
218+
+ fixed dictionary reading

build.gradle

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
plugins {
22
id "org.jetbrains.kotlin.jvm" version "1.8.22"
33
id "org.jetbrains.kotlin.kapt" version "1.8.22"
4-
id("java-library")
5-
id("maven-publish")
6-
7-
id "com.exactpro.th2.gradle.publish" version "0.0.8"
8-
id "com.exactpro.th2.gradle.component" version "0.0.8"
4+
id "maven-publish"
5+
id "com.exactpro.th2.gradle.publish" version "0.1.1"
6+
id "com.exactpro.th2.gradle.component" version "0.1.1"
97
}
108

119
group = 'com.exactpro.th2'
1210
version = release_version
1311

14-
kotlin {
15-
jvmToolchain(11)
16-
}
12+
kotlin.jvmToolchain(11)
1713

1814
repositories {
1915
mavenCentral()
@@ -34,34 +30,22 @@ repositories {
3430
}
3531

3632
dependencies {
37-
implementation "com.exactpro.th2:common:5.10.1-dev"
33+
implementation "com.exactpro.th2:common:5.14.0-dev"
3834
implementation "com.exactpro.th2:common-utils:2.2.3-dev"
3935
implementation "com.exactpro.th2:codec:5.5.0-dev"
4036

4137
implementation "org.apache.commons:commons-lang3"
4238
implementation "com.fasterxml.jackson.core:jackson-databind"
43-
4439
implementation "net.sourceforge.javacsv:javacsv:2.0"
45-
46-
implementation "io.github.microutils:kotlin-logging:3.0.5"
40+
implementation "io.github.oshai:kotlin-logging:5.1.4"
4741

4842
compileOnly "com.google.auto.service:auto-service-annotations:1.1.1"
4943
kapt "com.google.auto.service:auto-service:1.1.1"
5044

5145
testImplementation "org.jetbrains.kotlin:kotlin-test-junit"
52-
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2'
53-
testImplementation 'org.mockito.kotlin:mockito-kotlin:5.3.1'
54-
testImplementation 'io.strikt:strikt-core:0.34.1'
46+
testImplementation "org.junit.jupiter:junit-jupiter:5.10.3"
5547
}
5648

57-
application {
58-
mainClass.set("com.exactpro.th2.codec.MainKt")
59-
}
60-
61-
test {
62-
useJUnitPlatform()
63-
}
64-
65-
dependencyCheck {
66-
suppressionFile='supressions.xml'
67-
}
49+
application.mainClass = "com.exactpro.th2.codec.MainKt"
50+
test.useJUnitPlatform()
51+
dependencyCheck.suppressionFile = "supressions.xml"

gradle.properties

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
release_version=5.3.1
1+
release_version=5.4.0
22
description='th2 codec csv'
3-
vcs_url=https://github.com/th2-net/th2-codec-csv
4-
3+
vcs_url=https://github.com/th2-net/th2-codec-csv

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip

src/main/kotlin/com/exactpro/th2/codec/csv/AbstractDecoder.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023 Exactpro (Exactpro Systems Limited)
2+
* Copyright 2023-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.
@@ -18,7 +18,7 @@ package com.exactpro.th2.codec.csv
1818

1919
import com.csvreader.CsvReader
2020
import com.exactpro.th2.codec.DecodeException
21-
import mu.KotlinLogging
21+
import io.github.oshai.kotlinlogging.KotlinLogging
2222
import java.io.ByteArrayInputStream
2323
import java.io.IOException
2424
import java.nio.charset.Charset
@@ -111,9 +111,9 @@ abstract class AbstractDecoder<ANY_MESSAGE, RAW_MESSAGE, PARSED_MESSAGE, BODY_FI
111111
LOGGER.debug { "Set header to: ${strings.contentToString()}" }
112112
header = strings
113113
if (publishHeader) {
114-
//groupBuilder += createHeadersMessage(rawMessage, strings, currentIndex)
115-
groupBuilder += createParsedMessage(rawMessage,
116-
HEADER_MSG_TYPE, mapOf(HEADER_FIELD_NAME to strings.toFieldValue()), currentIndex)
114+
groupBuilder += createParsedMessage(
115+
rawMessage, HEADER_MSG_TYPE, mapOf(HEADER_FIELD_NAME to strings.toFieldValue()), currentIndex
116+
)
117117
}
118118
continue
119119
}
@@ -122,7 +122,7 @@ abstract class AbstractDecoder<ANY_MESSAGE, RAW_MESSAGE, PARSED_MESSAGE, BODY_FI
122122
"Wrong fields count in message. Expected count: %d; actual: %d; session alias: %s",
123123
header.size, strings.size, rawMessage.messageSessionAlias
124124
)
125-
LOGGER.error(msg)
125+
LOGGER.error { msg }
126126
LOGGER.debug { rawMessage.toString() }
127127
errors.add(ErrorHolder(msg, rawMessage))
128128
}

src/main/kotlin/com/exactpro/th2/codec/csv/CsvCodec.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023 Exactpro (Exactpro Systems Limited)
2+
* Copyright 2023-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.
@@ -21,7 +21,7 @@ import com.exactpro.th2.codec.api.IReportingContext
2121
import com.exactpro.th2.codec.csv.cfg.CsvCodecConfiguration
2222
import com.exactpro.th2.common.grpc.MessageGroup as ProtoMessageGroup
2323
import com.exactpro.th2.common.schema.message.impl.rabbitmq.transport.MessageGroup
24-
import mu.KotlinLogging
24+
import io.github.oshai.kotlinlogging.KotlinLogging
2525
import java.nio.charset.Charset
2626

2727
class CsvCodec(private val config: CsvCodecConfiguration) : IPipelineCodec {

0 commit comments

Comments
 (0)