Skip to content

Commit bf66c4e

Browse files
committed
Update documentation
- Update HTML documentation. - Automatic tagging from Github workflow.
1 parent 2d1d8a3 commit bf66c4e

File tree

36 files changed

+674
-154
lines changed

36 files changed

+674
-154
lines changed

.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Checks: >
1717
-cppcoreguidelines-interfaces-global-init,
1818
-cppcoreguidelines-avoid-magic-numbers,
1919
-cppcoreguidelines-avoid-goto,
20+
-cppcoreguidelines-macro-usage,
2021
misc-*,
2122
-misc-non-private-member-variables-in-classes,
2223
portability-*,

.github/workflows/reusable-full.yml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,49 @@ jobs:
7878
ref: ${{ github.sha }}
7979
path: ${{ env.CLONE_FOLDER }}
8080
submodules: recursive
81+
- name: Tag commit on production
82+
run: |
83+
# Enter folder with repository.
84+
Push-Location "$($ENV:CLONE_FOLDER)";
85+
86+
# Get current version from configuration file.
87+
$confFile = Get-Content "./doc/conf.py" -Encoding utf8 -Raw;
88+
$confMatch = $confFile -Match 'version[\s]*=[\s]*"([0-9]+\.[0-9]+\.[0-9]+)"[\s]*';
89+
if ($confMatch -eq $false) { throw "Unable to retrieve version from configuration file..."; }
90+
$currVersion = $Matches[1];
91+
92+
# Attempt to tag only on 'production' kind of deployments.
93+
if ('${{ inputs.deploy }}' -eq "production")
94+
{
95+
# Fetch all tags from remote.
96+
git fetch --tags --force;
97+
if ($LastExitCode -ne 0) { throw "Unable to fetch tags from repository."; }
98+
99+
# Check if current commit is already tagged, in which case skip it.
100+
$out = git tag -l -n0 --points-at "${{ github.sha }}";
101+
if ($LastExitCode -ne 0) { throw "Unable to determine if current commit is tagged."; }
102+
if ($out.Length -eq 0)
103+
{
104+
$out = git tag -l -n0 "$currVersion";
105+
if ($LastExitCode -ne 0) { throw "Unable to determine if tag exists for version."; }
106+
if ($out.Length -ne 0) { throw "Version '$out' is already tagged."; }
107+
108+
# Create tag locally for documentation and other purposes, do not push, would need perms.
109+
git tag "$currVersion" "${{ github.sha }}";
110+
if ($LastExitCode -ne 0) { throw "Unable to create tag '$currVersion' for '${{ github.sha }}'"; }
111+
}
112+
else
113+
{
114+
Write-Host "Commit '${{ github.sha }}' is already tagged...";
115+
}
116+
}
117+
else
118+
{
119+
Write-Host "No tagging necessary for '${{ inputs.deploy }}' deployment...";
120+
}
121+
122+
# Return to original folder.
123+
Pop-Location;
81124
- name: Build every target with CMake
82125
run: |
83126
# Enter Python virtual environment.
@@ -115,7 +158,6 @@ jobs:
115158
tar `
116159
--exclude="*.obj" `
117160
--exclude="*.o" `
118-
--exclude="*.pdf" `
119161
--exclude="$($cfg.Name)/.git" `
120162
-cf "$($cfg.Name).repo.tar.gz" "$($cfg.Name)";
121163
if ($LastExitCode -ne 0) { throw "$($cfg.Name): Compressing the repository failed with error '$LastExitCode'." }

.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
},
2626
// Do not reveal files in the explorer as they are open.
2727
"explorer.autoReveal": false,
28+
// Disable sticky scroll.
29+
"editor.stickyScroll.enabled": false,
2830
// Default theme.
2931
"workbench.colorTheme": "Visual Studio Dark - C++",
3032
// Increase line buffer of the integrated terminal.

doc/app/client.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Client
2+
========================================================================================================================
3+
4+
.. doxygennamespace:: App::Client
5+
:desc-only:
6+
7+
.. doxygenfunction:: App::Client::main

doc/app/index.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Application
2+
========================================================================================================================
3+
4+
.. doxygennamespace:: App
5+
:desc-only:
6+
7+
.. toctree::
8+
:titlesonly:
9+
:hidden:
10+
11+
client
12+
server
13+
startup

doc/app/server.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Server
2+
========================================================================================================================
3+
4+
.. doxygennamespace:: App::Server
5+
:desc-only:
6+
7+
.. doxygenfunction:: App::Server::main

doc/app/startup.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Startup
2+
========================================================================================================================
3+
4+
.. doxygennamespace:: App::Startup
5+
:desc-only:
6+
7+
.. doxygenfunction:: App::Startup::main
8+
9+
.. doxygenfunction:: main(int argc, char **argv)

doc/conf.py

Lines changed: 56 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import sphinx
1818
import subprocess
1919
import os
20+
import docutils
2021
import xml.etree.ElementTree as ET
2122

2223
## Project information #################################################################################################
@@ -98,6 +99,18 @@
9899
html_logo = None
99100
# Path to the HTML fav icon.
100101
html_favicon = None
102+
# Paths to static files and folders, will be stored in '_static' folder.
103+
html_static_path = [
104+
"../other/commonapi_docs/FrancaUserGuide-0.12.0.1.pdf",
105+
"../other/commonapi_docs/CommonAPICppSpecification.pdf",
106+
"../other/commonapi_docs/CommonAPICppUserGuide.pdf",
107+
"../other/commonapi_docs/CommonAPI-4_deployment_spec.fdepl",
108+
"../other/commonapi_docs/dbus/CommonAPI-4-DBus_deployment_spec.fdepl",
109+
"../other/commonapi_docs/dbus/CommonAPIDBusCppUserGuide.pdf",
110+
"../other/commonapi_docs/someip/CommonAPI-4-SOMEIP_deployment_spec.fdepl",
111+
"../other/commonapi_docs/someip/CommonAPISomeIPCppUserGuide.pdf",
112+
"../other/commonapi_docs/someip/vsomeipUserGuide.html"
113+
]
101114
# Add permalinks to every section.
102115
html_permalinks = True
103116
# Do not include the original sources in the final documentation.
@@ -174,43 +187,55 @@ def breathe_load_tags_on_doxyfile() -> None:
174187
if len(elems) == 1:
175188
_ = [tags.add(tag.text) for tag in elems[0] if tag.text.isidentifier()]
176189

177-
def on_missing_reference(_app: sphinx.application.Sphinx,
178-
_env: sphinx.app.builder.env,
190+
def on_missing_reference(app: sphinx.application.Sphinx,
191+
env: sphinx.environment.BuildEnvironment,
179192
node: sphinx.addnodes.pending_xref,
180-
contnode: sphinx.addnodes.pending_xref):
181-
"""Handler for 'on_missing_reference' warning. Lots of false positives can be raised by Sphinx from this, for
193+
contnode: docutils.nodes.TextElement) -> docutils.nodes.reference | None:
194+
"""Handler for 'missing-reference' warning. Lots of false positives can be raised by Sphinx from this, for
182195
example from missing references to standard library types or missing references to third-party types that are not
183196
documented by Sphinx or which are not processed by Doxygen.
184197
185-
One solution is to disable errors as warnings, but this is not convenient as it could hide real errors.
198+
One solution is to disable errors as warnings, but this is not convenient as it could hide real errors. Another
199+
solution implies the use of 'c_extra_keywords' and 'c_id_attributes', however, this also causes other kind of
200+
errors. Thus the solution to handle the event directly.
186201
187-
The implementation of this handler here allows to ignore warnings for the types specified."""
202+
The implementation of this handler allows to ignore this kind of warnings and also to look for substitue
203+
nodes when a reference has not been found."""
188204
# Print missing reference in color in the terminal to differentiate it.
189-
# print(f"\033[93m mon_missing_reference: {node}.\033[00m")
190-
191-
# Missing references handler, lots of false positives can occur in the C/C++ domain.
192-
# Trying to handle them with 'c_extra_keywords' or 'c_id_attributes' generates other kind of errors.
193-
# Allowed reference domains, reference targets and reference types that can be missing are described below.
194-
refdomains = ["c", "cpp"]
195-
reftypes = ["identifier"]
196-
197-
# C Standard library identifiers to ignore.
198-
c_std_reftargets = []
199-
200-
# C++ Standard library identifiers to ignore.
201-
cpp_std_reftargets = ["size_t"]
202-
203-
# Build total reftargets.
204-
reftargets = [
205-
*c_std_reftargets,
206-
*cpp_std_reftargets
207-
]
208-
209-
# Check if the reference is of C/C++ type and it can be allowed to be missing.
210-
if all((node["refdomain"] in refdomains, node["reftarget"] in reftargets, node["reftype"] in reftypes)):
211-
# Return OK in Sphinx.
212-
return contnode
213-
# Raise error in Sphinx.
205+
print(f"\033[93m on_missing_reference: {node}.\033[00m")
206+
207+
# The lookup dictionary with missing targets and replacements.
208+
reftargets = {
209+
"c": {
210+
211+
},
212+
"cpp": {
213+
"*": {
214+
"size_t": None, "uint32_t": None,
215+
"v0_1": None, "v0_1::commonapi": None, "v0_1::commonapi::app": None, "v0_1::commonapi::app::AppStubDefault": None
216+
}
217+
}
218+
}
219+
220+
# Obtain the reference target replacement, if any, note that refdoc replacements take priority over global ones.
221+
domain_dict = reftargets.get(node["refdomain"], {})
222+
reftarget = {**domain_dict.get("*", {}), **domain_dict.get(node["refdoc"], {})}.get(node["reftarget"], False)
223+
224+
# Check if the replacement target has been found and the node refers to an identifier.
225+
if all([node["reftype"] == "identifier", reftarget is not False]):
226+
# No explicit replacement for target, thus acknowledge warning and continue with node as is.
227+
if reftarget is None:
228+
return contnode
229+
230+
# Find explicit replacement for target, and ensure there is no ambiguity.
231+
reftarget_cand = env.domains[node["refdomain"]].resolve_any_xref(
232+
env, './index', app.builder, reftarget, node, contnode
233+
)
234+
if len(reftarget_cand) != 1:
235+
raise sphinx.errors.ExtensionError(f"Found {len(reftarget_cand)} '{reftarget}' replacements for '{node['reftarget']}'.")
236+
return reftarget_cand[0][1]
237+
238+
# Could not resolve identifier, let other handlers resolve it if they can.
214239
return None
215240

216241
def setup(app: sphinx.application.Sphinx):

doc/doxyfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ ALIASES +="endrst=@endverbatim"
291291
# members will be omitted, etc.
292292
# The default value is: NO.
293293

294-
OPTIMIZE_OUTPUT_FOR_C = YES
294+
OPTIMIZE_OUTPUT_FOR_C = NO
295295

296296
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
297297
# Python sources only. Doxygen will then generate output that is more tailored
@@ -660,7 +660,7 @@ INLINE_INFO = YES
660660
# name. If set to NO, the members will appear in declaration order.
661661
# The default value is: YES.
662662

663-
SORT_MEMBER_DOCS = YES
663+
SORT_MEMBER_DOCS = NO
664664

665665
# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
666666
# descriptions of file, namespace and class members alphabetically by member

doc/index.rst

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,43 @@
11
Introduction
22
========================================================================================================================
33

4-
|ProjectFriendlyName|, version |ProjectVersion|, is a software project.
4+
|ProjectFriendlyName|, version |ProjectVersion|, is an example integration and playground of a client and server
5+
architecture using the `COVESA / GENIVI Common API C++ Framework <https://covesa.github.io/capicxx-core-tools/>`_,
6+
covering both runtimes and code generators and also supporting both
7+
`D-Bus <https://www.freedesktop.org/wiki/Software/dbus/>`_ and `SOME/IP <https://some-ip.com/>`_ bindings.
58

