Skip to content

Commit

Permalink
chore: apply consistent gradle file formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardas-buc committed Dec 13, 2023
1 parent a4e313a commit 94d6845
Show file tree
Hide file tree
Showing 47 changed files with 625 additions and 1,519 deletions.
14 changes: 7 additions & 7 deletions src/addons/hwtoken/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
dependencies {
implementation(project(':signer')) {
exclude group: 'org.springframework', module: 'spring-context'
}
implementation(project(':signer-protocol'))
implementation(project(':common:common-util'))
implementation(project(':signer')) {
exclude group: 'org.springframework', module: 'spring-context'
}
implementation(project(':signer-protocol'))
implementation(project(':common:common-util'))

// Necessary since there are jars with no adequate Maven dependencies
implementation fileTree(dir: '../../libs', include: '*.jar')
// Necessary since there are jars with no adequate Maven dependencies
implementation fileTree(dir: '../../libs', include: '*.jar')
}
20 changes: 10 additions & 10 deletions src/addons/messagelog/messagelog-archive-verifier/build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
plugins {
id("java")
id 'com.github.johnrengelman.shadow'
id("java")
id 'com.github.johnrengelman.shadow'
}

dependencies {
implementation project(':common:common-util')
implementation project(':common:common-util')
}

ext {
mainClassName = 'org.niis.xroad.cli.ArchiveHashChainVerifier'
mainClassName = 'org.niis.xroad.cli.ArchiveHashChainVerifier'
}

jar {
manifest {
attributes 'Main-Class': mainClassName
}
manifest {
attributes 'Main-Class': mainClassName
}
}

shadowJar {
archiveVersion = ''
archiveClassifier = ''
from rootProject.file("LICENSE.txt")
archiveVersion = ''
archiveClassifier = ''
from rootProject.file("LICENSE.txt")
}

jar.enabled = false
Expand Down
10 changes: 5 additions & 5 deletions src/addons/messagelog/messagelog-archiver/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jar {
}

shadowJar {
archiveVersion = ''
archiveClassifier = ''
exclude('**/module-info.class')
from rootProject.file("LICENSE.txt")
mergeServiceFiles()
archiveVersion = ''
archiveClassifier = ''
exclude('**/module-info.class')
from rootProject.file("LICENSE.txt")
mergeServiceFiles()
}

assemble.dependsOn shadowJar
28 changes: 14 additions & 14 deletions src/addons/metaservice/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,27 @@ task runMetaserviceTest(type: JavaExec) {

if (System.getProperty('DEBUG', 'false') == 'true') {
jvmArgs '-Xdebug',
'-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005'
'-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005'
}

jvmArgs '-Dxroad.proxy.ocspCachePath=build/ocsp-cache',
'-Dxroad.tempFiles.path=build/attach-tmp',
'-Dxroad.proxy.configurationFile=../../systemtest/conf/local_test/serverconf_producer.xml',
'-Dxroad.proxy.jetty-serverproxy-configuration-file=src/test/resources/serverproxy.xml',
'-Dxroad.proxy.jetty-clientproxy-configuration-file=src/test/resources/clientproxy.xml',
'-Dlogback.configurationFile=src/test/resources/logback-metaservicetest.xml',
'-Dxroad.proxy.jetty-ocsp-responder-configuration-file=src/test/resources/ocsp-responder.xml',
'-Dxroad.proxy.client-connector-so-linger=-1',
'-Dxroad.proxy.client-httpclient-so-linger=-1',
'-Dxroad.proxy.server-connector-so-linger=-1',
'-Dxroad.proxy.serverServiceHandlers=ee.ria.xroad.proxy.serverproxy.MetadataServiceHandlerImpl',
'-Dxroad.proxy.clientHandlers=ee.ria.xroad.proxy.clientproxy.MetadataHandler',
'-Dxroad.common.grpc-internal-tls-enabled=false'
'-Dxroad.tempFiles.path=build/attach-tmp',
'-Dxroad.proxy.configurationFile=../../systemtest/conf/local_test/serverconf_producer.xml',
'-Dxroad.proxy.jetty-serverproxy-configuration-file=src/test/resources/serverproxy.xml',
'-Dxroad.proxy.jetty-clientproxy-configuration-file=src/test/resources/clientproxy.xml',
'-Dlogback.configurationFile=src/test/resources/logback-metaservicetest.xml',
'-Dxroad.proxy.jetty-ocsp-responder-configuration-file=src/test/resources/ocsp-responder.xml',
'-Dxroad.proxy.client-connector-so-linger=-1',
'-Dxroad.proxy.client-httpclient-so-linger=-1',
'-Dxroad.proxy.server-connector-so-linger=-1',
'-Dxroad.proxy.serverServiceHandlers=ee.ria.xroad.proxy.serverproxy.MetadataServiceHandlerImpl',
'-Dxroad.proxy.clientHandlers=ee.ria.xroad.proxy.clientproxy.MetadataHandler',
'-Dxroad.common.grpc-internal-tls-enabled=false'

mainClass = 'ee.ria.xroad.proxy.testsuite.ProxyTestSuite'
classpath = sourceSets.test.runtimeClasspath
}

