Skip to content

Commit

Permalink
Migrated to th2 gradle plugin 0.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita-Smirnov-Exactpro committed May 17, 2024
1 parent 3555ba0 commit 4ca0bc6
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 177 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 }}
4 changes: 2 additions & 2 deletions .github/workflows/ci-unwelcome-words.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
- name: Checkout tool
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: exactpro-th2/ci-github-action
ref: master
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Overview (5.5.0)
# Overview (5.6.0)

Event store (estore) is an important th2 component responsible for storing events into Cradle. Please refer to [Cradle repository] (https://github.com/th2-net/cradleapi/blob/master/README.md) for more details. This component has a pin for listening events via MQ.

Expand Down Expand Up @@ -73,6 +73,14 @@ Please see more details about this feature via [link](https://github.com/th2-net

# Changes

## 5.6.0

* Migrated 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`

## 5.5.0

* Updated bom: `4.6.0`
Expand Down
176 changes: 6 additions & 170 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
import com.github.jk1.license.filter.LicenseBundleNormalizer
import com.github.jk1.license.render.JsonReportRenderer

plugins {
id 'java'
id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
id 'maven-publish'
id 'signing'
id 'java-library'
id 'application'
id 'com.palantir.docker' version '0.25.0'
id "org.owasp.dependencycheck" version "9.0.9"
id 'com.github.jk1.dependency-license-report' version '2.5'
id "de.undercouch.download" version "5.4.0"
id "application"
id "com.exactpro.th2.gradle.component" version "0.0.6"
}

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

group = 'com.exactpro.th2'
Expand Down Expand Up @@ -43,127 +32,20 @@ repositories {
}
}

java {
withJavadocJar()
withSourcesJar()
}

javadoc {
options.addStringOption('Xdoclint:none', '-quiet')
}

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

configurations.configureEach {
resolutionStrategy {
force "com.exactpro.th2:cradle-core:$cradleVersion"
force "com.exactpro.th2:cradle-cassandra:$cradleVersion"
}
}

// conditionals for publications
tasks.withType(PublishToMavenRepository).configureEach {
onlyIf {
(repository == publishing.repositories.nexus &&
project.hasProperty('nexus_user') &&
project.hasProperty('nexus_password') &&
project.hasProperty('nexus_url')) ||
(repository == publishing.repositories.sonatype &&
project.hasProperty('sonatypeUsername') &&
project.hasProperty('sonatypePassword'))
}
}
tasks.withType(Sign).configureEach {
onlyIf {
project.hasProperty('signingKey') &&
project.hasProperty('signingPassword')
}
}
// disable running task 'initializeSonatypeStagingRepository' on a gitlab
tasks.configureEach { task ->
if (task.name.equals('initializeSonatypeStagingRepository') &&
!(project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword'))
) {
task.enabled = false
}
}

publishing {
publications {
mavenJava(MavenPublication) {
from(components.java)
pom {
name = rootProject.name
packaging = 'jar'
description = rootProject.description
url = vcs_url
scm {
url = vcs_url
}
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'developer'
name = 'developer'
email = '[email protected]'
}
}
scm {
url = vcs_url
}
}
}
}
repositories {
//Nexus repo to publish from gitlab
maven {
name = 'nexus'
credentials {
username = project.findProperty('nexus_user')
password = project.findProperty('nexus_password')
}
url = project.findProperty('nexus_url')
}
}
}

nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}

signing {
String signingKey = findProperty("signingKey")
String signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}

dependencies {
api platform('com.exactpro.th2:bom:4.6.0')
implementation 'com.exactpro.th2:common:5.9.1-dev'
implementation("com.exactpro.th2:common-utils:2.2.2-dev") {
implementation 'com.exactpro.th2:common:5.11.0-dev'
implementation("com.exactpro.th2:common-utils:2.2.3-dev") {
because("executor service utils is used")
}
implementation 'com.exactpro.th2:task-utils:0.1.1'
Expand Down Expand Up @@ -195,52 +77,6 @@ application {
mainClassName 'com.exactpro.th2.estore.EventStore'
}

applicationName = 'service'

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

dockerPrepare {
dependsOn distTar
}

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

dependencyCheck {
formats = ['SARIF', 'JSON', 'HTML']
failBuildOnCVSS = 5
suppressionFile = file('suppressions.xml')
analyzers {
assemblyEnabled = false
nugetconfEnabled = false
nodeEnabled = false
}
}

dependencyLocking {
lockAllConfigurations()
}

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
@@ -1,3 +1,3 @@
release_version=5.5.0
release_version=5.6.0
description='th2 estore component'
vcs_url=https://github.com/th2-net/th2-estore

0 comments on commit 4ca0bc6

Please sign in to comment.