Author Topic: Sync_project_with_scm - update file list in projects via macro  (Read 7089 times)

chrisant

  • Senior Community Member
  • Posts: 1413
  • Hero Points: 131
Adds new commands:
ssync
ssync -a

Written for:
SlickEdit 12, 13, 14, 15, 16.
Revision 10 of the macro was posted in April 2009.
Revision 11 of the macro was posted in December 2011.

Description:
The "ssync" command updates the file list for the current project based on directories, wildcards, and exclusions specified in a separate ssync.ini file.  The "ssync -a" command updates all projects in the current workspace.
This is probably most useful for folks who would like to use wildcard entries in the SE project definition, but can't because of performance problems (taking too long to scan the file system every time SE starts, etc).  You can use the "ssync" command whenever you feel is a good time to update the project -- the macro doesn't make the sync faster, it just puts you in control of when the sync happens.

Installation:
1.  Extract the files from the .zip to your macros folder.
2.  Look at the ssync.sample*.ini files to see how to set up your ssync.ini file.
3.  Make sure the ssync.ini file you create is in a folder that's along your SlickEdit path variable, so it can be found.
4.  Load the sync_project_with_scm.e file.
5.  Use the Macros|Load Macro... command to load the macro module.
Now you can use the "ssync" command per above.

Original Post Location:
Here.

This header post will be updated as new versions are posted.  Descriptions of the updates will be in subsequent topics.
« Last Edit: December 22, 2011, 07:32:16 am by chrisant »

chrisant

  • Senior Community Member
  • Posts: 1413
  • Hero Points: 131
Re: Sync_project_with_scm - update file list in projects via macro
« Reply #1 on: April 07, 2009, 05:11:01 pm »
New:
A friend at work contributed a feature to move the wildcard aliases out of the macro file and into the ssync.ini file.  The <sources> and <headers> and <slick> aliases are still predefined, but using the alias definition syntax in the ssync.ini file you can create new aliases, add to existing aliases, clear existing aliases, etc.

For example, the <sources> alias is predefined, but you can add to it or redefine it:
Adding *.qux and *.foo and *.bar to the predefined <sources> alias:
  <sources>=*.qux
  <sources>=*.foo;*.bar

Clearing the predefined <sources> and replacing it with your own definition:
  <sources>=
  <sources>=*.c;*.cc;*.cpp
  <sources>=*.h;*.hpp;*.rc;*.xml;*.htm

Creating new custom aliases:
  <palmos>=*.c;*.h;*.rcp
  <lua>=*.lua;*.xml;*.txt


The enclosed ssync.sample.ini file has more information about setting up your ssync.ini file.

See the first post for the latest version of the macro.

mklein

  • Community Member
  • Posts: 84
  • Hero Points: 2
Re: Sync_project_with_scm - update file list in projects via macro
« Reply #2 on: December 21, 2011, 09:10:04 pm »
Hi,

I love this macro and use it a bunch in SE14. It doesn't seem to work quite right in SE16 (some directories don't iterate).

Does anyone know of any comparable functionality in SE16?

Thanks,
Matt

chrisant

  • Senior Community Member
  • Posts: 1413
  • Hero Points: 131
Re: Sync_project_with_scm - update file list in projects via macro
« Reply #3 on: December 22, 2011, 07:06:13 am »
I use it myself in SE16, and haven't observed any problems.

If you can share details about the problem and how to reproduce it, I'll investigate.

By the way, the way the macro iterates over directories is (1) it calls the SE internal function insert_file_list() to collect all files recursively under the specified directory, and then (2) it removes any lines that match the directory exclusions specified in the ssync.ini file.

So the easiest way to get to the bottom of the trouble would be to post your ssync.ini file (to show what's desired) + the output from "dir /s /b ProjectDirectory" (to show what exists) + the .vpj file after having run "ssync" (to show the result from the macro).
« Last Edit: December 22, 2011, 07:33:33 am by chrisant »

chrisant

  • Senior Community Member
  • Posts: 1413
  • Hero Points: 131
Re: Sync_project_with_scm - update file list in projects via macro
« Reply #4 on: December 22, 2011, 07:30:03 am »
I made one change that I hadn't posted yet, so I've just now updated the macro at the top of this thread in case it somehow fixed something else.  The change was to add a way to use a regex to exclude dirs/files from a project, and to add a -v# flag to select the level of debug output (see comments in macro for more info).
« Last Edit: December 22, 2011, 07:35:12 am by chrisant »

mklein

  • Community Member
  • Posts: 84
  • Hero Points: 2
Re: Sync_project_with_scm - update file list in projects via macro
« Reply #5 on: December 22, 2011, 06:00:22 pm »
The regex feature will be awesome, but my problem is stupidity, not a bug... I just debugged, and had forgotten a long time ago that I had used a symlink for ssync.ini to point to a place where I keep most of my configuration files. When SE upgraded from 14->16, it copied the file, not the symlink. So I was updating an ssync.ini that was not being read by SE16!