Skip to content

Commit

Permalink
Merge pull request #31 from ynput/develop
Browse files Browse the repository at this point in the history
new cpp api release to switch to constructors from env variables
  • Loading branch information
Lypsolon authored Dec 10, 2024
2 parents 34db067 + 0a3dec6 commit c9004d0
Show file tree
Hide file tree
Showing 15 changed files with 264 additions and 549 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ build/
.cache
bin/
Docs/docs/
test_logs/
BuildArtefacts/
test_logs/
AyonCppApi_CiCd/
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
path = ext/googletest
url = https://github.com/google/googletest.git
tag = v1.14.0
[submodule "ext/ayon-cpp-dev-tools"]
path = ext/ayon-cpp-dev-tools
url = https://github.com/ynput/ayon-cpp-dev-tools.git
[submodule "ayon_automator"]
path = ayon_automator
url = https://github.com/ynput/ayon-automator.git
47 changes: 23 additions & 24 deletions AyonBuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
from ayon_automator.AyonCiCd import Cmake, Project, docGen, GBench, GTest


# define a Project that you want to CiCd
AyonCppApiPrj = Project.Project("AyonCppApi")

# add packages to the project
AyonCppApiPrj.add_pip_package("pytest")
AyonCppApiPrj.add_pip_package("fastapi==0.109.1")
AyonCppApiPrj.add_pip_package("uvicorn[standard]==0.25.0")
Expand All @@ -30,9 +28,7 @@
)
AyonCppApiPrj.add_stage(SetTestVars)

# define stages for this project
CleanUpStage = Project.Stage("Cleanup")
# define what happens in this stage
binFoulder = os.path.join(os.getcwd(), "bin")
buildFoulder = os.path.join(os.getcwd(), "build")
CleanUpStage.add_funcs(
Expand All @@ -49,7 +45,6 @@
ignore_errors=True,
),
)
# add the stage to the project
AyonCppApiPrj.add_stage(CleanUpStage)


Expand Down Expand Up @@ -78,6 +73,7 @@
"build",
"--config",
lambda: f"{AyonCppApiPrj.getVar('ReleaseType')}",
f"-j{os.cpu_count()}",
),
Project.Func(
"Run Cmake Install Command",
Expand Down Expand Up @@ -107,10 +103,7 @@


def startTestApp():
os.environ["AYON_API_KEY"] = "SuperSaveTestKey"
os.environ["AYON_SERVER_URL"] = "http://localhost:8003"
os.environ["AYON_SITE_ID"] = "TestId"
os.environ["AYON_PROJECT_NAME"] = "TestPrjName"

GTest.run_google_test(
"bin/AyonCppApiGtestMain",
f"{AyonCppApiPrj._build_artefacts_out_path}/GTest/Test.xml",
Expand All @@ -119,38 +112,32 @@ def startTestApp():
)


def setupBenchEnvVars():
os.environ["AYON_API_KEY"] = "SuperSaveTestKey"
os.environ["AYON_SERVER_URL"] = "http://localhost:8003"
os.environ["AYON_SITE_ID"] = "TestId"
os.environ["AYON_PROJECT_NAME"] = "TestPrjName"
os.environ["AYONLOGGERLOGLVL"] = "CRITICAL"
os.environ["AYONLOGGERFILELOGGING"] = "OFF"


def runSerialBench():
setupBenchEnvVars()
GBench.run_google_benchmark(
"bin/AyonCppApiGBenchMain",
f"{AyonCppApiPrj._build_artefacts_out_path}/GBench/SerialResolve.json",
None,
None,
"--benchmark_filter=AyonCppApiSerialResolve",
)


def runBatchBench():
setupBenchEnvVars()
GBench.run_google_benchmark(
"bin/AyonCppApiGBenchMain",
f"{AyonCppApiPrj._build_artefacts_out_path}/GBench/BatchResolve.json",
None,
None,
"--benchmark_filter=AyonCppApiBatchResolve",
)


def runAllBench():
setupBenchEnvVars()
GBench.run_google_benchmark(
"bin/AyonCppApiGBenchMain",
f"{AyonCppApiPrj._build_artefacts_out_path}/GBench/AllResolve.json",
None,
None,
)


Expand Down Expand Up @@ -205,12 +192,24 @@ def stopTestServer():
AyonCppApiPrj.add_stage(BenchStage)


AyonCppApiPrj.creat_stage_group("CleanBuild", CleanUpStage, BuildStage)
AyonCppApiPrj.creat_stage_group(
"CleanBuildAndDocs", CleanUpStage, BuildStage, DoxyGenStage
"CleanBuild",
CleanUpStage,
BuildStage,
)
AyonCppApiPrj.creat_stage_group(
"CleanBuildAndDocs",
CleanUpStage,
BuildStage,
DoxyGenStage,
)
AyonCppApiPrj.creat_stage_group(
"BuildAndTest", SetTestVars, BuildStage, SetupTestServer, TestStage, StopTestServer
"BuildAndTest",
SetTestVars,
BuildStage,
SetupTestServer,
TestStage,
StopTestServer,
)
AyonCppApiPrj.creat_stage_group(
"CleanBuildAndTest",
Expand Down
11 changes: 7 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

add_compile_definitions(JTRACE=${JTRACE})
# We need to define this variable in order for httplib to support https clients
add_compile_definitions(CPPHTTPLIB_OPENSSL_SUPPORT)

option(BUILD_TEST "Build the test application" OFF)

Expand All @@ -32,8 +30,13 @@ add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ext/cpp-httplib" EXCLUDE_FROM_ALL)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/ext/cpp-httplib")
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ext/json" EXCLUDE_FROM_ALL)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/ext/json/include")
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ext/spdlog" EXCLUDE_FROM_ALL)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/ext/spdlog/include")
# add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ext/spdlog" EXCLUDE_FROM_ALL)
# include_directories("${CMAKE_CURRENT_SOURCE_DIR}/ext/spdlog/include")

set(AYON_CPPTOOLS_BUILD_LOGGER 1)
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ext/ayon-cpp-dev-tools")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/ext/ayon-cpp-dev-tools/src/")


project(${AR_PROJECT_NAME} VERSION 1.0.0 LANGUAGES CXX)

Expand Down
Loading

0 comments on commit c9004d0

Please sign in to comment.