]> git.tdb.fi Git - builder.git/blobdiff - source/datapack.cpp
Reimplement datafile building
[builder.git] / source / datapack.cpp
diff --git a/source/datapack.cpp b/source/datapack.cpp
new file mode 100644 (file)
index 0000000..2b3d9f2
--- /dev/null
@@ -0,0 +1,21 @@
+#include "component.h"
+#include "datapack.h"
+#include "sourcepackage.h"
+
+using namespace std;
+
+DataPack::DataPack(Builder &b, const Component &c, const list<FileTarget *> &f):
+       FileTarget(b, c.get_package(), generate_target_path(c)),
+       files(f)
+{
+       component = &c;
+       for(list<FileTarget *>::const_iterator i=files.begin(); i!=files.end(); ++i)
+               add_dependency(**i);
+
+       install_location = Msp::FS::Path("share")/package->get_name();
+}
+
+Msp::FS::Path DataPack::generate_target_path(const Component &comp)
+{
+       return comp.get_package().get_output_directory()/(comp.get_name()+".mdp");
+}