Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
pwielders authored Jul 1, 2024
2 parents 5a975d3 + 497cde7 commit 4cdf2bd
Show file tree
Hide file tree
Showing 107 changed files with 705 additions and 519 deletions.
1 change: 1 addition & 0 deletions .github/workflows/Build ThunderInterfaces on Linux.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build ThunderInterfaces on Linux

on:
workflow_dispatch:
push:
branches: ["master"]
pull_request:
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/Build ThunderInterfaces on Windows.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build ThunderInterfaces on Windows

on:
workflow_dispatch:
push:
branches: ["master"]
pull_request:
Expand All @@ -23,48 +24,50 @@ jobs:

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

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

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

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

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

- 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 -----
- name: Install jsonref
run: pip install jsonref

Expand All @@ -74,12 +77,13 @@ jobs:
cd ThunderOnWindows
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%definitions%" "%solution%"
&& "%devEnv%" /Build "${{matrix.type}}|x${{matrix.version}}" /Project "%interfaces%" "%solution%"
# ----- Articats -----
- 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: ThunderInterfaces-${{matrix.type}}${{matrix.version}}-artifact
path: ${{matrix.type}}${{matrix.version}}.tar.gz
21 changes: 8 additions & 13 deletions .github/workflows/Linux build template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ jobs:
matrix:
build_type: [Debug, Release, MinSizeRel]

# ----- Packages & artifacts -----
name: Build type - ${{matrix.build_type}}
steps:
- name: Install necessary packages
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 10
Expand All @@ -27,14 +28,8 @@ jobs:
pip install jsonref
sudo apt install build-essential cmake ninja-build libusb-1.0-0-dev zlib1g-dev libssl-dev
- name: Checkout Thunder
uses: actions/checkout@v3
with:
path: Thunder
repository: rdkcentral/Thunder

- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: Thunder-${{matrix.build_type}}-artifact
path: ${{matrix.build_type}}
Expand All @@ -44,10 +39,10 @@ jobs:
tar -xvzf ${{matrix.build_type}}/${{matrix.build_type}}.tar.gz
rm ${{matrix.build_type}}/${{matrix.build_type}}.tar.gz
# ----- ThunderInterfaces -----
# ----- Regex & checkout -----
- name: Checkout ThunderInterfaces - default
if: ${{ !contains(github.event.pull_request.body, '[DependsOn=ThunderInterfaces:') }}
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ThunderInterfaces
repository: rdkcentral/ThunderInterfaces
Expand All @@ -63,13 +58,13 @@ 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: ThunderInterfaces
repository: rdkcentral/ThunderInterfaces
ref: ${{steps.thunderinterfaces.outputs.first_match}}

# ----- Building -----
# ----- Building & uploading -----
- name: Build ThunderInterfaces
run: |
cmake -G Ninja -S ThunderInterfaces -B ${{matrix.build_type}}/build/ThunderInterfaces \
Expand All @@ -82,7 +77,7 @@ jobs:
run: tar -czvf ${{matrix.build_type}}.tar.gz ${{matrix.build_type}}

- name: Upload
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ThunderInterfaces-${{matrix.build_type}}-artifact
path: ${{matrix.build_type}}.tar.gz
5 changes: 3 additions & 2 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 @@ -19,7 +19,7 @@ cmake_minimum_required(VERSION 3.12)

project(Interfaces)

find_package(WPEFramework)
find_package(Thunder)

set(INTERFACES_PATTERNS "I*.h" CACHE STRING "Patterns matching files for which stubs should be generated")
set(JSONRPC_PATTERNS "*.json" CACHE STRING "Patterns matching files for which json stubs should be generated")
Expand Down Expand Up @@ -48,4 +48,5 @@ if (BUILD_REFERENCE)
endif()

add_subdirectory(interfaces)
add_subdirectory(qa_interfaces)
add_subdirectory(definitions)
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# ThunderInterfaces

Documentation: https://webplatformforembedded.github.io/ServicesInterfaceDocumentation
71 changes: 50 additions & 21 deletions definitions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cmake_minimum_required(VERSION 3.3)

project(Definitions)

find_package(WPEFramework)
find_package(Thunder)

project_version(1.0.0)

Expand All @@ -30,36 +30,60 @@ find_package(${NAMESPACE}Core REQUIRED)
set(Target ${NAMESPACE}${PROJECT_NAME})

separate_arguments(JSONRPC_PATTERNS)
list(TRANSFORM JSONRPC_PATTERNS PREPEND "${CMAKE_SOURCE_DIR}/jsonrpc/")
file(GLOB JSON_FILE ${JSONRPC_PATTERNS})
set(WORKING_VARIABLE ${JSONRPC_PATTERNS})
list(TRANSFORM WORKING_VARIABLE PREPEND "${CMAKE_SOURCE_DIR}/jsonrpc/")
file(GLOB JSON_FILE ${WORKING_VARIABLE})

separate_arguments(JSONRPC_PATTERNS)
set(WORKING_VARIABLE ${JSONRPC_PATTERNS})
list(TRANSFORM WORKING_VARIABLE PREPEND "${CMAKE_SOURCE_DIR}/qa_jsonrpc/")
file(GLOB QA_JSON_FILE ${WORKING_VARIABLE})

