News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Create delivery package based on the project file

Started by hcye, December 20, 2007, 12:31:59 AM

Previous topic - Next topic

hcye

Is it possible to copy a set files used by a project file, using the same directory hierarchy, in order to package them for delivery?

mandrav

Not yet but it's something so easy to do that I just added a script plugin that does just that.
Wait for the next nightly.
Be patient!
This bug will be fixed soon...

Jenna

"make_dist.script" is missing from "Makefile.am" in "src/scripts", so it's doesn't get installed when using "./configure", "make" and "make install".

If there is more then one project iin the workspace the CurrentWorkingDir is the one of the last loaded project, what makes zip unable to find the projects files.
If run twice the replacement of "$ARCHIVE" and "$FILES_LIST" is permanent (until restarting C::B), because "local cmd = Cmd;"  make "cmd" use the same memory then "Cmd".

Here is a patch to fix this.
After patching you need to run "./bootstrap" to update "src/scripts/Makefile.in".


--- codeblocks-1.0svn.orig/src/scripts/make_dist.script 2007-12-20 14:20:59.000000000 +0100
+++ codeblocks-1.0svn.work/src/scripts/make_dist.script 2007-12-21 11:28:48.000000000 +0100
@@ -53,6 +53,10 @@
                return -1;
         }

+        // if there is more then one project in the workspace the current working dir is the one of the last loaded project,
+        // so we have to set it explicitely to make the zip-command find the files
+        IO.SetCwd(prj.GetCommonTopLevelPath());
+
         // good, now let's get the project's filename
         local prj_fname = wxFileName();
         prj_fname.Assign(prj.GetFilename(), ::wxPATH_NATIVE);
@@ -71,7 +75,10 @@
         }

         // all that's left is to replace the variables in the command
-               local cmd = Cmd;
+               // local cmd = Cmd;
+               // we have to copy Cmd into cmd or both are two names for the same instance and the placeholders get overwritten
+               local cmd = wxString();
+               cmd += Cmd;
         cmd.Replace(_T("$ARCHIVE"), prj_fname.GetName());
         cmd.Replace(_T("$FILES_LIST"), file_list);

--- codeblocks-1.0svn.orig/src/scripts/Makefile.am      2007-11-15 12:49:38.000000000 +0100
+++ codeblocks-1.0svn.work/src/scripts/Makefile.am      2007-12-20 17:54:38.000000000 +0100
@@ -3,4 +3,5 @@
dist_pkgdata_DATA = startup.script \
                        gdb_types.script \
                        edit_startup_script.script \
-                       wx_help.script
+                       wx_help.script \
+                       make_dist.script