6-
.. doxygennamespace:: App
7-
:desc-only:
9+
For convenience, a list of relevant repositories and resources from the relevant organizations is listed below.
10+
These resources are the latest at the time of writing, and the ones used for the development of this project.
811

9-
.. doxygennamespace:: Utils
10-
:desc-only:
12+
- `COVESA / GENIVI Common API C++ Core Tools v3.2.15 repository <https://github.com/COVESA/capicxx-core-tools/tree/3.2.15>`_
13+
14+
- `Common API C++ Core Tools v3.2.15 Specification <_static/CommonAPICppSpecification.pdf>`_
15+
- `Common API C++ Core Tools v3.2.15 User Guide <_static/CommonAPICppUserGuide.pdf>`_
16+
- `Common API C++ Core Tools v3.2.15 Deployment Specification <_static/CommonAPI-4_deployment_spec.fdepl>`_
17+
18+
- `COVESA / GENIVI Common API C++ D-Bus Tools v3.2.15 repository <https://github.com/COVESA/capicxx-dbus-tools/tree/3.2.15>`_
19+
20+
- `Common API C++ D-Bus Tools v3.2.15 User Guide <_static/CommonAPIDBusCppUserGuide.pdf>`_
21+
- `Common API C++ D-Bus Tools v3.2.15 Deployment Specification <_static/CommonAPI-4-DBus_deployment_spec.fdepl>`_
22+
23+
- `COVESA / GENIVI Common API C++ SOME/IP Tools v3.2.15 repository <https://github.com/COVESA/capicxx-someip-tools/tree/3.2.15>`_
24+
25+
- `Common API C++ SOME/IP Tools v3.2.15 User Guide <_static/CommonAPISomeIPCppUserGuide.pdf>`_
26+
- `Common API C++ SOME/IP Tools v3.2.15 Deployment Specification <_static/CommonAPI-4-SOMEIP_deployment_spec.fdepl>`_
27+
28+
- `COVESA / GENIVI vSomeIP v3.5.3 repository <https://github.com/COVESA/vsomeip/tree/3.5.3>`_
29+
30+
- `vSomeIP v3.5.3 User Guide <_static/vsomeipUserGuide.html>`_
31+
32+
- `COVESA / GENIVI Common API C++ Core Runtime v3.2.4 repository <https://github.com/COVESA/capicxx-core-runtime/tree/3.2.4>`_
33+
- `COVESA / GENIVI Common API C++ D-Bus Runtime v3.2.3-r1 repository <https://github.com/COVESA/capicxx-dbus-runtime/tree/3.2.3-r1>`_
34+
- `COVESA / GENIVI Common API C++ SOME/IP Runtime v3.2.4 repository <https://github.com/COVESA/capicxx-someip-runtime/tree/3.2.4>`_
35+
- `Franca User Guide v0.12.0.1 <_static/FrancaUserGuide-0.12.0.1.pdf>`_
36+
37+
It is recommended to first refer to the :any:`Application <::App>` to understand the client/server architecture,
38+
followed by the :any:`Common API C++ Abstraction <Utils::Capi>` to understand the Common API C++ framework integration.
39+
The :any:`Test Suites <Tests::Suites>` provide some practice examples and a playground for experimentation and testing
40+
of the different features of the Common API C++ framework.
1141

1242
The source code for |ProjectFriendlyName| is hosted at `Github <https://github.com/dmg0345/commonapi_cpp_examples>`_ and
1343
related *Docker* images for development containers are located at `DockerHub <https://hub.docker.com/r/dmg00345/commonapi_cpp_examples>`_.
@@ -17,7 +47,15 @@ related *Docker* images for development containers are located at `DockerHub <ht
1747
.. note::
1848

1949
This is the documentation for |ProjectFriendlyName|, version |ProjectVersion|, refer to
20-
:doc:`version/index` for more details regarding the release.
50+
:doc:`utils/version` for more details regarding the release.
51+
52+
.. important::
53+
54+
This project is an open source project built from publicly available repositories and documentation and not
55+
affiliated with *COVESA / GENIVI*.
56+
57+
This project is an example integration of the *Common API C++ Framework* based on previous experience and
58+
interpretation of the author of that documentation.
2159

2260
License
2361
-----------------------------------------------------------------------------------------------------------------------
@@ -30,4 +68,6 @@ License
3068
:hidden:
3169

3270
self
33-
version/index
71+
app/index
72+
utils/index
73+
tests/index

0 commit comments

Comments
 (0)