Skip to content

Commit

Permalink
feat: Firebolt CPP SDKs
Browse files Browse the repository at this point in the history
* CPPSDK: manage test added (rdkcentral#189)

* CPPSDK: standalone cpp test case added (rdkcentral#190)

* CPPTest: CXX compilor target added (rdkcentral#191)

* CPPSDK: test event sample test added (rdkcentral#192)

* CPPSDK: test event sample test added

* CPPSDK: more event test added

* CPPSDK: test updates based on interface name changes + disable rpc-only based methods/events (rdkcentral#205)

* CPPSDK: test case added for core (rdkcentral#209)

* CPPSDK: test case added for core

* Manage Test update based on provider integration

* Manage Test update based on provider integration

* Core test update to add more test case to link with provider sequence

* Core/Manage test app updates

* CPPSDK: templates added for metrics calls-metrics methods

* CPPSDK: test updates

* CPPSDK: Core test app updated with discovery.launch and watchNext

* CPPSDK: Core test cases added for discovery and capabilities

* CPPSDK: Core test cases updated based on openrpc generation support in features/cpp branch

* CPPSDK: install command added (rdkcentral#218)

* CoreTest: use has_value() check before accessing optional field (rdkcentral#222)

* use cpp header for strtok (rdkcentral#228)

* CPPSDK: use cpp header for strtok and cleanup (rdkcentral#230)

* CPP: update based on merge with next branch (rdkcentral#237)

* CPPSDK: updated Core test app to align with next branch merge changes (rdkcentral#238)

* CPPSDK: Async test case updates (rdkcentral#249)

* Pointed openrpc to cpp branch

* Pointed openrpc to cpp branch

* fix: Upgrade to latest firebolt-openrpc next build

---------

Co-authored-by: Santhosh Ramani <[email protected]>
Co-authored-by: Shah, Kevin <[email protected]>
Co-authored-by: Jeremy LaCivita <[email protected]>
  • Loading branch information
4 people authored Mar 27, 2024
1 parent 7c6ca7e commit 5ea5d4e
Show file tree
Hide file tree
Showing 34 changed files with 4,751 additions and 994 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"devDependencies": {
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@firebolt-js/openrpc": "2.3.0",
"@firebolt-js/openrpc": "3.0.0-next.1",
"@firebolt-js/schemas": "2.0.0",
"@saithodev/semantic-release-backmerge": "^3.2.0",
"@semantic-release/changelog": "^6.0.1",
Expand Down
5 changes: 4 additions & 1 deletion src/sdks/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"validate": "npx firebolt-openrpc validate --input ./dist/firebolt-core-open-rpc.json",
"sdk": "npx firebolt-openrpc sdk --input ./dist/firebolt-core-open-rpc.json --template ./src/js --output ./build/javascript/src --static-module Platform",
"native": "npx firebolt-openrpc sdk --input ./dist/firebolt-core-open-rpc.json --template ./src/cpp --output ./build/c/src --static-module Platform --language ../../../node_modules/@firebolt-js/openrpc/languages/c",
"cpp": "npm run cpp:compile && npm run cpp:install",
"cpp:compile": "npx firebolt-openrpc sdk --input ./dist/firebolt-core-open-rpc.json --template ./src/cpp --output ./build/cpp/src --static-module Platform --language ../../../node_modules/@firebolt-js/openrpc/languages/cpp",
"cpp:install":"./build/cpp/src/scripts/install.sh -i ./build/cpp/src -s ./build/cpp/src/ -m core",
"compile": "cd ../../.. && npm run compile",
"slice": "npx firebolt-openrpc slice -i ../../../dist/firebolt-open-rpc.json --sdk ./sdk.config.json -o ./dist/firebolt-core-open-rpc.json",
"docs": "npx firebolt-openrpc docs --input ./dist/firebolt-core-open-rpc.json --output build/docs/markdown --as-path",
Expand Down Expand Up @@ -50,4 +53,4 @@
"sdk"
],
"license": "Apache-2.0"
}
}
81 changes: 81 additions & 0 deletions src/sdks/core/src/cpp/sdk/cpptest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Copyright 2023 Comcast Cable Communications Management, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.3)

project(FireboltCoreSDKTests)

if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${SYSROOT_PATH}/usr" CACHE INTERNAL "" FORCE)
set(CMAKE_PREFIX_PATH ${SYSROOT_PATH}/usr/lib/cmake CACHE INTERNAL "" FORCE)
endif()

list(APPEND CMAKE_MODULE_PATH
"${SYSROOT_PATH}/usr/lib/cmake"
"${SYSROOT_PATH}/tools/cmake")
message("FIREBOLT_PATH inside cmake " ${FIREBOLT_PATH})
if (FIREBOLT_PATH)
set(CMAKE_FIREBOLT_PATH
"${FIREBOLT_PATH}/usr/lib/cmake/Firebolt"
"${FIREBOLT_PATH}/usr/lib/cmake/FireboltSDK")
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_FIREBOLT_PATH})
list(APPEND CMAKE_MODULE_PATH ${CMAKE_FIREBOLT_PATH})
else ()
set(FIREBOLT_PATH "${SYSROOT_PATH}" CACHE INTERNAL "" FORCE)
endif ()

find_package(WPEFramework CONFIG REQUIRED)
find_package(${NAMESPACE}Core CONFIG REQUIRED)
find_package(Firebolt CONFIG REQUIRED)
find_package(${FIREBOLT_NAMESPACE}SDK CONFIG REQUIRED)

set(TESTAPP TestFireboltCore)

message("Setup ${TESTAPP}")

add_executable(${TESTAPP} CoreSDKTest.cpp Main.cpp)

target_link_libraries(${TESTAPP}
PRIVATE
${NAMESPACE}Core::${NAMESPACE}Core
${FIREBOLT_NAMESPACE}SDK::${FIREBOLT_NAMESPACE}SDK
)

target_include_directories(${TESTAPP}
PRIVATE
$<BUILD_INTERFACE:${FIREBOLT_PATH}/usr/include/${FIREBOLT_NAMESPACE}SDK>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SRC_DIR}/>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SRC_DIR}/../>
)

if (POLYMORPHICS_REDUCER_METHODS)
target_compile_definitions(${TESTAPP}
PUBLIC
POLYMORPHICS_REDUCER_METHODS=1)
endif()

set_target_properties(${TESTAPP} PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED YES
)

add_custom_command(
TARGET ${TESTAPP}
POST_BUILD
COMMENT "=================== Installing TestApp ======================"
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/${FIREBOLT_NAMESPACE}/usr/bin
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${TESTAPP} ${CMAKE_BINARY_DIR}/${FIREBOLT_NAMESPACE}/usr/bin
)
Loading

0 comments on commit 5ea5d4e

Please sign in to comment.