]> git.tdb.fi Git - builder.git/blobdiff - source/jarsigner.cpp
Refactor the use of external tasks in tools
[builder.git] / source / jarsigner.cpp
index ac7c779b7c1c957c56d56c47505262c9f5bf6b3f..a2a1c731e1ce6d16e127d1abf87f58592212789c 100644 (file)
@@ -1,7 +1,6 @@
 #include <msp/core/environ.h>
 #include <msp/fs/utils.h>
 #include "component.h"
-#include "externaltask.h"
 #include "filetarget.h"
 #include "jarsigner.h"
 #include "sourcepackage.h"
@@ -13,7 +12,7 @@ JarSigner::JarSigner(Builder &b):
        Tool(b, "JSGN")
 {
        set_command("jarsigner");
-       set_run(_run);
+       set_run_external(_run);
 }
 
 Target *JarSigner::create_target(const vector<Target *> &, const string &)
@@ -21,7 +20,7 @@ Target *JarSigner::create_target(const vector<Target *> &, const string &)
        throw logic_error("not implemented");
 }
 
-Task *JarSigner::_run(const FileTarget &file)
+ExternalTask::Arguments JarSigner::_run(const FileTarget &file, FS::Path &work_dir)
 {
        const Tool &tool = *file.get_tool();
 
@@ -35,10 +34,8 @@ Task *JarSigner::_run(const FileTarget &file)
        argv.push_back("-storepass");
        argv.push_back("android");
 
-       FS::Path work_dir = file.get_component()->get_package().get_source_directory();
-
        argv.push_back(FS::relative(file.get_path(), work_dir).str());
        argv.push_back("androiddebugkey");
 
-       return new ExternalTask(argv, work_dir);
+       return argv;
 }