3 This file is part of builder
4 Copyright © 2009 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #include <msp/fs/dir.h>
9 #include <msp/fs/utils.h>
11 #include "component.h"
12 #include "datacompile.h"
15 #include "sourcepackage.h"
19 DataCompile::DataCompile(Builder &b, ::DataFile &dfile):
22 const Component &comp = dfile.get_component();
24 work_dir = comp.get_package().get_source();
26 argv.push_back("mspdatatool");
30 FS::Path opath = dfile.get_path();
32 argv.push_back(relative(opath, work_dir).str());
34 FS::Path spath = dfile.get_source().get_path();
35 argv.push_back(relative(spath, work_dir).str());
37 if(!builder.get_dry_run())
38 FS::mkpath(FS::dirname(opath), 0755);
40 announce(comp.get_package().get_name(), "DATA", relative(opath, work_dir).str());