Skip to content

Commit

Permalink
Merge branch 'master' into development/optionaltype
Browse files Browse the repository at this point in the history
  • Loading branch information
sebaszm authored Jun 18, 2024
2 parents b6db5f2 + 8fcbeca commit cdea8f7
Show file tree
Hide file tree
Showing 19 changed files with 119 additions and 115 deletions.
1 change: 1 addition & 0 deletions .github/workflows/Build ThunderTools on Linux.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build ThunderTools on Linux

on:
workflow_dispatch:
push:
branches: ["master"]
pull_request:
Expand Down
70 changes: 36 additions & 34 deletions .github/workflows/Build ThunderTools on Windows.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Build ThunderTools on Windows

on:
workflow_dispatch:
push:
branches: ["master"]
pull_request:
branches: ["master"]
workflow_call:

env:
bridge: Thunder\Source\WPEFramework\bridge.vcxproj
bridge: Thunder\Source\Thunder\bridge.vcxproj
commander: ThunderNanoServices\Commander\Commander.vcxproj
devEnv: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.com
deviceInfo: ThunderNanoServicesRDK\DeviceInfo\DeviceInfo.vcxproj
Expand Down Expand Up @@ -39,18 +39,19 @@ jobs:
type: [Debug, Release]
version: [64, 86]

# ----- Checkout & DependsOn regex -----
name: Build type - ${{matrix.type}}${{matrix.version}}
steps:
- name: Checkout ThunderOnWindows
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ThunderOnWindows
repository: WebPlatformForEmbedded/ThunderOnWindows

# ----- Thunder -----
- name: Checkout Thunder - default
if: ${{ !contains(github.event.pull_request.body, '[DependsOn=Thunder:') }}
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ThunderOnWindows/Thunder
repository: ${{github.repository_owner}}/Thunder
Expand All @@ -66,7 +67,7 @@ jobs:

- name: Checkout Thunder - ${{steps.thunder.outputs.first_match}}
if: contains(github.event.pull_request.body, '[DependsOn=Thunder:')
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ThunderOnWindows/Thunder
repository: ${{github.repository_owner}}/Thunder
Expand All @@ -75,7 +76,7 @@ jobs:
# ----- ThunderTools -----
- name: Checkout ThunderTools - default
if: ${{ !contains(github.event.pull_request.body, '[DependsOn=ThunderTools:') }}
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ThunderOnWindows/ThunderTools
repository: ${{github.repository_owner}}/ThunderTools
Expand All @@ -91,7 +92,7 @@ jobs:

- name: Checkout ThunderTools - ${{steps.tools.outputs.first_match}}
if: contains(github.event.pull_request.body, '[DependsOn=ThunderTools:')
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ThunderOnWindows/ThunderTools
repository: ${{github.repository_owner}}/ThunderTools
Expand All @@ -100,7 +101,7 @@ jobs:
# ----- ThunderInterfaces -----
- name: Checkout ThunderInterfaces - default
if: ${{ !contains(github.event.pull_request.body, '[DependsOn=ThunderInterfaces:') }}
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ThunderOnWindows/ThunderInterfaces
repository: ${{github.repository_owner}}/ThunderInterfaces
Expand All @@ -116,64 +117,65 @@ jobs:

- name: Checkout ThunderInterfaces - ${{steps.thunderinterfaces.outputs.first_match}}
if: contains(github.event.pull_request.body, '[DependsOn=ThunderInterfaces:')
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ThunderOnWindows/ThunderInterfaces
repository: ${{github.repository_owner}}/ThunderInterfaces
ref: ${{steps.thunderinterfaces.outputs.first_match}}

# ----- Other checkouts -----
- name: Checkout ThunderClientLibraries
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ThunderOnWindows/ThunderClientLibraries
repository: ${{github.repository_owner}}/ThunderClientLibraries

- name: Checkout ThunderNanoServices
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ThunderOnWindows/ThunderNanoServices
repository: ${{github.repository_owner}}/ThunderNanoServices

- name: Checkout ThunderNanoServicesRDK
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ThunderOnWindows/ThunderNanoServicesRDK
repository: WebPlatformForEmbedded/ThunderNanoServicesRDK

# ----- Building -----
# ----- Install & Build -----
- name: Install jsonref
run: pip install jsonref

