X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdatapackcomponent.cpp;h=0b8d020eead41c9c0adc50056f60acca3fff6a47;hb=HEAD;hp=5750287fefe39a3b024f6cbf8630fa271faf8db6;hpb=aa053d637e8259755af7d2e4b510a242f4d29c7b;p=builder.git diff --git a/source/datapackcomponent.cpp b/source/datapackcomponent.cpp deleted file mode 100644 index 5750287..0000000 --- a/source/datapackcomponent.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include -#include "builder.h" -#include "datapackcomponent.h" -#include "datasourcefile.h" -#include "sourcepackage.h" -#include "tool.h" - -using namespace std; -using namespace Msp; - -DataPackComponent::DataPackComponent(SourcePackage &p, const string &n): - Component(p, n) -{ } - -void DataPackComponent::create_targets() const -{ - Builder &builder = package.get_builder(); - Tool &dcomp = builder.get_toolchain().get_tool("DATA"); - - vector files; - for(const FS::Path &s: collect_source_files()) - { - string ext = FS::extpart(FS::basename(s)); - if(ext==".mdt") - { - Target *src = dcomp.create_source(*this, s); - files.push_back(dcomp.create_target(*src, "collection")); - } - else if(Target *tgt = builder.get_vfs().get_target(s)) - files.push_back(tgt); - else - files.push_back(new DataSourceFile(builder, *this, s)); - } - - Target *result = dcomp.create_target(files, "pack"); - - BuildGraph &build_graph = builder.get_build_graph(); - build_graph.add_primary_target(*result); - if(install) - build_graph.add_installed_target(*result); -}