Index: build.xml
===================================================================
--- build.xml (revision 18954)
+++ build.xml (working copy)
@@ -53,6 +53,7 @@
+
@@ -197,6 +198,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
@@ -222,7 +280,7 @@
-
+
@@ -240,14 +298,17 @@
+
-
+
+
+
-
+
@@ -299,6 +360,7 @@
${pcc.poppler}
-I${devlibs}/include/gc
${pcc.libwpg-0.1} ${pcc.libwpg-stream-0.1}
+ -I${cxxtest}
@@ -323,6 +385,12 @@
+
+
+
+
+
+
@@ -455,6 +523,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -L${devlibs}/lib
+ ${pcl.poppler-cairo} ${pcl.poppler-glib} ${pcl.poppler}
+ ${pcl.gtkmm-2.4} ${pcl.pangoft2} ${pcl.gthread-2.0}
+ ${devlibs}/bin/libxml2.dll
+ ${devlibs}/bin/libxslt.dll
+ ${pcl.cairo} ${pcl.cairomm-1.0}
+ ${pcl.libwpg-0.1} ${pcl.libwpg-stream-0.1}
+ ${devlibs}/lib/iconv.lib
+ ${pcl.ImageMagick++}
+ ${pcl.fontconfig} ${pcl.freetype2}
+ -lssl -lcrypto
+ ${pcl.lcms}
+ ${pcl.gsl}
+ -lpng -ljpeg.dll -ltiff.dll -lpopt ${devlibs}/lib/zdll.lib
+ -lgc
+ -lws2_32 -lintl -lgdi32 -lcomdlg32 -lm
+
+
+
+
+
+
@@ -683,6 +795,12 @@
+
+
+
+
+
+
Index: buildtool.cpp
===================================================================
--- buildtool.cpp (revision 18954)
+++ buildtool.cpp (working copy)
@@ -3,6 +3,7 @@
*
* Authors:
* Bob Jamison
+ * Jasper van de Gronde
*
* Copyright (C) 2006-2008 Bob Jamison
*
@@ -2778,7 +2779,7 @@
/**
*
*/
- String getDirectory()
+ String getDirectory() const
{ return directory; }
/**
@@ -2796,7 +2797,7 @@
/**
*
*/
- std::vector getFiles()
+ std::vector getFiles() const
{ return files; }
/**
@@ -2808,7 +2809,7 @@
/**
*
*/
- std::vector getIncludes()
+ std::vector getIncludes() const
{ return includes; }
/**
@@ -2820,19 +2821,19 @@
/**
*
*/
- std::vector getExcludes()
+ std::vector getExcludes() const
{ return excludes; }
/**
*
*/
- unsigned int size()
+ unsigned int size() const
{ return files.size(); }
/**
*
*/
- String operator[](int index)
+ String operator[](int index) const
{ return files[index]; }
/**
@@ -6374,6 +6375,8 @@
TASK_NONE,
TASK_CC,
TASK_COPY,
+ TASK_CXXTEST_PART,
+ TASK_CXXTEST_ROOT,
TASK_DELETE,
TASK_ECHO,
TASK_JAR,
@@ -7080,6 +7083,219 @@
/**
+ * Generate CxxTest files
+ */
+class TaskCxxTestPart: public Task
+{
+public:
+
+ TaskCxxTestPart(MakeBase &par) : Task(par)
+ {
+ type = TASK_CXXTEST_PART;
+ name = "cxxtestpart";
+ command = "cxxtestgen.py";
+ }
+
+ virtual ~TaskCxxTestPart()
+ {}
+
+ virtual bool execute()
+ {
+ if (!listFiles(parent, fileSet))
+ return false;
+ String fileSetDir = fileSet.getDirectory();
+
+ String fullDest = parent.resolve(destPath);
+ String cmd = command;
+ cmd.append(" --part -o ");
+ cmd.append(fullDest);
+
+ unsigned int newFiles = 0;
+ for (unsigned int i=0 ; i0)
+ {
+ sourcePath.append(fileSetDir);
+ sourcePath.append("/");
+ }
+ sourcePath.append(fileName);
+ String fullSource = parent.resolve(sourcePath);
+
+ cmd.append(" ");
+ cmd.append(fullSource);
+ if (isNewerThan(fullSource, fullDest)) newFiles++;
+ }
+
+ if (newFiles>0) {
+ size_t const lastSlash = fullDest.find_last_of('/');
+ if (lastSlash != fullDest.npos) {
+ String directory(fullDest, 0, lastSlash);
+ if (!createDirectory(directory))
+ return false;
+ }
+
+ String outString, errString;
+ if (!executeCommand(cmd.c_str(), "", outString, errString))
+ {
+ error(" problem: %s", errString.c_str());
+ return false;
+ }
+ } else {
+ //trace("skip %s", fullDest.c_str());
+ }
+
+ 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, "out", destPath))
+ return false;
+
+ std::vector children = elem->getChildren();
+ for (unsigned int i=0 ; igetName();
+ if (tagName == "fileset")
+ {
+ if (!parseFileSet(child, parent, fileSet))
+ return false;
+ }
+ }
+ return true;
+ }
+
+private:
+
+ String command;
+ String destPath;
+ FileSet fileSet;
+
+};
+
+
+/**
+ * Generate the CxxTest root file
+ */
+class TaskCxxTestRoot: public Task
+{
+public:
+
+ TaskCxxTestRoot(MakeBase &par) : Task(par)
+ {
+ type = TASK_CXXTEST_ROOT;
+ name = "cxxtestroot";
+ command = "cxxtestgen.py";
+ }
+
+ virtual ~TaskCxxTestRoot()
+ {}
+
+ virtual bool execute()
+ {
+ if (!listFiles(parent, fileSet))
+ return false;
+ String fileSetDir = fileSet.getDirectory();
+ unsigned int newFiles = 0;
+
+ String fullDest = parent.resolve(destPath);
+ String cmd = command;
+ cmd.append(" --root -o ");
+ cmd.append(fullDest);
+ if (templateFile.size()>0) {
+ String fullTemplate = parent.resolve(templateFile);
+ cmd.append(" --template=");
+ cmd.append(fullTemplate);
+ if (isNewerThan(fullTemplate, fullDest)) newFiles++;
+ }
+
+ for (unsigned int i=0 ; i0)
+ {
+ sourcePath.append(fileSetDir);
+ sourcePath.append("/");
+ }
+ sourcePath.append(fileName);
+ String fullSource = parent.resolve(sourcePath);
+
+ cmd.append(" ");
+ cmd.append(fullSource);
+ if (isNewerThan(fullSource, fullDest)) newFiles++;
+ }
+
+ if (newFiles>0) {
+ size_t const lastSlash = fullDest.find_last_of('/');
+ if (lastSlash != fullDest.npos) {
+ String directory(fullDest, 0, lastSlash);
+ if (!createDirectory(directory))
+ return false;
+ }
+
+ String outString, errString;
+ if (!executeCommand(cmd.c_str(), "", outString, errString))
+ {
+ error(" problem: %s", 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, "template", s))
+ return false;
+ if (s.size()>0)
+ templateFile = s;
+ if (!parent.getAttribute(elem, "out", destPath))
+ return false;
+
+ std::vector children = elem->getChildren();
+ for (unsigned int i=0 ; igetName();
+ if (tagName == "fileset")
+ {
+ if (!parseFileSet(child, parent, fileSet))
+ return false;
+ }
+ }
+ return true;
+ }
+
+private:
+
+ String command;
+ String templateFile;
+ String destPath;
+ FileSet fileSet;
+
+};
+
+
+/**
*
*/
class TaskDelete : public Task
@@ -8481,6 +8697,10 @@
task = new TaskCC(parent);
else if (tagName == "copy")
task = new TaskCopy(parent);
+ else if (tagName == "cxxtestpart")
+ task = new TaskCxxTestPart(parent);
+ else if (tagName == "cxxtestroot")
+ task = new TaskCxxTestRoot(parent);
else if (tagName == "delete")
task = new TaskDelete(parent);
else if (tagName == "echo")