Skip to content
Closed
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
3 changes: 2 additions & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ jobs:
run: |
python -m pip install .
python -m pip install -r examples/resources/requirements.txt
python -m pip install openassetio-traitgen
# TODO(DF): Revert to PyPI when v1.0.0-alpha.13+ available
python -m pip install git+https://github.com/OpenAssetIO/OpenAssetIO-TraitGen.git

- name: Build/install OpenAssetIO
uses: ./.github/build_openassetio
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ jobs:
install-prefix: openassetio

- name: Install Traitgen
run: python -m pip install openassetio-traitgen
# TODO(DF): Revert to PyPI when v1.0.0-alpha.13+ available
run: python -m pip install git+https://github.com/OpenAssetIO/OpenAssetIO-TraitGen.git

- name: Configure CMake build
run: |
Expand All @@ -68,7 +69,8 @@ jobs:
- uses: actions/checkout@v3

- name: Install Traitgen
run: python -m pip install openassetio-traitgen
# TODO(DF): Revert to PyPI when v1.0.0-alpha.13+ available
run: python -m pip install git+https://github.com/OpenAssetIO/OpenAssetIO-TraitGen.git

- name: Configure CMake build
run: >
Expand Down Expand Up @@ -97,7 +99,8 @@ jobs:
- uses: actions/checkout@v3

- name: Install Traitgen
run: python -m pip install openassetio-traitgen
# TODO(DF): Revert to PyPI when v1.0.0-alpha.13+ available
run: python -m pip install git+https://github.com/OpenAssetIO/OpenAssetIO-TraitGen.git

- name: Set Python Root Dir
run: echo "Python_ROOT_DIR=$(python -c 'import sys; print(sys.prefix)')" >> $GITHUB_ENV
Expand Down
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
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 decprecated = traits::managementPolicy::ManagedTrait(traits);
auto trait = traits::managementPolicy::ManagedTrait_v1(traits);
trait.imbue();
return 0;
}
Loading
Loading