jacoco {
applyTo runMetaserviceTest
applyTo runMetaserviceTest
}
16 changes: 8 additions & 8 deletions src/addons/op-monitoring/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
dependencies {
implementation project(':common:common-op-monitoring')
implementation project(':common:common-op-monitoring')

implementation project(':proxy')
implementation project(':common:common-util')
implementation project(':serverconf')
implementation project(':proxy')
implementation project(':common:common-util')
implementation project(':serverconf')

testImplementation project(':common:common-test')
testImplementation 'commons-cli:commons-cli:1.4'
testImplementation project(':common:common-test')
testImplementation 'commons-cli:commons-cli:1.4'
}

task runOpMonitoringBufferMemoryUsage(type: JavaExec) {
mainClass = 'ee.ria.xroad.proxy.opmonitoring.OpMonitoringBufferMemoryUsage'
classpath = sourceSets.test.runtimeClasspath
mainClass = 'ee.ria.xroad.proxy.opmonitoring.OpMonitoringBufferMemoryUsage'
classpath = sourceSets.test.runtimeClasspath
}
16 changes: 8 additions & 8 deletions src/addons/proxymonitor/common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,25 @@ task xjc() {

doLast {
ant.taskdef(name: 'xjc',
classname: 'com.sun.tools.xjc.XJCTask',
classpath: configurations.xjc.asPath)
classname: 'com.sun.tools.xjc.XJCTask',
classpath: configurations.xjc.asPath)

// Generate classes for identifiers
ant.xjc(
destdir: project.ext.schemaTargetDir,
package: 'ee.ria.xroad.proxymonitor.message',
schema: 'src/main/resources/monitoring.xsd',
binding: 'src/main/resources/jaxb-bindings.xml'
destdir: project.ext.schemaTargetDir,
package: 'ee.ria.xroad.proxymonitor.message',
schema: 'src/main/resources/monitoring.xsd',
binding: 'src/main/resources/jaxb-bindings.xml'
)
}

}

