]> git.tdb.fi Git - builder.git/blob - plugins/datafile/datacollection.cpp
Refactor transitive dependencies to work on all targets
[builder.git] / plugins / datafile / datacollection.cpp
1 #include <msp/builder/component.h>
2 #include <msp/builder/sourcepackage.h>
3 #include <msp/fs/utils.h>
4 #include "datacollection.h"
5 #include "datatransform.h"
6
7 using namespace Msp;
8
9 DataCollection::DataCollection(Builder &b, const Component &c, DataTransform &s):
10         FileTarget(b, c.get_package(), generate_target_path(c, s.get_path())),
11         source(s)
12 {
13         component = &c;
14         add_dependency(source);
15 }
16
17 Msp::FS::Path DataCollection::generate_target_path(const Component &comp, const Msp::FS::Path &src)
18 {
19         return comp.get_package().get_temp_directory()/comp.get_name()/(FS::basepart(FS::basename(src))+".mdc");
20 }