Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,28 @@ endif ()
# to the library structure later on will encounter issues caused by the
# generative nature of the project.
message("Generating Traits with openassetio-traitgen")

# Locate the openassetio-traitgen executable. This allows the user to
# override which traitgen is used via CMake mechanisms, e.g.
# CMAKE_PREFIX_PATH, or by directly setting
# OPENASSETIO_TRAITGEN_EXECUTABLE.
find_program(
OPENASSETIO_TRAITGEN_EXECUTABLE
NAMES openassetio-traitgen
REQUIRED
)
message(STATUS "Found openassetio-traitgen at: ${OPENASSETIO_TRAITGEN_EXECUTABLE}")

# Mark the traits source as a configure dependency by copying it to the
# binary dir, and use that file to run traitgen from.
# This means if the source traits file is changed, configure will rerun.
configure_file(${CMAKE_CURRENT_LIST_DIR}/traits.yml ${PROJECT_BINARY_DIR}/traits.yml)
execute_process(COMMAND openassetio-traitgen ${PROJECT_BINARY_DIR}/traits.yml
-o ${PROJECT_BINARY_DIR}/cpp -g cpp
COMMAND_ERROR_IS_FATAL ANY
COMMAND_ECHO STDERR)
execute_process(
COMMAND ${OPENASSETIO_TRAITGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/traits.yml
-o ${PROJECT_BINARY_DIR}/cpp -g cpp
COMMAND_ERROR_IS_FATAL ANY
COMMAND_ECHO STDERR
)

if (OPENASSETIO_MEDIACREATION_GENERATE_PYTHON)
# Generate the python package by running traitgen.
Expand All @@ -87,10 +101,12 @@ if (OPENASSETIO_MEDIACREATION_GENERATE_PYTHON)
# `pip install .` (and invoking setup.py), but that's not a
# guarentee going forward, as additional elements of the python
# package may be added to mediacreation.
execute_process(COMMAND openassetio-traitgen ${PROJECT_BINARY_DIR}/traits.yml
execute_process(
COMMAND ${OPENASSETIO_TRAITGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/traits.yml
-o ${PROJECT_BINARY_DIR}/python -g python
COMMAND_ERROR_IS_FATAL ANY
COMMAND_ECHO STDERR)
COMMAND_ECHO STDERR
)
endif()

add_library(openassetio-mediacreation INTERFACE)
Expand Down
10 changes: 10 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Release Notes
=============

v1.0.0-alpha.x
---------------

### Breaking changes

- Update the traits YAML to be compatible with the new schema defined in
`openassetio-traitgen` v1.0.0-alpha.13+, which adds versioning to
traits and specifications.
[#98](https://github.com/OpenAssetIO/OpenAssetIO-MediaCreation/issues/98)

v1.0.0-alpha.12
---------------

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[build-system]
requires = [
"setuptools>=65.5.0",
"openassetio-traitgen==1.0.0a12"
"openassetio-traitgen>=1.0.0a13"
]
build-backend = "setuptools.build_meta"

Expand Down
3 changes: 2 additions & 1 deletion tests/cpp/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ using namespace openassetio_mediacreation;

int main() {
auto traits = openassetio::trait::TraitsData::make();
auto trait = traits::managementPolicy::ManagedTrait(traits);
auto deprecated = traits::managementPolicy::ManagedTrait(traits);
auto trait = traits::managementPolicy::ManagedTrait_v1(traits);
trait.imbue();
return 0;
}
Loading