]> git.tdb.fi Git - builder.git/commitdiff
Fix DataCollection dependencies
authorMikko Rasa <tdb@tdb.fi>
Mon, 10 Nov 2014 17:51:44 +0000 (19:51 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 10 Nov 2014 17:51:44 +0000 (19:51 +0200)
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
source/datacollection.h
source/datatransform.cpp

index 28f90c81369a0706fea8ca0e8e4eda7db0407e2d..66e9a042012b9d797cfa866b3a70cd3c7b16da86 100644 (file)
@@ -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);
+}
index 2f61b5f24b3167e62c72e85512f3e39e56c16031..b86da0762a90350ee7cd594437c87b1e248f3e6d 100644 (file)
@@ -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
index 31aaa378b2be35529a5a8d8336e59142f41c12f3..e45c80a69085f4e68d51dffc8005476d7ecf206c 100644 (file)
@@ -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));
        }
 }