]> git.tdb.fi Git - builder.git/blobdiff - source/jarsigner.cpp
Redesign how tools are run
[builder.git] / source / jarsigner.cpp
index 991a7188088da7d4b2b7bfcc016839d25d96f53d..ac7c779b7c1c957c56d56c47505262c9f5bf6b3f 100644 (file)
@@ -13,19 +13,20 @@ JarSigner::JarSigner(Builder &b):
        Tool(b, "JSGN")
 {
        set_command("jarsigner");
+       set_run(_run);
 }
 
-Target *JarSigner::create_target(const list<Target *> &, const string &)
+Target *JarSigner::create_target(const vector<Target *> &, const string &)
 {
        throw logic_error("not implemented");
 }
 
-Task *JarSigner::run(const Target &tgt) const
+Task *JarSigner::_run(const FileTarget &file)
 {
-       const FileTarget &file = dynamic_cast<const FileTarget &>(tgt);
+       const Tool &tool = *file.get_tool();
 
        ExternalTask::Arguments argv;
-       argv.push_back(executable->get_path().str());
+       argv.push_back(tool.get_executable()->get_path().str());
 
        // TODO Make this generic
        FS::Path home_dir = Msp::getenv("HOME");