- name: Build ThunderTools
shell: cmd
run: >
cd ThunderOnWindows
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%bridge%" "%solution%"
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%commander%" "%solution%"
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%deviceInfo%" "%solution%"
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%DHCPServer%" "%solution%"
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%DIALServer%" "%solution%"
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%dictionary%" "%solution%"
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%JSONRPCPlugin%" "%solution%"
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%locationSync%" "%solution%"
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%messenger%" "%solution%"
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%monitor%" "%solution%"
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%networkControl%" "%solution%"
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%openCDMi%" "%solution%"
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%outOfProcessPlugin%" "%solution%"
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%remoteControl%" "%solution%"
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%securityAgent%" "%solution%"
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%subsystemController%" "%solution%"
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%svalbard%" "%solution%"
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%timeSync%" "%solution%"
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%webServer%" "%solution%"
&& "%devEnv%" "%solution%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%bridge%"
&& "%devEnv%" "%solution%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%commander%"
&& "%devEnv%" "%solution%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%deviceInfo%"
&& "%devEnv%" "%solution%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%DHCPServer%"
&& "%devEnv%" "%solution%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%DIALServer%"
&& "%devEnv%" "%solution%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%dictionary%"
&& "%devEnv%" "%solution%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%JSONRPCPlugin%"
&& "%devEnv%" "%solution%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%locationSync%"
&& "%devEnv%" "%solution%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%messenger%"
&& "%devEnv%" "%solution%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%monitor%"
&& "%devEnv%" "%solution%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%networkControl%"
&& "%devEnv%" "%solution%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%openCDMi%"
&& "%devEnv%" "%solution%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%outOfProcessPlugin%"
&& "%devEnv%" "%solution%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%remoteControl%"
&& "%devEnv%" "%solution%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%securityAgent%"
&& "%devEnv%" "%solution%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%subsystemController%"
&& "%devEnv%" "%solution%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%svalbard%"
&& "%devEnv%" "%solution%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%timeSync%"
&& "%devEnv%" "%solution%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%webServer%"
# ----- Upload artifacts -----
- name: Tar files
run: tar -czvf ${{matrix.type}}${{matrix.version}}.tar.gz artifacts

- name: Upload
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ThunderTools-${{matrix.type}}${{matrix.version}}-artifact
path: ${{matrix.type}}${{matrix.version}}.tar.gz
21 changes: 11 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# If not stated otherwise in this file or this component's LICENSE file the
# If not stated otherwise in this file or this component's LICENSE file the
# following copyright and licenses apply:
#
# Copyright 2020 Metrological
Expand All @@ -15,14 +15,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required(VERSION 3.3)

include(GNUInstallDirs)
cmake_minimum_required(VERSION 3.15)

project(Generators)

include(GNUInstallDirs)

if (NOT DEFINED GENERATOR_INSTALL_PATH)
set(GENERATOR_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_SBIN}" CACHE PATH "Path where the python scripts will be called from the cmake entries")
set(GENERATOR_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_SBINDIR}" CACHE PATH "Path where the python scripts will be called from the cmake entries")
endif()

option(PROXYSTUB_GENERATOR_ENABLE_SECURITY "Globally enable security checks in proxystubs" OFF)
Expand All @@ -32,7 +32,7 @@ if(NOT DEFINED GENERIC_CMAKE_MODULE_PATH)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../src/bridge")
set(NAMESPACE bridge)
else()
set(NAMESPACE WPEFramework)
set(NAMESPACE Thunder)
endif()
if(DEFINED ENV{STAGING_DIR})
set(GENERIC_CMAKE_MODULE_PATH "$ENV{STAGING_DIR}/usr/${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/Modules")
Expand All @@ -56,28 +56,29 @@ configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindConfigGenerator.cmake.in"
@ONLY
)



install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/FindProxyStubGenerator.cmake"
DESTINATION ${GENERIC_CMAKE_MODULE_PATH}
COMPONENT ${NAMESPACE}_Development
)

install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/FindJsonGenerator.cmake"
DESTINATION ${GENERIC_CMAKE_MODULE_PATH}
COMPONENT ${NAMESPACE}_Development
)

