Skip to content

Commit

Permalink
Migrate to th2 gradle plugin 0.0.6 (#365)
Browse files Browse the repository at this point in the history
+ Updated bom: `4.6.1`
+ Updated common: `5.11.0-dev`
+ Updated common-utils: `2.2.3-dev`
+ Updated cradle api: `5.3.0-dev`
+ Updated grpc-data-provider: `0.2.0-dev`
  • Loading branch information
Nikita-Smirnov-Exactpro authored May 15, 2024
1 parent 5057a58 commit 04c9c8b
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 94 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-dev-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ jobs:
createTag: true
docker-username: ${{ github.actor }}
secrets:
docker-password: ${{ secrets.GITHUB_TOKEN }}
docker-password: ${{ secrets.GITHUB_TOKEN }}
nvd-api-key: ${{ secrets.NVD_APIKEY }}
3 changes: 2 additions & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ jobs:
createTag: true
docker-username: ${{ github.actor }}
secrets:
docker-password: ${{ secrets.GITHUB_TOKEN }}
docker-password: ${{ secrets.GITHUB_TOKEN }}
nvd-api-key: ${{ secrets.NVD_APIKEY }}
3 changes: 2 additions & 1 deletion .github/workflows/build-sanpshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ jobs:
build-target: 'Docker'
docker-username: ${{ github.actor }}
secrets:
docker-password: ${{ secrets.GITHUB_TOKEN }}
docker-password: ${{ secrets.GITHUB_TOKEN }}
nvd-api-key: ${{ secrets.NVD_APIKEY }}
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Report data provider (5.10.0)
# Report data provider (5.11.0)

# Overview
This component serves as a backend for rpt-viewer. It will connect to the cassandra database via cradle api and expose the data stored in there as REST resources.
Expand Down Expand Up @@ -295,6 +295,14 @@ spec:

# Release notes

## 5.11.0
+ Migrate to th2 gradle plugin `0.0.6`
+ Updated bom: `4.6.1`
+ Updated common: `5.11.0-dev`
+ Updated common-utils: `2.2.3-dev`
+ Updated cradle api: `5.3.0-dev`
+ Updated grpc-data-provider: `0.2.0-dev`

## 5.10.0
+ Updated cradle api: `5.2.0-dev`
+ Updated common: `5.8.0-dev`
Expand Down
105 changes: 17 additions & 88 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import com.github.jk1.license.filter.LicenseBundleNormalizer
import com.github.jk1.license.render.JsonReportRenderer

plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.8.22'
id "com.exactpro.th2.gradle.component" version "0.0.6"
id 'application'
id 'com.palantir.docker' version '0.25.0'
id "org.owasp.dependencycheck" version "9.0.9"
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"
}

ext {
dockerImageVersion = release_version
cradleVersion = '5.2.0-dev'
cradleVersion = '5.3.0-dev'
}

group 'com.exactpro.th2'
version release_version

kotlin {
jvmToolchain(11)
}

repositories {
mavenCentral()
maven {
Expand All @@ -33,10 +30,12 @@ repositories {
}
}

configurations.configureEach {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
}

dependencies {
api platform('com.exactpro.th2:bom:4.5.0')

implementation 'org.slf4j:slf4j-api'

implementation 'com.fasterxml.jackson.core:jackson-core'
Expand All @@ -47,19 +46,19 @@ dependencies {

implementation 'org.apache.commons:commons-lang3'

implementation('com.exactpro.th2:common:5.8.0-dev') {
implementation('com.exactpro.th2:common:5.11.0-dev') {
exclude group: 'com.exactpro.th2', module: 'cradle-core'
exclude group: 'com.exactpro.th2', module: 'cradle-cassandra'
}
implementation 'com.exactpro.th2:common-utils:2.2.2-dev'
implementation 'com.exactpro.th2:common-utils:2.2.3-dev'

implementation "com.exactpro.th2:cradle-core:${cradleVersion}"

implementation "com.exactpro.th2:cradle-cassandra:${cradleVersion}"

implementation 'com.exactpro.th2:grpc-data-provider:0.1.8'
implementation 'com.exactpro.th2:grpc-data-provider:0.2.0-dev'

implementation 'io.github.microutils:kotlin-logging:3.0.0' // The last version bases on kotlin 1.6.0
implementation 'io.github.microutils:kotlin-logging:3.0.5'

implementation 'io.prometheus:simpleclient'

Expand All @@ -85,87 +84,17 @@ tasks.withType(KotlinCompile).configureEach {
}
}

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
)
}
application {
mainClassName = "com.exactpro.th2.rptdataprovider.MainKt"
}

applicationName = 'service'

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

test {
// FIXME: the tests were temporary disabled since they're not compatible with new api

// useJUnitPlatform()
}

dockerPrepare {
dependsOn distTar
}

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


compileKotlin {
kotlinOptions.jvmTarget = "11"
}

compileTestKotlin {
kotlinOptions.jvmTarget = "11"
}

application {
mainClassName = "com.exactpro.th2.rptdataprovider.MainKt"
}

configurations.configureEach {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
}

dependencyCheck {
formats=['SARIF', 'JSON', 'HTML']
suppressionFile='supressions.xml'
failBuildOnCVSS=5

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")
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@

kotlin.code.style=official

release_version=5.10.0
release_version=5.11.0

docker_image_name=
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
################################################################################

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

0 comments on commit 04c9c8b

Please sign in to comment.