Skip to content

VBAToolKit feature : XML Project Description

lucas-v edited this page Nov 19, 2013 · 4 revisions

A VBAToolKit project is exhaustively described by an XML file. This feature, combined with the automatic export of modules and the recreation of configurations, allows to completely free the versioning repository from the Excel files. The only files that matter are text files !

The XML file that describes a project lists :

  • the name of the project
  • the different configurations
    • their name
    • the path in which they should be recreated
    • the path of their template
    • the title of the recreated workbook
    • the comment of the recreated workbook
  • the different modules
    • their name
    • their path for each of the configurations they belong to
  • the references
    • their name
    • their GUID or their path

The DTD corresponding to this format is visible below.

When a user wants VBAToolKit to recreate a particular configuration in a particular project, VBAToolKit will fetch information in this file.


Managing project information

For now, the XML file has to edited by hand. It embeds a DTD that allows to check its format before loading it. The main thing to be careful about is the ID attributes of the different objects : each object must have a unique ID. The convention so far is to call a module mXX and a configuration cXX, where XX is the next index available in the category.


Example file

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<!DOCTYPE vtkConf [
<!ELEMENT vtkConf (info,configuration*, module*, reference*)>
        <!ELEMENT info (vtkConfigurationsVersion,projectName)>
                <!ELEMENT vtkConfigurationsVersion (#PCDATA)>
                <!ELEMENT projectName (#PCDATA)>
        <!ELEMENT configuration (name,path,templatePath?,title?,comment?)>
         <!ATTLIST configuration cID ID #REQUIRED>
                <!ELEMENT name (#PCDATA)>
                <!ELEMENT path (#PCDATA)>
                <!ELEMENT templatePath (#PCDATA)>
                <!ELEMENT title        (#PCDATA)>
                <!ELEMENT comment (#PCDATA)>
        <!ELEMENT module (name, modulePath*)>
         <!ATTLIST module mID ID #REQUIRED>
                <!ELEMENT modulePath (#PCDATA)>
                <!ATTLIST modulePath confId IDREF #REQUIRED>
        <!ELEMENT reference (name, (guid|path))>
         <!ATTLIST reference confIDs IDREFS #REQUIRED>
                <!ELEMENT guid (#PCDATA)>
]>
<vtkConf>

    <!-- INFO OBJECT -->

    <info>
        <vtkConfigurationsVersion>1.0</vtkConfigurationsVersion>
        <projectName>TestProject1</projectName>
    </info>


    <!-- CONFIGURATION OBJECTS -->

    <configuration cID="c01">
        <name>TestProject1</name>
        <path>Delivery\TestProject1.xlam</path>
	<title>Base project add in</title>
	<comment>commnet deliv</comment>
    </configuration>

    <configuration cID="c02">
        <name>TestProject1_DEV</name>
        <path>Project\TestProject1_DEV.xlsm</path>
	<templatePath>BaseProject_DEV.xlsm</templatePath>
	<title>Base project dev conf</title>
	<comment>comment dev</comment>
    </configuration>


    <!-- MODULE OBJECTS -->

    <module mID="m1">
        <name>VbaUnitMain</name>
        <modulePath confId="c02">Source\VbaUnit\VbaUnitMain.bas</modulePath>
    </module>

    <module mID="m2">
        <name>Assert</name>
        <modulePath confId="c02">Source\VbaUnit\Assert.cls</modulePath>
    </module>

    <module mID="m3">
        <name>AutoGen</name>
        <modulePath confId="c02">Source\VbaUnit\AutoGen.cls</modulePath>
    </module>

    <module mID="m4">
        <name>IAssert</name>
        <modulePath confId="c02">Source\VbaUnit\IAssert.cls</modulePath>
    </module>

    <module mID="m5">
        <name>IResultUser</name>
        <modulePath confId="c02">Source\VbaUnit\IResultUser.cls</modulePath>
    </module>

    <module mID="m6">
        <name>IRunManager</name>
        <modulePath confId="c02">Source\VbaUnit\IRunManager.cls</modulePath>
    </module>

    <module mID="m7">
        <name>ITest</name>
        <modulePath confId="c02">Source\VbaUnit\ITest.cls</modulePath>
    </module>

    <module mID="m8">
        <name>ITestCase</name>
        <modulePath confId="c02">Source\VbaUnit\ITestCase.cls</modulePath>
    </module>

    <module mID="m9">
        <name>ITestManager</name>
        <modulePath confId="c02">Source\VbaUnit\ITestManager.cls</modulePath>
    </module>

    <module mID="m10">
        <name>RunManager</name>
        <modulePath confId="c02">Source\VbaUnit\RunManager.cls</modulePath>
    </module>

    <module mID="m11">
        <name>TestCaseManager</name>
        <modulePath confId="c02">Source\VbaUnit\TestCaseManager.cls</modulePath>
    </module>

    <module mID="m12">
        <name>TestClassLister</name>
        <modulePath confId="c02">Source\VbaUnit\TestClassLister.cls</modulePath>
    </module>

    <module mID="m13">
        <name>TesterTemplate</name>
        <modulePath confId="c02">Source\VbaUnit\TesterTemplate.cls</modulePath>
    </module>

    <module mID="m14">
        <name>TestFailure</name>
        <modulePath confId="c02">Source\VbaUnit\TestFailure.cls</modulePath>
    </module>

    <module mID="m15">
        <name>TestResult</name>
        <modulePath confId="c02">Source\VbaUnit\TestResult.cls</modulePath>
    </module>

    <module mID="m16">
        <name>TestRunner</name>
        <modulePath confId="c02">Source\VbaUnit\TestRunner.cls</modulePath>
    </module>

    <module mID="m17">
        <name>TestSuite</name>
        <modulePath confId="c02">Source\VbaUnit\TestSuite.cls</modulePath>
    </module>

    <module mID="m18">
        <name>TestSuiteManager</name>
        <modulePath confId="c02">Source\VbaUnit\TestSuiteManager.cls</modulePath>
    </module>


    <!-- REFERENCE OBJECTS -->

    <reference confIDs="c01 c02">
        <name>Scripting</name>
        <guid>{420B2830-E718-11CF-893D-00A0C9054228}</guid>
    </reference>

    <reference confIDs="c01 c02">
        <name>VBIDE</name>
        <guid>{0002E157-0000-0000-C000-000000000046}</guid>
    </reference>

    <reference confIDs="c01 c02">
        <name>Shell32</name>
        <guid>{50A7E9B0-70EF-11D1-B75A-00A0C90564FE}</guid>
    </reference>

    <reference confIDs="c01 c02">
        <name>MSXML2</name>
        <guid>{F5078F18-C551-11D3-89B9-0000F81FE221}</guid>
    </reference>

    <reference confIDs="c01 c02">
        <name>ADODB</name>
        <guid>{00000206-0000-0010-8000-00AA006D2EA4}</guid>
    </reference>

    <reference confIDs="c02">
        <name>VBAToolKit</name>
        <path>C:\Documents and Settings\Administrator\Application Data\Microsoft\AddIns\VBAToolKit.xlam</path>
    </reference>

</vtkConf>