task licenseFormatJava(type:nl.javadude.gradle.plugins.license.License) {
task licenseFormatJava(type: nl.javadude.gradle.plugins.license.License) {
source = fileTree('src/main/java')
}

task licenseTestJava(type:nl.javadude.gradle.plugins.license.License) {
task licenseTestJava(type: nl.javadude.gradle.plugins.license.License) {
source = fileTree('src/main/java')
check = true
}
Expand Down
16 changes: 8 additions & 8 deletions src/addons/proxymonitor/metaservice/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ jar {
}

shadowJar {
archiveClassifier = ''
exclude('**/module-info.class')
dependencies {
include(project(':addons:proxymonitor-common'))
include(project(':monitor-common'))
include(project(':monitoring-conf'))
}
mergeServiceFiles()
archiveClassifier = ''
exclude('**/module-info.class')
dependencies {
include(project(':addons:proxymonitor-common'))
include(project(':monitor-common'))
include(project(':monitoring-conf'))
}
mergeServiceFiles()
}

build.dependsOn shadowJar
Expand Down
8 changes: 4 additions & 4 deletions src/addons/wsdlvalidator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ plugins {
}

ext {
mainClassName = 'ee.ria.xroad.wsdlvalidator.WSDLValidator'
mainClassName = 'ee.ria.xroad.wsdlvalidator.WSDLValidator'
}

jar {
manifest {
attributes 'Main-Class': mainClassName
}
manifest {
attributes 'Main-Class': mainClassName
}
}

repositories {
Expand Down
4 changes: 2 additions & 2 deletions src/asicverifier/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ plugins {
}

dependencies {
implementation project(':common:common-verifier'),
project(':asic-util')
implementation project(':common:common-verifier'),
project(':asic-util')

implementation(project(':common:common-util'))

Expand Down
115 changes: 58 additions & 57 deletions src/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ buildscript {
}

plugins {
id 'org.sonarqube' version '4.2.1.3168'
id 'org.owasp.dependencycheck' version '8.4.0'
id 'jacoco'
id 'java'
id 'idea'
id "io.spring.dependency-management" version "${springDependenciesVersion}" apply false
id 'org.springframework.boot' version "${springBootVersion}" apply false
id 'com.google.protobuf' version "$protobufGradleVersion" apply false
id 'org.siouan.frontend-jdk17' version "$frontendPluginVersion" apply false
id 'org.sonarqube' version '4.2.1.3168'
id 'org.owasp.dependencycheck' version '8.4.0'
id 'jacoco'
id 'java'
id 'idea'
id "io.spring.dependency-management" version "${springDependenciesVersion}" apply false
id 'org.springframework.boot' version "${springBootVersion}" apply false
id 'com.google.protobuf' version "$protobufGradleVersion" apply false
id 'org.siouan.frontend-jdk17' version "$frontendPluginVersion" apply false
}

repositories {
Expand Down Expand Up @@ -85,7 +85,7 @@ dependencyCheck {

group = 'ee.ria.xroad'
subprojects {
group = "${parent.group}.${name.replace(/\W/,"_")}"
group = "${parent.group}.${name.replace(/\W/, "_")}"
}

allprojects {
Expand Down Expand Up @@ -169,10 +169,10 @@ configure(subprojects.findAll { !["shared-ui", "ui"].contains(it.name) }) {
}
}
add('implementation', 'org.apache.commons:commons-text') {
because("Vulnerability fix regarding CVE-2022-42889")
version {
require("$commonsTextVersion")
}
because("Vulnerability fix regarding CVE-2022-42889")
version {
require("$commonsTextVersion")
}
}
add('implementation', 'com.fasterxml.woodstox:woodstox-core') {
because("Vulnerability fix regarding CVE-2022-40152")
Expand All @@ -198,9 +198,9 @@ configure(subprojects.findAll { !["shared-ui", "ui"].contains(it.name) }) {
intTestAnnotationProcessor "org.projectlombok:lombok:${lombokVersion}"
}

test {
useJUnitPlatform()
}
test {
useJUnitPlatform()
}

task testJar(type: Jar) {
classifier 'test'
Expand Down Expand Up @@ -265,9 +265,9 @@ configure(subprojects.findAll { !["shared-ui", "ui"].contains(it.name) }) {
header rootProject.file('LICENSE.txt')
include '**/*.java'
skipExistingHeaders = true
mapping {
java = 'SLASHSTAR_STYLE'
}
mapping {
java = 'SLASHSTAR_STYLE'
}
}

licenseMain.source = fileTree('src/main')
Expand All @@ -284,47 +284,48 @@ configure(subprojects.findAll { !["shared-ui", "ui"].contains(it.name) }) {
//Configure frontend projects
//apply from: "${rootDir}/build-frontend-subprojects.gradle"
import org.siouan.frontendgradleplugin.infrastructure.gradle.RunYarn

// Gradle script that is applied on frontend subprojects (namely ui,shared-ui)

configure(subprojects.findAll { ["shared-ui", "ui"].contains(it.name) }) {
apply plugin: 'org.siouan.frontend-jdk17'

frontend {
nodeVersion = frontendNodeVersion
nodeInstallDirectory = file("${rootDir}/.gradle/yarn-node/${frontendNodeVersion}")
cacheDirectory = file("${projectDir}/.gradle/yarn-cache")
nodeDistributionUrlRoot = 'https://artifactory.niis.org/artifactory/nodejs-dist-remote/'
maxDownloadAttempts = 3
if (System.getenv().containsKey("CI")) {
installScript='install --immutable'
apply plugin: 'org.siouan.frontend-jdk17'

frontend {
nodeVersion = frontendNodeVersion
nodeInstallDirectory = file("${rootDir}/.gradle/yarn-node/${frontendNodeVersion}")
cacheDirectory = file("${projectDir}/.gradle/yarn-cache")
nodeDistributionUrlRoot = 'https://artifactory.niis.org/artifactory/nodejs-dist-remote/'
maxDownloadAttempts = 3
if (System.getenv().containsKey("CI")) {
installScript = 'install --immutable'
}
}
}

tasks.register('checkFrontAudit', RunYarn) {
dependsOn assembleFrontend
inputs.files(
'package.json',
'yarn.lock'
)
outputs.files("${buildDir}/reports/audit-ci.txt")
script = 'run npx-check-audit'
}

// check that yarn run license-check passes
tasks.register('checkFrontLicense', RunYarn) {
dependsOn assembleFrontend
inputs.files("LICENSE.txt", "test/", "public/",fileTree('src/') {
exclude 'openapi-types'
})
outputs.upToDateWhen { true }
script = 'run license-check'
}

if (project.hasProperty('frontend-npm-audit')) {
assemble.dependsOn checkFrontAudit
}

checkFrontend.dependsOn checkFrontLicense

tasks.register('checkFrontAudit', RunYarn) {
dependsOn assembleFrontend
inputs.files(
'package.json',
'yarn.lock'
)
outputs.files("${buildDir}/reports/audit-ci.txt")
script = 'run npx-check-audit'
}

// check that yarn run license-check passes
tasks.register('checkFrontLicense', RunYarn) {
dependsOn assembleFrontend
inputs.files("LICENSE.txt", "test/", "public/", fileTree('src/') {
exclude 'openapi-types'
})
outputs.upToDateWhen { true }
script = 'run license-check'
}

if (project.hasProperty('frontend-npm-audit')) {
assemble.dependsOn checkFrontAudit
}

checkFrontend.dependsOn checkFrontLicense
}


Expand Down
2 changes: 1 addition & 1 deletion src/central-server/admin-service/api-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ dependencies {
implementation project(':common:common-verifier')

api("org.springframework.cloud:spring-cloud-starter-openfeign")
api ("io.github.openfeign:feign-hc5:$openFeignVersion")
api("io.github.openfeign:feign-hc5:$openFeignVersion")
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

dependencies {
implementation project(':central-server:admin-service:core-api')
implementation project(':central-server:openapi-model')
Expand Down
Loading

0 comments on commit 94d6845

Please sign in to comment.