From 41fdd69eb3f7c28ba91be3699d89ba1c2328cfdf Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 10 Nov 2014 19:51:44 +0200 Subject: [PATCH] Fix DataCollection dependencies Since DataTransform is not buildable, it won't get a rebuild flag even if its dependencies change. Thus the dependencies must also be added to DataCollection. --- source/datacollection.cpp | 8 ++++++++ source/datacollection.h | 3 +++ source/datatransform.cpp | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/source/datacollection.cpp b/source/datacollection.cpp index 28f90c8..66e9a04 100644 --- a/source/datacollection.cpp +++ b/source/datacollection.cpp @@ -18,3 +18,11 @@ Msp::FS::Path DataCollection::generate_target_path(const Component &comp, const { return comp.get_package().get_temp_directory()/comp.get_name()/(FS::basepart(FS::basename(src))+".mdc"); } + +void DataCollection::find_dependencies() +{ + source.prepare(); + const Target::Dependencies &tdeps = source.get_transitive_dependencies(); + for(Target::Dependencies::const_iterator i=tdeps.begin(); i!=tdeps.end(); ++i) + add_dependency(**i); +} diff --git a/source/datacollection.h b/source/datacollection.h index 2f61b5f..b86da07 100644 --- a/source/datacollection.h +++ b/source/datacollection.h @@ -18,6 +18,9 @@ private: public: virtual const char *get_type() const { return "DataCollection"; } DataTransform &get_source() const { return source; } + +private: + virtual void find_dependencies(); }; #endif diff --git a/source/datatransform.cpp b/source/datatransform.cpp index 31aaa37..e45c80a 100644 --- a/source/datatransform.cpp +++ b/source/datatransform.cpp @@ -64,8 +64,8 @@ void DataTransform::find_dependencies() { FS::Path file_path = FS::dirname(path)/ *i; if(Target *tgt = builder.get_vfs().get_target(file_path)) - add_dependency(*tgt); + add_transitive_dependency(*tgt); else - add_dependency(*new File(builder, *package, file_path)); + add_transitive_dependency(*new File(builder, *package, file_path)); } } -- 2.43.0