Skip to content

Commit 0b3e018

Browse files
Introducing report_running() API & Cleanup lifecycle_client target (#239)
* Initial report_running files * Update LifeCycleManager to use report_running() * Update year in copyright * Remove mw::log dependency, adjust include prefix & visibility * Rename lifecycleclient.cpp to lifecycle_client.cpp * Add internal bazel target for old-school LifecycleClient * UT for score::mw::lifecycle::Run - generated by AI * Get rid of uninteresting mock calls * Mock targets invisible outside of package * Build breaks on rust_supervised_app * Fix rust_supervised_app * Drop no longer needed dependency * Clean up in build file * Some todos added * Misc changes Drop lifecycle_client in include path Adapt visibility of packages Get rid of circular dependency between lifecycle_internal and impl * Add public aliases for mock, move pthread dependency * Fix UT * Move dependencies * Remove application mock * Align to internal branch * Adjust visibility, get rid of unused aliases * Fix bazel formatting * Remove pthreads * Minimal changes to make tests in config_management happy * Make applicationcontainer_cc public * Make everything public for now to maintain full backward compatibility --------- Co-authored-by: Nicolas Fußberger <145956508+NicolasFussberger@users.noreply.github.com>
1 parent 09b4c65 commit 0b3e018

29 files changed

Lines changed: 507 additions & 179 deletions

score/launch_manager/BUILD

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ cc_library(
4949
hdrs = ["execution_error.h"],
5050
include_prefix = "score/mw/lifecycle",
5151
strip_include_prefix = "/score/launch_manager",
52+
visibility = ["//score/launch_manager:__subpackages__"],
5253
deps = [
5354
"@score_baselibs//score/result",
5455
],
@@ -62,6 +63,7 @@ cc_library(
6263
],
6364
include_prefix = "score/mw/lifecycle",
6465
strip_include_prefix = "/score/launch_manager",
66+
visibility = ["//score/launch_manager:__subpackages__"],
6567
deps = [
6668
":error",
6769
"//score/launch_manager/daemon/src/common:identifier_hash",
@@ -71,10 +73,57 @@ cc_library(
7173
cc_test(
7274
name = "exec_error_domain_UT",
7375
srcs = ["exec_error_domain_UT.cpp"],
74-
visibility = ["//tests:__subpackages__"],
76+
visibility = ["//visibility:private"],
7577
deps = [
7678
":error",
7779
"@googletest//:gtest_main",
7880
"@score_baselibs//score/result",
7981
],
8082
)
83+
84+
alias(
85+
name = "applicationcontext_mock_cc",
86+
actual = "//score/launch_manager/lifecycle_client:applicationcontext_mock",
87+
)
88+
89+
alias(
90+
name = "lifecycle_mock_cc",
91+
actual = "//score/launch_manager/lifecycle_client:lifecycle_mock",
92+
)
93+
94+
alias(
95+
name = "report_running_mock_cc",
96+
actual = "//score/launch_manager/lifecycle_client:report_running_mock",
97+
)
98+
99+
# BEGIN: Fine granular targets only needed for testing purposes
100+
alias(
101+
name = "aasapplicationcontainer_cc",
102+
actual = "//score/launch_manager/lifecycle_client:aasapplicationcontainer",
103+
)
104+
105+
alias(
106+
name = "application_cc",
107+
actual = "//score/launch_manager/lifecycle_client:application",
108+
)
109+
110+
alias(
111+
name = "applicationcontext_cc",
112+
actual = "//score/launch_manager/lifecycle_client:applicationcontext",
113+
)
114+
115+
alias(
116+
name = "lifecyclemanager_cc",
117+
actual = "//score/launch_manager/lifecycle_client:lifecyclemanager",
118+
)
119+
120+
alias(
121+
name = "report_running_cc",
122+
actual = "//score/launch_manager/lifecycle_client:report_running",
123+
)
124+
125+
alias(
126+
name = "runapplication_cc",
127+
actual = "//score/launch_manager/lifecycle_client:runapplication",
128+
)
129+
# END: Fine granular targets only needed for testing purposes

score/launch_manager/daemon/BUILD

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,14 @@
1212
# *******************************************************************************
1313
load("@rules_cc//cc:defs.bzl", "cc_binary")
1414

15-
alias(
16-
name = "error",
17-
actual = "//score/launch_manager:error",
18-
visibility = ["//visibility:public"],
19-
)
20-
21-
alias(
22-
name = "error_event",
23-
actual = "//score/launch_manager:error_event",
24-
visibility = ["//visibility:public"],
25-
)
26-
2715
cc_binary(
2816
name = "launch_manager",
2917
srcs = ["src/main.cpp"],
3018
linkopts = select({
3119
"@platforms//os:qnx": ["-lsecpol"],
3220
"@platforms//os:linux": ["-lpthread"],
3321
}),
34-
visibility = ["//visibility:public"],
22+
visibility = ["//score/launch_manager:__subpackages__"],
3523
deps = [
3624
"//score/launch_manager/daemon/src/alive_monitor",
3725
"//score/launch_manager/daemon/src/common:log",

score/launch_manager/daemon/src/alive_monitor/rust/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ rust_library(
2222
visibility = ["//score:__subpackages__"],
2323
deps = [
2424
"//score/launch_manager:alive_cc",
25-
"//score/launch_manager/lifecycle_client",
2625
"@score_crates//:libc",
2726
],
2827
)

score/launch_manager/daemon/src/alive_monitor/rust/src/monitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use libc::{c_char, c_uint, c_void};
1515
use std::ffi::CString;
1616
use std::marker::PhantomData;
1717

18-
#[link(name = "lifecycle_client")]
18+
#[link(name = "am-lib")]
1919
unsafe extern "C" {
2020
fn score_lcm_monitor_initialize(instanceSpecifier: *const c_char) -> *mut c_void;
2121
fn score_lcm_monitor_deinitialize(instance: *mut c_void);

0 commit comments

Comments
 (0)