separate_arguments(INTERFACES_PATTERNS)
list(TRANSFORM INTERFACES_PATTERNS PREPEND "${CMAKE_SOURCE_DIR}/interfaces/")
file(GLOB INTERFACE_FILE ${INTERFACES_PATTERNS})
set(WORKING_VARIABLE ${INTERFACES_PATTERNS})
list(TRANSFORM WORKING_VARIABLE PREPEND "${CMAKE_SOURCE_DIR}/interfaces/")
file(GLOB INTERFACE_FILE ${WORKING_VARIABLE})

set(PUBLIC_HEADERS "definitions.h" "ValuePoint.h")
separate_arguments(INTERFACES_PATTERNS)
set(WORKING_VARIABLE ${INTERFACES_PATTERNS})
list(TRANSFORM WORKING_VARIABLE PREPEND "${CMAKE_SOURCE_DIR}/qa_interfaces/")
file(GLOB QA_INTERFACE_FILE ${WORKING_VARIABLE})

set(PUBLIC_HEADERS "definitions.h" "ValuePoint.h" "Module.h")

if(NOT GENERATOR_SEARCH_PATH)
set(GENERATOR_SEARCH_PATH ${CMAKE_SYSROOT}${CMAKE_INSTALL_PREFIX}/include/${NAMESPACE})
set(GENERATOR_SEARCH_PATH ${CMAKE_SYSROOT}${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE})
endif()

