Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to th2 gradle plugin 0.0.6 #21

Merged
merged 3 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/build-dev-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Build and publish dev release Docker image to Github Container Registry ghcr.io

on: workflow_dispatch

jobs:
build:
uses: th2-net/.github/.github/workflows/compound-java.yml@main
with:
build-target: 'Docker'
devRelease: true
createTag: true
docker-username: ${{ github.actor }}
secrets:
docker-password: ${{ secrets.GITHUB_TOKEN }}
nvd-api-key: ${{ secrets.NVD_APIKEY }}
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
name: Build and publish Docker distributions to Github Container Registry ghcr.io
name: Build and publish release Docker image to Github Container Registry ghcr.io

on:
push:
branches:
- master
- version-*
paths:
- gradle.properties
# - package_info.json
on: workflow_dispatch

jobs:
build-job:
build:
uses: th2-net/.github/.github/workflows/compound-java.yml@main
with:
build-target: 'Docker'
devRelease: false
createTag: true
docker-username: ${{ github.actor }}
secrets:
docker-password: ${{ secrets.GITHUB_TOKEN }}

nvd-api-key: ${{ secrets.NVD_APIKEY }}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: Dev build and publish Docker distributions to Github Container Registry ghcr.io
name: Build and publish Docker image to Github Container Registry ghcr.io

on:
push:
branches-ignore:
- master
- version-*
- dev-version-*
- dependabot**
paths-ignore:
- README.md
Expand All @@ -18,3 +17,4 @@ jobs:
docker-username: ${{ github.actor }}
secrets:
docker-password: ${{ secrets.GITHUB_TOKEN }}
nvd-api-key: ${{ secrets.NVD_APIKEY }}
22 changes: 0 additions & 22 deletions .github/workflows/dev-release-java-publish-sonatype-and-docker.yml

This file was deleted.

11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Csv Reader User Manual 2.3.0
# Csv Reader User Manual 2.4.0

## Document Information

Expand Down Expand Up @@ -91,6 +91,15 @@ spec:

## Changes

### 2.4.0

#### Updated:
+ Migrate to th2 gradle plugin `0.0.6`
+ bom: `4.6.1`
+ common: `5.11.0-dev`
+ read-file-common-core: `3.3.0-dev`
+ jakarta.annotation-api: `3.0.0`

### 2.3.0

#### Updated:
Expand Down
106 changes: 14 additions & 92 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,68 +1,18 @@
/*
* Copyright 2020-2023 Exactpro (Exactpro Systems Limited)
*
* 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.
*/

import com.github.jk1.license.filter.LicenseBundleNormalizer
import com.github.jk1.license.render.JsonReportRenderer

plugins {
id 'java-library'
id 'application'
id 'com.palantir.docker' version '0.25.0'
id 'org.jetbrains.kotlin.jvm' version '1.8.22'
id "org.owasp.dependencycheck" version "8.4.0"
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.5.0"
}

dependencyCheck {
formats=['SARIF', 'JSON', 'HTML']
failBuildOnCVSS=5
suppressionFile = file('suppressions.xml')

analyzers {
assemblyEnabled = false
nugetconfEnabled = false
nodeEnabled = false
}
}

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")
id 'com.exactpro.th2.gradle.component' version '0.0.6'
}

group 'com.exactpro.th2'
version release_version

kotlin {
jvmToolchain(11)
}

repositories {
mavenCentral()

maven {
name 'Sonatype_snapshots'
url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
Expand All @@ -71,7 +21,6 @@ repositories {
name 'Sonatype_releases'
url 'https://s01.oss.sonatype.org/content/repositories/releases/'
}

mavenLocal()

configurations.configureEach {
Expand All @@ -81,18 +30,17 @@ repositories {
}

dependencies {
api platform("com.exactpro.th2:bom:4.5.0")
implementation ("com.exactpro.th2:common:5.7.1-dev")
implementation ("com.exactpro.th2:common:5.11.0-dev")
implementation "org.slf4j:slf4j-api"

api "com.exactpro.th2:read-file-common-core:3.2.0-dev"
api "com.exactpro.th2:read-file-common-core:3.3.0-dev"
implementation('com.exactpro.th2:netty-bytebuf-utils:0.2.0') {
because("'asExpandable' method is used")
}

implementation "com.opencsv:opencsv:5.9"

implementation "javax.annotation:javax.annotation-api:1.3.2"
implementation 'jakarta.annotation:jakarta.annotation-api:3.0.0'
implementation "org.jetbrains.kotlin:kotlin-reflect"

implementation "com.fasterxml.jackson.core:jackson-databind"
Expand All @@ -101,44 +49,18 @@ dependencies {
}
implementation "com.fasterxml.jackson.module:jackson-module-kotlin"

testImplementation "org.junit.jupiter:junit-jupiter:5.10.0"
testImplementation "org.mockito:mockito-core:3.6.0"
testImplementation "org.junit.jupiter:junit-jupiter:5.10.2"
testImplementation "org.mockito:mockito-core:5.12.0"
}

test {
useJUnitPlatform()
}

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
)
}
}

description = 'CSV reader client'
sourceCompatibility = '11'
applicationName = 'service'

distTar {
archiveName "${applicationName}.tar"
}

dockerPrepare {
dependsOn distTar
}

docker {
copySpec.from(tarTree("$buildDir/distributions/${applicationName}.tar"))
}

application {
mainClassName = "com.exactpro.th2.readcsv.Main"
}

dependencyCheck {
suppressionFile = file('suppressions.xml')
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
release_version=2.3.0
release_version = 2.4.0
Loading