Creating a Handcrafted Worskpace

Find Tips and tricks on how to better use the Zeus IDE. Feel free to post your own tips but please do not post bug reports, feature requests or questions here.
Post Reply
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Creating a Handcrafted Worskpace

Post by jussij »

Zeus does offer a GUI interface for a creating project/workspace, but being a new feature, it is still missing some of the more advanced file management features.

For simple project structures it works well, but for complex projects spanning many directories and many subdirectories, it can be quite difficult to construct a workspace using this interface. Fortunately there is a another option. The following is an example showing how to manually create a project/workspace.

Step 1: Create a new workspace in the correct base directory location. The base directory is effectively the root directory for the workspace. In this example we use the Workspace New menu to create the Zeus workspace in the C:\Program Files\zfw directory. This process creates a Zeus.zwi and Zeus.zpi in the base directory specified. These files are the workspace and project files respectively.

Step 2: Create a C:\Program Files\zfw\zeus.cmd batch file. This batch file will be used to find the files to be added to the workspace. In this case the batch file will be written to finds some macros script files, some source files and some include files. The batch file to do this would look something like this:

Code: Select all

@echo off
REM Change to the workspace base directory
cd  "C:\Program Files\zfw"

REM Find all directories off the base directory
echo All Directories
dir /b /n /s /ad *.*

REM Find all files that need to be added to the workspace
echo All Lua Files
dir /b /n /s *.lua

echo All VB Script Files
dir /b /n /s *.vbs

echo All Include Files
dir /b /n /s *.hpp *.h

echo All Source Files
dir /b /n /s *.cpp *.c
Step 3: Run the zeus.cmd batch file using the Tools, DOS Command Line menu and Zeus will capture the output produced. The output will look something like this:

Code: Select all

All Directories
C:\Program Files\zfw\zBackup
.......
C:\Program Files\zfw\zOxygen\example
All Lua Files
C:\Program Files\zfw\zScript\AS_NotDoc.lua
C:\Program Files\zfw\zScript\block.lua
.......
C:\Program Files\zfw\zScript\ztag.lua
All Include Files
C:\Program Files\zfw\zExample\cmtconvr.h
.......
C:\Program Files\zfw\zOxygen\example\xoxygen.hpp
All Source Files
C:\Program Files\zfw\zExample\cinc.cpp
.......
C:\Program Files\zfw\zExample\wildcard.c
C:\Program Files\zfw\zOxygen\example\xoxygen.cpp
Step 4: Save the batch file output to a text file and remove the base directory information with a search and replace, leaving the following output:

Code: Select all

Directories
zBackup
.......
zOxygen\example
Lua Files
zScript\AS_NotDoc.lua
zScript\block.lua
.......
zScript\ztag.lua
Include Files
zExample\cmtconvr.h
.......
zOxygen\example\xoxygen.hpp
Source Files
zExample\cinc.cpp
.......
zExample\wildcard.c
zOxygen\example\xoxygen.cpp
Step 5: Use the File Open menu and open the C:\Program Files\zfw\zeus.zpi project file. This is the project component of the project/workspace files that where created in step 1. In this file you will find the folders section which looks like this:

Code: Select all

<folder name="Header Files" />
<folder name="Resource Files" />
<folder name="Source Files" />
Step 6: Use the directory section of the batch output to manually define the required folder structure. This is done be deleting the three default folders and adding the new folders entries:

Code: Select all

<folder name="zScript">
    <folder name="Lua">
    </folder>
    <folder name="VB Script">
    </folder>
</folder>

<folder name="zExample">
    <folder name="Include">
    </folder>
    <folder name="Source">
    </folder>
</folder>

<folder name="zOxygen">
    <folder name="Include">
    </folder>
    <folder name="Source">
    </folder>
</folder>
Step 7: To test the new folder structure use the Workspace Open menu to open the Zeus workspace. At this stage you can also make changes to the workspace using the GUI, but if you do be sure to use the File, File Reload menu to refresh the editors copy of the file. When the directory structure is correct, close the workspace ready for the next step.

Step 8: Record a Zeus keyboard macro that converts this line of text:

Code: Select all

zScript\AS_NotDoc.lua
into this:

Code: Select all

<file>zScript\AS_NotDoc.lua</file>
and use the Macros, Repeated Playback menu to run the macro for all the lines of the batch output.

Step 9: Add the files to their correct folder by cutting the groups of lines from the batch output and pasting them into the correct folder location. The resulting project files should now be something like this:

Code: Select all

<folder name="zExample">
    <folder name="Include">
        <file>zExample\cmtconvr.h</file>
        .......
        <file>zExample\ctype.h</file>
    </folder>
        <folder name="Source">
           <file>zExample\cinc.cpp</file>
           .......
           <file>zExample\xdump.cpp</file>
        </folder>
</folder>
<folder name="zOxygen">
    <folder name="Include">
        <file>zOxygen\example\xoxygen.hpp</file>
    </folder>
    <folder name="Source">
        <file>zOxygen\example\xoxygen.cpp</file>
    </folder>
</folder>
<folder name="zScript">
    <folder name="Lua">
        <file>zScript\AS_NotDoc.lua</file>
        .......
        <file>zScript\ztag.lua</file>
    </folder>
    <folder name="VB Script">
        <file>zScript\dirtree.vbs</file>
        .......
        <file>zScript\talk.vbs</file>
    </folder>
</folder>
Once again use the use the Workspace Open menu to open the Zeus workspace and test the newly created project/workspace.

This manual approach to creating a workspace is not as nice as a smart GUI interface with advanced file management. But the XML format of the project/workspace does mean hand crafting a new workspace is a fairly simple and straight forward task.
Post Reply