Repository navigation
Write the library version as BTCPP_version in the <root> of generated XML - #1264
Merged
Merged
Conversation
…erated XML writeTreeNodesModelXML() and WriteTreeToXML() now add BTCPP_version="<major>.<minor>" to <root>, next to BTCPP_format. It tells tools like Groot2 which builtin node models and attributes (e.g. the _onlyIf/_onStart preconditions of 4.11) are available. The XSD declares it as an optional attribute. The parser ignores it, as all BT.CPP 4.x releases already ignore unknown <root> attributes, so files written by 4.11 still load in older versions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
writeTreeNodesModelXML()andWriteTreeToXML()now write the library version in<root>:The value is
major.minor, taken fromLibraryVersionString(). On master it reads4.10until the version is bumped.Why
Groot2 needs to know which BT.CPP version a file or a monitored tree targets:
UnsetBlackboardarrived in 4.5,WaitValueUpdateand friends in 4.6,TryCatchin 4.9);_onlyIfand_onStartpreconditions (Add _onlyIf and _onStart preconditions (#820, #895) #1261) exist only from 4.11.Groot2 will let users pick the target version in its Preferences and will write the same attribute. With this PR, XML generated by the library carries it too, including the tree that
Groot2Publishersends.Compatibility
BTCPP_formatandmain_tree_to_executefrom<root>, so files written by 4.11 still load in older versions.BTCPP_versionas an optional attribute, so files without it still validate.Tests
BehaviorTreeFactory.WrittenXMLHasLibraryVersionchecks that both writers emit the attribute and that the output loads and runs again. It fails without the change. The full suite passes: 596 passed, 2 skipped.🤖 Generated with Claude Code