Code

Allow msgfmt to create a subdir for each .mo file, such as de/de.mo
authorishmal <ishmal@users.sourceforge.net>
Thu, 23 Nov 2006 22:35:43 +0000 (22:35 +0000)
committerishmal <ishmal@users.sourceforge.net>
Thu, 23 Nov 2006 22:35:43 +0000 (22:35 +0000)
build.xml
buildtool.cpp

index c890c1a7de22ba04c7fed929136d18317cb090bb..66ac63b92318b750a68fdf81cdd283b024ce0a5a 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -1,6 +1,8 @@
-<project name="Sands" default="dist" basedir=".">
+<project name="Inkscape" default="dist" basedir=".">
     <description>
-        Build file for Sands office data tool
+        Build file for the Inkscape SVG editor.  This file
+        was written for GTK-2.10 on Win32, but it should work
+        well for other types of builds with only minor adjustments.
     </description>
 
   <!-- set global properties for this build -->
   </target>
 
   <target name="i18n" depends="compile">
-    <msgfmt todir="${build}/po">
+    <msgfmt todir="${build}/locale" owndir="true">
           <fileset dir="po">
           </fileset>
        </msgfmt>
 
     <!-- MSGFMT files -->
     <copy todir="${dist}">
-           <fileset dir="${build}/po">
+           <fileset dir="${build}/locale">
                  <exclude name=".*\.am"/>
                </fileset>
        </copy>
index 80c43e2c60b1ccf3362068415000aae555fbc567..77527d2c3595c7d777dc80f99fe25479cf708864 100644 (file)
@@ -6558,9 +6558,10 @@ public:
 
     TaskMsgFmt(MakeBase &par) : Task(par)
          {
-                type = TASK_MSGFMT;
-                name = "msgfmt";
+                type    = TASK_MSGFMT;
+                name    = "msgfmt";
                 command = "msgfmt";
+                owndir  = false;
                 }
 
     virtual ~TaskMsgFmt()
@@ -6593,6 +6594,15 @@ public:
                            destPath.append(toDirName);
                 destPath.append("/");
                 }
+            if (owndir)
+                {
+                String subdir = fileName;
+                unsigned int pos = subdir.find_last_of('.');
+                if (pos != subdir.npos)
+                    subdir = subdir.substr(0, pos);
+                destPath.append(subdir);
+                destPath.append("/");
+                }
             destPath.append(fileName);
             destPath[destPath.size()-2] = 'm';
             String fullDest = parent.resolve(destPath);
@@ -6634,6 +6644,11 @@ public:
         {
         if (!parent.getAttribute(elem, "todir", toDirName))
             return false;
+        String s;
+        if (!parent.getAttribute(elem, "owndir", s))
+            return false;
+        if (!getBool(s, owndir))
+            return false;
             
         std::vector<Element *> children = elem->getChildren();
         for (unsigned int i=0 ; i<children.size() ; i++)
@@ -6654,6 +6669,7 @@ private:
     String command;
     String toDirName;
     FileSet fileSet;
+    bool owndir;
 
 };