Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed handling of absolute paths in glob patterns #233

Merged
merged 2 commits into from
Jan 28, 2024
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
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
param ($Prefix="C:\clang-uml", $BuildType="Release")
param ($Prefix="C:\clang-uml-llvm17", $BuildType="Release")

cmake -S . -B $BuildType -DCMAKE_PREFIX_PATH="$Prefix" -DENABLE_CXX_MODULES_TEST_CASES=OFF -Thost=x64
cmake --build $BuildType --config $BuildType
Expand Down
2 changes: 1 addition & 1 deletion packaging/make_installer.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This script assumes that all clang-uml dependencies are instaled in C:\clang-uml

param ($Prefix="C:\clang-uml", $BuildType="Release")
param ($Prefix="C:\clang-uml-llvm17", $BuildType="Release")

mkdir _BUILD

Expand Down
14 changes: 10 additions & 4 deletions src/config/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,18 @@ std::vector<std::string> diagram::get_translation_units() const
LOG_DBG("Looking for translation units in {}", root_directory().string());

for (const auto &g : glob()) {
std::string glob_path =
fmt::format("{}/{}", root_directory().string(), g.c_str());
std::filesystem::path absolute_glob_path{g};

LOG_DBG("Searching glob path {}", glob_path);
#ifdef _MSC_VER
if (!absolute_glob_path.has_root_name())
#else
if (!absolute_glob_path.is_absolute())
#endif
absolute_glob_path = root_directory() / absolute_glob_path;

LOG_DBG("Searching glob path {}", absolute_glob_path.string());

auto matches = glob::glob(glob_path, true, false);
auto matches = glob::glob(absolute_glob_path.string(), true, false);

for (const auto &match : matches) {
const auto path =
Expand Down
2 changes: 1 addition & 1 deletion tests/t00025/.clang-uml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ diagrams:
t00025_class:
type: class
glob:
- /t00025.cc
- t00025.cc
using_namespace: clanguml::t00025
include:
namespaces:
Expand Down
Loading