Skip to content

Commit

Permalink
[develop2] add build_modules to provided deprecated warning (#12578)
Browse files Browse the repository at this point in the history
* [develop2] add `build_modules` to mock property info

* fix copy paste

* Update test_legacy_cpp_info.py

* add missing test

Co-authored-by: James <james@conan.io>
  • Loading branch information
prince-chrismc and memsharded authored Nov 22, 2022
1 parent c7494e3 commit ac15b48
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions conans/model/build_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def __init__(self, set_defaults=False):
# LEGACY 1.X fields, can be removed in 2.X
self.names = MockInfoProperty("cpp_info.names")
self.filenames = MockInfoProperty("cpp_info.filenames")
self.build_modules = MockInfoProperty("cpp_info.build_modules")

if set_defaults:
self.includedirs = ["include"]
Expand Down
6 changes: 5 additions & 1 deletion conans/test/integration/conan_v2/test_legacy_cpp_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ class Pkg(ConanFile):
def package_info(self):
self.cpp_info.components["comp"].names["cmake_find_package"] = "hello"
self.cpp_info.components["comp"].names["cmake_find_package_multi"] = "hello"
self.cpp_info.components["comp"].build_modules["cmake_find_package"] = ["nice_rel_path"]
self.cpp_info.components["comp"].build_modules["cmake_find_package_multi"] = ["nice_rel_path"]
self.cpp_info.names["cmake_find_package"] = "absl"
self.cpp_info.names["cmake_find_package_multi"] = "absl"
self.cpp_info.filenames["cmake_find_package"] = "tensorflowlite"
self.cpp_info.filenames["cmake_find_package_multi"] = "tensorflowlite"
self.cpp_info.build_modules["cmake_find_package"] = ["nice_rel_path"]
self.cpp_info.build_modules["cmake_find_package_multi"] = ["nice_rel_path"]
self.env_info.whatever = "whatever-env_info"
self.user_info.whatever = "whatever-user_info"
Expand All @@ -28,5 +32,5 @@ def package_info(self):
"Conan 2.X. Please, update your recipes unless you are maintaining compatibility " \
"with Conan 1.X"

for name in ["cpp_info.names", "cpp_info.filenames", "env_info", "user_info"]:
for name in ["cpp_info.names", "cpp_info.filenames", "env_info", "user_info", "cpp_info.build_modules"]:
assert message.format(name) in c.out

0 comments on commit ac15b48

Please sign in to comment.