-
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.
[TH2-1836] Migrated to th2 gradle plugin:
0.0.7
* Updated bom: `4.6.1` * Updated common: `5.11.1-dev` * Updated common-utils: `2.2.3-dev` * Updated cradle api: `5.3.0-dev`
- Loading branch information
1 parent
9418587
commit 31d49b6
Showing
3 changed files
with
24 additions
and
186 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,8 @@ | ||
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("java") | ||
id("maven-publish") | ||
|
||
ext { | ||
cradleVersion = '5.2.0-dev' | ||
id "com.exactpro.th2.gradle.component" version "0.0.7" | ||
} | ||
|
||
group = 'com.exactpro.th2' | ||
|
@@ -24,146 +11,35 @@ version = release_version | |
sourceCompatibility = 11 | ||
targetCompatibility = 11 | ||
|
||
ext { | ||
cradleVersion = '5.3.0-dev' | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
|
||
maven { | ||
name 'Sonatype_snapshots' | ||
url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' | ||
} | ||
|
||
maven { | ||
name 'Sonatype_releases' | ||
url 'https://s01.oss.sonatype.org/content/repositories/releases/' | ||
} | ||
mavenLocal() | ||
|
||
configurations.configureEach { | ||
resolutionStrategy.cacheChangingModulesFor 0, 'seconds' | ||
resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds' | ||
} | ||
} | ||
|
||
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.1-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' | ||
|
@@ -187,60 +63,14 @@ dependencies { | |
testImplementation 'org.mockito:mockito-junit-jupiter:5.10.0' | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
application { | ||
mainClassName 'com.exactpro.th2.estore.EventStore' | ||
} | ||
|
||
applicationName = 'service' | ||
|
||
distTar { | ||
archiveName "${applicationName}.tar" | ||
} | ||
|
||
dockerPrepare { | ||
dependsOn distTar | ||
} | ||
|
||
docker { | ||
copySpec.from(tarTree("$buildDir/distributions/${applicationName}.tar")) | ||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
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") | ||
} | ||
suppressionFile='supressions.xml' | ||
} |
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,4 +1,4 @@ | ||
release_version=5.5.0 | ||
release_version=5.6.0 | ||
description='th2 estore component' | ||
vcs_url=https://github.com/th2-net/th2-estore | ||
|