Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master' into TH2-52…
Browse files Browse the repository at this point in the history
…04-external-executor

# Conflicts:
#	README.md
#	build.gradle
#	cradle-cassandra/build.gradle
#	cradle-core/build.gradle
#	gradle.properties
  • Loading branch information
Oleg Smelov committed Jun 4, 2024
2 parents 9a79820 + b345db3 commit 3150d14
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 153 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ Test events have mandatory parameters that are verified when storing an event. T
### 5.4.0
* Using separate executor instead of ForkJoinPool.commonPool()

### 5.3.0
+ Migrated to th2 gradle plugin: `0.0.5` (bom: `4.6.1`)
+ Updated bom: `4.6.1`

### 5.2.0
* Added page cache for each book to avoid memory leak

Expand Down
144 changes: 2 additions & 142 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,35 +1,16 @@
plugins {
id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
id "org.owasp.dependencycheck" version "9.0.10"
id 'signing'
}

ext {
sharedDir = file("${project.rootDir}/shared")
id "com.exactpro.th2.gradle.base" version "0.0.5"
id "com.exactpro.th2.gradle.publish" version "0.0.5"
}

allprojects {
version = release_version
group = 'com.exactpro.th2'

dependencyCheck {
formats = ['SARIF', 'JSON', 'HTML']
failBuildOnCVSS = 5
suppressionFile = "${rootDir}/suppressions.xml"
analyzers {
assemblyEnabled = false
nugetconfEnabled = false
nodeEnabled = false
}
}

}

subprojects {
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'org.owasp.dependencycheck'

repositories {
mavenCentral()
Expand All @@ -48,132 +29,11 @@ subprojects {
}
}


defaultTasks 'build'

sourceCompatibility = JavaVersion.VERSION_11 //Java version compatibility to use when compiling Java source.
targetCompatibility = JavaVersion.VERSION_11 //Java version to generate classes for.
compileJava.options.debugOptions.debugLevel = 'source,lines,vars' // Include debug information

dependencies {
implementation 'io.prometheus:simpleclient_dropwizard:0.16.0'
}

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,
'Implementation-Version-Date': getDate()
)
}
}

java {
withJavadocJar()
withSourcesJar()
}

// conditionals for publications
tasks.withType(PublishToMavenRepository).configureEach {
onlyIf {
(repository == publishing.repositories.nexusRepository &&
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 == 'initializeSonatypeStagingRepository' &&
!(project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword'))
) {
task.enabled = false
}
}

publishing {
publications {
mavenJava(MavenPublication) {
from(components.java)
pom {
name = project.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 = 'nexusRepository'
credentials {
username = project.findProperty('nexus_user')
password = project.findProperty('nexus_password')
}
url = project.findProperty('nexus_url')
}
}
}

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

}
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
tasks.register("listProjects") {
doLast {
subprojects.forEach { println(it.name) }
}
}

static def getDate() {
def date = new Date()
def formattedDate = date.format('yyyyMMdd-HH:mm:ss.SSS')
return formattedDate
}
7 changes: 0 additions & 7 deletions cradle-cassandra/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ dependencies {
testImplementation 'org.testcontainers:cassandra:1.19.8'
}

def gen_dir = 'build/generated/sources/annotationProcessor/main'
sourceSets.main.java.srcDirs += [gen_dir]

compileJava {
options.annotationProcessorGeneratedSourcesDirectory = file("${projectDir}/${gen_dir}")
}

test {
useTestNG() {
suites "src/test/resources/core.xml"
Expand Down
2 changes: 0 additions & 2 deletions cradle-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
dependencies {
api platform('com.exactpro.th2:bom:4.6.1')

implementation "com.fasterxml.jackson.core:jackson-databind"
implementation "org.apache.commons:commons-lang3"

Expand Down
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.4.0
description='Cradle API'
vcs_url=https://github.com/th2-net/cradleapi
vcs_url=https://github.com/th2-net/cradleapi
1 change: 0 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ include 'cradle-cassandra'
// Defined names will be used for jar and artifact names
project(':cradle-core').name = 'cradle-core'
project(':cradle-cassandra').name = 'cradle-cassandra'
startParameter.setWriteDependencyLocks(true)

0 comments on commit 3150d14

Please sign in to comment.