]> git.tdb.fi Git - builder.git/blobdiff - source/datacollection.cpp
Reimplement datafile building
[builder.git] / source / datacollection.cpp
diff --git a/source/datacollection.cpp b/source/datacollection.cpp
new file mode 100644 (file)
index 0000000..28f90c8
--- /dev/null
@@ -0,0 +1,20 @@
+#include <msp/fs/utils.h>
+#include "component.h"
+#include "datacollection.h"
+#include "datatransform.h"
+#include "sourcepackage.h"
+
+using namespace Msp;
+
+DataCollection::DataCollection(Builder &b, const Component &c, DataTransform &s):
+       FileTarget(b, c.get_package(), generate_target_path(c, s.get_path())),
+       source(s)
+{
+       component = &c;
+       add_dependency(source);
+}
+
+Msp::FS::Path DataCollection::generate_target_path(const Component &comp, const Msp::FS::Path &src)
+{
+       return comp.get_package().get_temp_directory()/comp.get_name()/(FS::basepart(FS::basename(src))+".mdc");
+}