pnotepad.org articles

Projects in PN 2

By Simon Steele
Wednesday, March 26, 2003

There are many things that one might want to do with a set of files. Quite often a group of files can be said to represent a "project". Programmers Notepad 1 had very basic project support - essentially the ability to group files in a tree allowing for quick navigation around a project. In version 2, the project suport will be much improved.

This document is the start of an effort to design the project support for version 2 - a sort of request for comments. At the moment it very much represents a list of wild ideas that hopefully can be refined into an effective project management system.

Build Configuration

One of the biggest differences between an IDE and a simple text editor is the lack of ability to create projects that can be easily built using standard compilers, linkers etc. Because PN supports so many different programming languages, it would be crazy to build in support for a single toolset. Instead (and thanks to some inspiration from Eric Weddington) I have this current wild idea:

First of all, an XML file defines all available config options. These options are sectioned, and each defines whether it is project-wide, available for every file, overridable etc. A simple dialog can then be built in PN2 which can parse this file and build a configuration dialog from it. Each item in the file would include a unique name identifying it:

<optionpage name="General">
    <optionset name="general" title="General Options">
        <folderpath name="outputdir" title="Output Directory" helpid="1023" />
        <folderpath name="intermediate" title="Intermediate Directory" helpid="1024" />
    </optionset>
    <optionset name="defaults" title="Project Defaults">
        <optionlist name="configtype" title="Configuration Type" helpid="1025">
            <value title="Makefile" value="1" />
            <value title="Application (.exe)" value="2" />
            <value title="Dynamic Library (.dll)" value="3" />
            <value title="Static Library (.lib)" value="4" />
        </optionlist>
        <option name="browseinfo" title="Build Browser Information" helpid="1026"/>
        ...
    </optionset>
</optionpage>

The items above are a brief brainstorm of a format looking at the VC7 project property pages. Once the user had customised their settings, they would be stored using the identifiers given in the option definition file. So, the above property pages might lead to a build configuration like this:

<page name="General">
    <general>
        <outputdir value="../bin" />
        <intermediate value="../junk" />
        <configtype value="2" />
        <browseinfo value="1" />
    </general>
    <defaults>
        ...
    </defaults>
</page>
<files>
    <folder name="source" basedir="c:\projects\test">
        <file name="main.cpp" />
        <file name="test.cpp" />
    </folder>
    <folder name="headers" basedir="c:\projects\test">
        <file name="main.h" />
        <file name="test.h" />
    </folder>
</files>

For each given toolset, a simple tool would then transform from this intermediate project settings format into whatever build commands were necessary. For example, with the GNU toolset, a tool such as gccpm might be created to transform from this project format into a makefile for the project. This makefile would then be run, and the output piped to the PN2 output window. An XSLT could transform from this format into a simple NAnt build file. The projects system could easily streamline this by only re-building the options set when the project actually changes - allowing the external toolset to not have to modify any local build files/scripts for each build. External tools should have to do little in the way of project management - the project and (dare I say it) solution/workspace management should all be built in to PN remembering the old adage that less is more.

UI Things to look at

Bjarke Viksoe's PropertyList control - this would nicely provide the option set functionality for the build configuration dialog.

Credits

Credit for some of the ideas presented in this document (either the ideas themselves or the triggering of them) must go to Eric Weddington. Thanks.

Summary

Please note that this article is very much a work in progress and doesn't cover nearly a quarter of the project management functionality yet. This will grow before I begin work on that part of PN2.

Back to top...
 
Made with CityDesk