install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/FindConfigGenerator.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/FindConfigGenerator.cmake"
DESTINATION ${GENERIC_CMAKE_MODULE_PATH}
COMPONENT ${NAMESPACE}_Development
)


install(DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}/ProxyStubGenerator"
"${CMAKE_CURRENT_SOURCE_DIR}/JsonGenerator"
"${CMAKE_CURRENT_SOURCE_DIR}/ConfigGenerator"
DESTINATION ${GENERATOR_INSTALL_PATH}
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
COMPONENT ${NAMESPACE}_Runtime
)
4 changes: 2 additions & 2 deletions ConfigGenerator/config_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def check_assignment(file, var):
action="store",
type=str,
dest="locator",
help="locator of plugin e.g, libWPEFrameworkDeviceInfo.so")
help="locator of plugin e.g, libThunderDeviceInfo.so")

argparser.add_argument("-c",
"--classname",
Expand Down Expand Up @@ -265,4 +265,4 @@ def check_assignment(file, var):
sys.exit(1)
else:
with outfile:
outfile.write(result.serialize(args.indent_size))
outfile.write(result.serialize(args.indent_size))
2 changes: 1 addition & 1 deletion DocumentGenerator/DocumentGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def mkdocs_create_index_file(self):
| Repo | Commit-Id | Commit-Date |\n\
| :--- | :-------- | :---------- |\n\
|[ThunderInterfaces](" + THUNDER_INTERFACE_REPO_URL + ')|' + self.thunder_interfaces_commit_id + '|' + self.thunder_interfaces_commit_date + " GMT|\n\n"
index_file_contents_plugins = '''## WPEFramework-plugins documentation
index_file_contents_plugins = '''## Thunder-plugins documentation
This section contains the documentation created from plugins\n\n
| Repo | Commit-Id | Commit-Date |
| :--- | :-------- | :---------- |
Expand Down
2 changes: 1 addition & 1 deletion JsonGenerator/docs_common.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"standards": {
"date": "Date time formats between the systems shall be in UTC time and W3C ([ISO-8601] profile) formatting [ISO-8601], e.g.: 2004-11-05T13:15:30Z. This way time discontinuities can be avoided due to daylight savings. Note that all interfacing systems must decode/encode the date time to the correct local time. Languages used in the WPEFramework will be conformant to [ISO-639-2] using two letter language codes. If WPEFramework encounters a language code it does not recognize, it will use *xx* instead. For a list of available two letter ISO language codes refer to [ISO-639-2]."
"date": "Date time formats between the systems shall be in UTC time and W3C ([ISO-8601] profile) formatting [ISO-8601], e.g.: 2004-11-05T13:15:30Z. This way time discontinuities can be avoided due to daylight savings. Note that all interfacing systems must decode/encode the date time to the correct local time. Languages used in the Thunder will be conformant to [ISO-639-2] using two letter language codes. If Thunder encounters a language code it does not recognize, it will use *xx* instead. For a list of available two letter ISO language codes refer to [ISO-639-2]."
},
"acronyms": {
"utc": {
Expand Down
2 changes: 1 addition & 1 deletion JsonGenerator/global.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"callsign": "The name given to an instance of a plugin. One plugin can be instantiated multiple times, but each instance the instance name, callsign, must be unique."
},
"references": {
"[Thunder](https://github.com/WebPlatformForEmbedded/Thunder/blob/master/doc/WPE%20-%20API%20-%20WPEFramework.docx)": "Thunder API Reference",
"[Thunder](https://github.com/WebPlatformForEmbedded/Thunder/blob/master/doc/WPE%20-%20API%20-%20Thunder.docx)": "Thunder API Reference",
"[HTTP](http://www.w3.org/Protocols)": "HTTP specification",
"[JSON](http://www.json.org/)": "JSON specification",
"[JSON-RPC](https://www.jsonrpc.org/specification)": "JSON-RPC 2.0 specification"
Expand Down
4 changes: 2 additions & 2 deletions JsonGenerator/source/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
DEFAULT_INT_SIZE = 32
DOC_ISSUES = True
DEFAULT_DEFINITIONS_FILE = "../../ProxyStubGenerator/default.h"
FRAMEWORK_NAMESPACE = "WPEFramework"
INTERFACE_NAMESPACES = ["::WPEFramework::Exchange::JSONRPC", "::WPEFramework::Exchange"]
FRAMEWORK_NAMESPACE = "Thunder"
INTERFACE_NAMESPACES = ["::Thunder::Exchange::JSONRPC", "::Thunder::Exchange"]
INTERFACES_SECTION = True
INTERFACE_SOURCE_LOCATION = None
INTERFACE_SOURCE_REVISION = None
Expand Down
2 changes: 1 addition & 1 deletion JsonGenerator/source/header_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def GenerateObject(ctype, was_typdef):

return "object", { "properties": properties, "required": required }

if cppType.full_name == "::WPEFramework::Core::JSONRPC::Context":
if cppType.full_name == "::Thunder::Core::JSONRPC::Context":
result = "@context", {}
elif (cppType.vars and not cppType.methods) or not verify:
result = GenerateObject(cppType, isinstance(var.type.Type(), CppParser.Typedef))
Expand Down
4 changes: 2 additions & 2 deletions JsonGenerator/source/rpc_emitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ def _Invoke(params, response, parent="", repsonse_parent="", const_cast=False):

def EmitRpcCode(root, emit, header_file, source_file, data_emitted):

namespace = (root.schema["namespace"] if "namespace" in root.schema else "::WPEFramework::Exchange")
namespace = (root.schema["namespace"] if "namespace" in root.schema else "::Thunder::Exchange")

prototypes = _EmitRpcCode(root, emit, namespace, header_file, source_file, data_emitted)

Expand All @@ -1106,7 +1106,7 @@ def EmitRpcCode(root, emit, header_file, source_file, data_emitted):

def EmitRpcVersionCode(root, emit, header_file, source_file, data_emitted):

namespace = (root.schema["namespace"] if "namespace" in root.schema else "::WPEFramework::Exchange")
namespace = (root.schema["namespace"] if "namespace" in root.schema else "::Thunder::Exchange")

_EmitRpcPrologue(root, emit, header_file, source_file, namespace, data_emitted)
_EmitVersionCode(emit, rpc_version.GetVersion(root.schema["info"] if "info" in root.schema else dict()))
Expand Down
2 changes: 1 addition & 1 deletion ProxyStubGenerator/CppParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1763,7 +1763,7 @@ def EndOfTag(string, start):
start = string.find(tag)
if (start != -1):
start += len(tag) + 1
end = EndOfTag(token, start)
end = EndOfTag(string, start)
desc = string[start:end].strip(" *\n")
if desc:
tagtokens.append(tag.upper())
Expand Down
2 changes: 1 addition & 1 deletion ProxyStubGenerator/Interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self, obj, iid, file):


# Looks for interface clasess (ie. classes inheriting from Core::Unknown and specifying ID enum).
def FindInterfaceClasses(tree, interface_namespace, source_file, ancestors = [ "::WPEFramework::Core::IUnknown" ]):
def FindInterfaceClasses(tree, interface_namespace, source_file, ancestors = [ "::Thunder::Core::IUnknown" ]):
interfaces = []

selected = []
Expand Down
6 changes: 3 additions & 3 deletions ProxyStubGenerator/StubGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
# static configuration
EMIT_COMMENT_WITH_PROTOTYPE = True
EMIT_COMMENT_WITH_STUB_ORDER = True
STUB_NAMESPACE = "::WPEFramework::ProxyStubs"
INTERFACE_NAMESPACES = ["::WPEFramework"]
CLASS_IUNKNOWN = "::WPEFramework::Core::IUnknown"
STUB_NAMESPACE = "::Thunder::ProxyStubs"
INTERFACE_NAMESPACES = ["::Thunder"]
CLASS_IUNKNOWN = "::Thunder::Core::IUnknown"
PROXYSTUB_CPP_NAME = "ProxyStubs_%s.cpp"

ENABLE_CUSTOM_ALLOCATOR = False
Expand Down
2 changes: 1 addition & 1 deletion ProxyStubGenerator/default.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace std {
typedef __stubgen_undetermined_integer clock_t;
}

namespace WPEFramework {
namespace Thunder {

namespace Core {
typedef __stubgen_instance_id instance_id;
Expand Down
Loading

0 comments on commit cdea8f7

Please sign in to comment.