-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3555ba0
commit 4ca0bc6
Showing
7 changed files
with
24 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
|
@@ -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' | ||
|
@@ -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") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |