summaryrefslogtreecommitdiffstats
path: root/buildtool.cpp
diff options
context:
space:
mode:
authorBob Jamison <ishmalius@gmail.com>2008-03-31 18:14:58 +0000
committerishmal <ishmal@users.sourceforge.net>2008-03-31 18:14:58 +0000
commit0f270a59f397dca39befeed9f4ad83d2270bae5e (patch)
treed9161f8053ca0076e7caca729f6d94c28e081dec /buildtool.cpp
parentCmake: Start of Platform Checks (diff)
downloadinkscape-0f270a59f397dca39befeed9f4ad83d2270bae5e.tar.gz
inkscape-0f270a59f397dca39befeed9f4ad83d2270bae5e.zip
Add simple <jar> task. Separate "builddist" target
(bzr r5270)
Diffstat (limited to 'buildtool.cpp')
-rw-r--r--buildtool.cpp40
1 files changed, 38 insertions, 2 deletions
diff --git a/buildtool.cpp b/buildtool.cpp
index 24de41077..f912ebdea 100644
--- a/buildtool.cpp
+++ b/buildtool.cpp
@@ -38,7 +38,7 @@
*
*/
-#define BUILDTOOL_VERSION "BuildTool v0.7.6, 2007-2008 Bob Jamison"
+#define BUILDTOOL_VERSION "BuildTool v0.7.7, 2007-2008 Bob Jamison"
#include <stdio.h>
#include <fcntl.h>
@@ -6650,20 +6650,56 @@ class TaskJar : public Task
public:
TaskJar(MakeBase &par) : Task(par)
- { type = TASK_JAR; name = "jar"; }
+ { type = TASK_JAR; name = "jar"; command = "jar";}
virtual ~TaskJar()
{}
virtual bool execute()
{
+ String cmd = command;
+ cmd.append(" -cf ");
+ cmd.append(destfile);
+ cmd.append(" -C ");
+ cmd.append(basedir);
+ cmd.append(" .");
+
+ String execCmd = cmd;
+
+ String outString, errString;
+ bool ret = executeCommand(execCmd.c_str(), "", outString, errString);
+ if (!ret)
+ {
+ error("<jar> command '%s' failed :\n %s",
+ execCmd.c_str(), errString.c_str());
+ return false;
+ }
return true;
}
virtual bool parse(Element *elem)
{
+ String s;
+ if (!parent.getAttribute(elem, "command", s))
+ return false;
+ if (s.size() > 0)
+ command = s;
+ if (!parent.getAttribute(elem, "basedir", basedir))
+ return false;
+ if (!parent.getAttribute(elem, "destfile", destfile))
+ return false;
+ if (basedir.size() == 0 || destfile.size() == 0)
+ {
+ error("<jar> required both basedir and destfile attributes to be set");
+ return false;
+ }
return true;
}
+
+private:
+ String command;
+ String basedir;
+ String destfile;
};