JsonGenerator(CODE INPUT ${JSON_FILE} OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH ${GENERATOR_SEARCH_PATH} CPPIFDIR "${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/")
JsonGenerator(CODE INPUT ${QA_JSON_FILE} OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/qa_generated" INCLUDE_PATH ${GENERATOR_SEARCH_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../jsonrpc/" CPPIFDIR "${CMAKE_CURRENT_SOURCE_DIR}/../qa_interfaces/" IFDIR "${CMAKE_CURRENT_SOURCE_DIR}/../jsonrpc/" CPP_INTERFACE_PATH "qa_interfaces" JSON_INTERFACE_PATH "qa_interfaces/json")
JsonGenerator(CODE INPUT ${INTERFACE_FILE} OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH ${GENERATOR_SEARCH_PATH})
JsonGenerator(CODE NAMESPACE Thunder::QualityAssurance INPUT ${QA_INTERFACE_FILE} OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/qa_generated" INCLUDE_PATH ${GENERATOR_SEARCH_PATH} CPP_INTERFACE_PATH "qa_interfaces" JSON_INTERFACE_PATH "qa_interfaces/json" )

file(GLOB JSON_ENUM_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/generated/JsonEnum*.cpp")
file(GLOB JSON_LINK_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/generated/J*.h")

file(GLOB QA_JSON_ENUM_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/qa_generated/JsonEnum*.cpp")
file(GLOB QA_JSON_LINK_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/qa_generated/J*.h")

list(APPEND JSON_LINK_HEADERS "Module.h")
list(APPEND QA_JSON_LINK_HEADERS "Module.h")

include(CreateLink)
CreateLink(LINK "${CMAKE_CURRENT_BINARY_DIR}/generated/Module.h" TARGET "../Module.h")
list(APPEND JSON_LINK_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/generated/Module.h")
CreateLink(LINK "${CMAKE_CURRENT_BINARY_DIR}/generated/Ids.h" TARGET "../Ids.h")
list(APPEND JSON_LINK_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/generated/Ids.h")
CreateLink(LINK "${CMAKE_CURRENT_BINARY_DIR}/Module.h" TARGET "../interfaces/Module.h")
list(APPEND PUBLIC_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/Module.h")
#CreateLink(LINK "${CMAKE_CURRENT_BINARY_DIR}/generated/Module.h" TARGET "../Module.h")
#list(APPEND JSON_LINK_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/generated/Module.h")
#CreateLink(LINK "${CMAKE_CURRENT_BINARY_DIR}/generated/Ids.h" TARGET "../Ids.h")
#list(APPEND JSON_LINK_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/generated/Ids.h")
#CreateLink(LINK "${CMAKE_CURRENT_BINARY_DIR}/Module.h" TARGET "../interfaces/Module.h")
#list(APPEND PUBLIC_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/Module.h")
#CreateLink(LINK "${CMAKE_CURRENT_BINARY_DIR}/qa_generated/QAIds.h" TARGET "../QAIds.h")
#list(APPEND JSON_LINK_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/qa_generated/QAIds.h")

add_library(${Target} SHARED
Definitions.cpp
Module.cpp
${JSON_ENUM_SOURCES}
${QA_JSON_ENUM_SOURCES}
)

target_link_libraries(${Target}
Expand All @@ -81,22 +105,27 @@ target_include_directories(${Target}
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
$<INSTALL_INTERFACE:include/${NAMESPACE}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}>
)

install(
TARGETS ${Target} EXPORT ${Target}Targets # for downstream dependencies
ARCHIVE DESTINATION lib/ COMPONENT libs # static lib
LIBRARY DESTINATION lib/ COMPONENT libs # shared lib
RUNTIME DESTINATION bin COMPONENT libs # binaries
FRAMEWORK DESTINATION bin/ COMPONENT libs # for mac
PUBLIC_HEADER DESTINATION include/${NAMESPACE}/definitions COMPONENT devel # headers for mac (note the different component -> different package)
INCLUDES DESTINATION include/${NAMESPACE} # default include path
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/ COMPONENT libs # static lib
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/ COMPONENT libs # shared lib
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT libs # binaries
FRAMEWORK DESTINATION ${CMAKE_INSTALL_BINDIR}/ COMPONENT libs # for mac
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/definitions COMPONENT devel # headers for mac (note the different component -> different package)
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE} # default include path
)

install(
FILES ${JSON_LINK_HEADERS}
DESTINATION include/${NAMESPACE}/interfaces/json
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/interfaces/json
)

install(
FILES ${QA_JSON_LINK_HEADERS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${NAMESPACE}/qa_interfaces/json
)

InstallPackageConfig(
Expand Down
10 changes: 5 additions & 5 deletions definitions/Definitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@
#include <interfaces/IStoreCache.h>
#include <interfaces/ISwitchBoard.h>
#include <interfaces/ISystemCommands.h>
#include <interfaces/ITestController.h>
#include <interfaces/ITextToSpeech.h>
#include <interfaces/ITestUtility.h>
#include <interfaces/ITimeSync.h>
#include <interfaces/ITimeZone.h>
#include <interfaces/IVoiceHandler.h>
Expand All @@ -94,11 +92,13 @@
#include <interfaces/IWatchDog.h>
#include <interfaces/IZigWave.h>
#include "ValuePoint.h"
#endif

MODULE_NAME_DECLARATION(BUILD_REFERENCE)
#include <qa_interfaces/ITestUtility.h>
#include <qa_interfaces/ITestController.h>
#include <qa_interfaces/ITestAutomation.h>
#endif

namespace WPEFramework {
namespace Thunder {

struct ScreenResolutionWidthHeight {
Exchange::IDeviceVideoCapabilities::ScreenResolution resolution;
Expand Down
23 changes: 11 additions & 12 deletions definitions/Definitions.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@
<ClCompile Include="..\interfaces\json\JsonEnum_Streamer.cpp" />
<ClCompile Include="..\interfaces\json\JsonEnum_SubsystemControl.cpp" />
<ClCompile Include="..\interfaces\json\JsonEnum_SystemCommands.cpp" />
<ClCompile Include="..\interfaces\json\JsonEnum_TestController.cpp" />
<ClCompile Include="..\interfaces\json\JsonEnum_TestUtility.cpp" />
<ClCompile Include="..\interfaces\json\JsonEnum_TimeSync.cpp" />
<ClCompile Include="..\interfaces\json\JsonEnum_TimeZone.cpp" />
<ClCompile Include="..\interfaces\json\JsonEnum_TraceControl.cpp" />
Expand Down Expand Up @@ -136,6 +134,16 @@
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)../interfaces/json/JMessageControl.h</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)../interfaces/json/JMessageControl.h</Outputs>
</CustomBuild>
<CustomBuild Include="..\interfaces\IMessenger.h">
<OutputItemType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">ClInclude</OutputItemType>
<OutputItemType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">ClInclude</OutputItemType>
<OutputItemType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ClInclude</OutputItemType>
<OutputItemType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ClInclude</OutputItemType>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)../interfaces/json/JMessenger.h</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)../interfaces/json/JMessenger.h</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)../interfaces/json/JMessenger.h</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)../interfaces/json/JMessenger.h</Outputs>
</CustomBuild>
<CustomBuild Include="..\interfaces\IBrowser.h">
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)../interfaces/json/JBrowserResources.h</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)../interfaces/json/JBrowserResources.h</Outputs>
Expand Down Expand Up @@ -235,9 +243,6 @@
<CustomBuild Include="..\jsonrpc\LocationSync.json">
<FileType>Document</FileType>
</CustomBuild>
<CustomBuild Include="..\jsonrpc\Messenger.json">
<FileType>Document</FileType>
</CustomBuild>
<CustomBuild Include="..\jsonrpc\Monitor.json">
<FileType>Document</FileType>
</CustomBuild>
Expand Down Expand Up @@ -283,12 +288,6 @@
<CustomBuild Include="..\jsonrpc\SystemCommands.json">
<FileType>Document</FileType>
</CustomBuild>
<CustomBuild Include="..\jsonrpc\TestController.json">
<FileType>Document</FileType>
</CustomBuild>
<CustomBuild Include="..\jsonrpc\TestUtility.json">
<FileType>Document</FileType>
</CustomBuild>
<CustomBuild Include="..\jsonrpc\TimeSync.json">
<FileType>Document</FileType>
</CustomBuild>
Expand Down Expand Up @@ -605,4 +604,4 @@
<UserProperties _1_1_4jsonrpc_4Butler_1json__JsonSchema="&quot;" />
</VisualStudio>
</ProjectExtensions>
</Project>
</Project>
Loading

0 comments on commit 4cdf2bd

Please sign in to comment.