Skip to content

Commit

Permalink
chore: split monitor into application and core modules (#2363)
Browse files Browse the repository at this point in the history
Refs: XRDDEV-2715
  • Loading branch information
justasnortal authored Oct 9, 2024
1 parent 10d68ad commit c70157a
Show file tree
Hide file tree
Showing 37 changed files with 64 additions and 44 deletions.
28 changes: 28 additions & 0 deletions src/monitor/application/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
plugins {
alias(libs.plugins.shadow)
}

dependencies {
implementation(platform(libs.springBoot.bom))

implementation project(':common:common-core')
implementation project(':monitor:core')
implementation project(':monitor-common')
implementation project(':signer-protocol')

implementation libs.bundles.metrics
implementation('org.springframework:spring-context')
}

shadowJar {
exclude('**/module-info.class')
archiveBaseName = "monitor"
archiveClassifier = ''
manifest {
attributes 'Main-Class': 'ee.ria.xroad.monitor.MonitorMain'
}
mergeServiceFiles()
}

jar.enabled = false
assemble.dependsOn shadowJar
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* The MIT License
*
* Copyright (c) 2019- Nordic Institute for Interoperability Solutions (NIIS)
* Copyright (c) 2018 Estonian Information System Authority (RIA),
* Nordic Institute for Interoperability Solutions (NIIS), Population Register Centre (VRK)
Expand Down
45 changes: 4 additions & 41 deletions src/monitor/build.gradle
Original file line number Diff line number Diff line change
@@ -1,44 +1,7 @@
plugins {
alias(libs.plugins.shadow)
tasks.withType(Jar).configureEach {
enabled = false
}

ext {
mainClassName = "ee.ria.xroad.monitor.MonitorMain"
}

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

dependencies {
implementation(platform(libs.springBoot.bom))

implementation project(':common:common-domain')
implementation project(':common:common-verifier')
implementation project(':monitor-common')
implementation project(':signer-protocol')
implementation project(':serverconf')

implementation('org.springframework:spring-context')
implementation libs.slf4j.api
implementation libs.bundles.metrics

testImplementation project(':common:common-test')
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation libs.mockito.core
}

shadowJar {
exclude('**/module-info.class')
archiveBaseName = "monitor"
archiveClassifier = ''
mergeServiceFiles()
}

jar.finalizedBy shadowJar

test {
useJUnitPlatform()
archUnit {
skip = true
}
File renamed without changes.
27 changes: 27 additions & 0 deletions src/monitor/core/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
plugins {
id 'java-library'
}

dependencies {
implementation(platform(libs.springBoot.bom))

implementation project(':common:common-domain')
implementation project(':common:common-verifier')
implementation project(':monitor-common')
implementation project(':signer-protocol')
implementation project(':serverconf')

implementation libs.slf4j.api
implementation libs.bundles.metrics

testImplementation project(':common:common-test')
testImplementation libs.mockito.core
}

jar {
archiveBaseName = 'monitor-core'
}

test {
useJUnitPlatform()
}
2 changes: 1 addition & 1 deletion src/packages/src/xroad/redhat/SPECS/xroad-monitor.spec
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ mkdir -p %{buildroot}%{_unitdir}
mkdir -p %{buildroot}/usr/share/xroad/bin
mkdir -p %{buildroot}/etc/xroad/backup.d

cp -p %{srcdir}/../../../monitor/build/libs/monitor-1.0.jar %{buildroot}%{jlib}
cp -p %{srcdir}/../../../monitor/application/build/libs/monitor-1.0.jar %{buildroot}%{jlib}
cp -a %{srcdir}/common/monitor/etc/* %{buildroot}%{_sysconfdir}
cp -p %{srcdir}/common/monitor/systemd/%{name}.service %{buildroot}%{_unitdir}
cp -p %{srcdir}/common/monitor/usr/share/xroad/bin/xroad-monitor %{buildroot}/usr/share/xroad/bin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
../../../../src/xroad/common/monitor/usr/* usr/
../../../../src/xroad/default-configuration/addons/monitor.ini etc/xroad/conf.d/addons
../../../../src/xroad/default-configuration/addons/monitor-logback.xml etc/xroad/conf.d/addons
../../../../../monitor/build/libs/monitor-1.0.jar usr/share/xroad/jlib/
../../../../../monitor/application/build/libs/monitor-1.0.jar usr/share/xroad/jlib/
3 changes: 2 additions & 1 deletion src/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ include "configuration-client:application"
include "configuration-client:core"
include "asicverifier"
include "asic-util"
include "monitor"
include "monitor:application"
include "monitor:core"
include "monitor-common"
include "op-monitor-daemon:application"
include "op-monitor-daemon:core"
Expand Down

0 comments on commit c70157a

Please sign in to comment.