]> git.tdb.fi Git - builder.git/blobdiff - source/jarsigner.cpp
Redesign how tools are run
[builder.git] / source / jarsigner.cpp
index c8448d2c302c2ff7cdba2434ddf64509c7f22cbd..ac7c779b7c1c957c56d56c47505262c9f5bf6b3f 100644 (file)
@@ -13,6 +13,7 @@ JarSigner::JarSigner(Builder &b):
        Tool(b, "JSGN")
 {
        set_command("jarsigner");
+       set_run(_run);
 }
 
 Target *JarSigner::create_target(const vector<Target *> &, const string &)
@@ -20,12 +21,12 @@ 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");