This page presents some typical usage of SynProject.
We'll create a source code repository and associated documentation for the mORMot framework itself.
You asked for documentation, we'll generate it automatically, thanks to SynProject!
So we have all mORMot framework source code files available on our hard drive, in the D:\Dev\Lib folder (main units are in D:\Dev\Lib\SQlite3, Synopse common units are in D:\Dev\Lib).
You can download a binary executable directly from SynProject.zip.
Extract the SynProject.exe file in a directory on your hard drive. Installation is finished. ;)
Launch SynProject. It will show you a warning message this time:
You never used SynProject, so you don't have any current projects to work with. SynProject detected this, and ask for creating a new project.
Note about what is called "Project":Note that with SynProject, you can work on several projects at once. A "project" is a software entity, mainly following a marketing and budgeting approach. Your company have such "projects". Ask your project manager if you don't know ;)
A "project" is stored in a .dvs file. In fact, this file is a valid .zip archive file, containing at its root a "commit" text file with all project-related parameters (project description and directories, and all commit list), then all source files of the project, in sub-folders corresponding to the real layout of the source code tree (in fact, SynProject stores "deltas" aka "diffs" of the source code file, in a proprietary but very efficient binary format, with the source code file name with the commit number appended as file extension - hexadecimal encoded).
Inside a project, you may have the documentation itself. As was said in SynProject ScreenShots, the documentation is a single text file, with an extension .pro.
Click Yes, and a wizard screen is displayed.
Fill in the fields according to the next screen shots - these fields are the main parameters of the project (the one which will be saved in the "commit" file inside the .dvs project file):
Note that these parameters can be changed from the main SynProject user interface.
Here are some explanations about these parameters / fields:
- the "Root directory" is a main parameter. All files should be able to be retrieved from this location, in sub directories.
- since "Documents" was entered in the documentation related files field, the documentation files (e.g. the plain file .pro) will be found inside this directory.
- you may have diverse releases for the same product: one project is voted, developed and launch, then another project will make an update to the initial project. Product is the same, but projects evolve just with each release. In your hard drive, each release or project will be included in a sub directory, like ProductName\Release Name.
- the directory layout is created from the specified parameters (see step 2 below): for example, the SQLite3.pro file will be created in D:\Dev\Documents\SQLite3\Synopse SQLite3 Framework\Synopse SQLite3 Framework.pro.
- we entered a first list of Design Inputs, which will evolve during the lifetime of the project. We just put two titles of the Design Input (DI) outline, and some numerical values for referencing them. Your project manager or your marketing people may have written such a high-level description of the project, and made it approved by your CEO: use the numbering used in the official document here.
- since we've checked the "SWRS has its own sub items" checkbox, we'll be able to divide the initial DI into more detailed Software Specifications. It happens (sometimes ;) that the marketing people don't know much about software programing... so here you'll be able to fill the gap between marketing dreams and reality...
- all Design Inputs can evolved during the project life time: SynProject will able you to track these changes, and the whole documentation of the project will always be synchronized and up-to-date, even if marketing decisions evolve...
Then click "Next" and confirm if necessary (click "Yes").
Now the detailed layout parameters of your project are displayed in the second Wizard page:
By default, the parameters (especially folder names) are filled with the previous page fields. You can now customize the content of these fields.
When you click on the "Save changes" buttons, and after confirmation with the "Yes" button, all necessary folders and files are created.
Answer "Yes" to the following notification window:
Answer "Yes" to confirm the directory creations asked by the following notification window:
And "Yes" to this one:
Then you will be asked to connect to the PVCS tracker. Since we don't use it now, please click on "Cancel":
Confirm by "Yes" the release-related directory creation:
Now all necessary files and directories have been created by SynProject.
The main SynProject Screen will appear, with the just created "Synopse SQLite3 framework" project opened, as stated by the main caption bar of the window:
It's void up to now.
We'll make a first commit by pressing the "Commit" button. It displays the following window:
When the "Commit selected" button is pressed ("Commit all" should have produced the same result), all corresponding source code files are added to the repository. A log screen appears, which details all modifications. It will look like this:
First commit ------------ 0 file(s) deleted61 file(s) modified/added Lib\SQLite3\c.bat added, on 6/27/2010 5:24:14 PM Lib\SQLite3\Samples\01 - In Memory ORM\Project01.dof added, on 6/29/2010 6:51:22 PM Lib\SQLite3\Samples\01 - In Memory ORM\Project01.dpr added, on 6/27/2010 5:24:14 PM Lib\SQLite3\Samples\01 - In Memory ORM\Project01.res added, on 6/29/2010 6:51:06 PM Lib\SQLite3\Samples\01 - In Memory ORM\SampleData.pas added, on 6/29/2010 6:51:20 PM Lib\SQLite3\Samples\01 - In Memory ORM\Unit1.dfm added, on 6/27/2010 5:24:14 PM Lib\SQLite3\Samples\01 - In Memory ORM\Unit1.pas added, on 6/29/2010 6:51:30 PM Lib\SQLite3\Samples\02 - Embedded SQLite3 ORM\Project02.dof added, on 6/29/2010 6:53:52 PM Lib\SQLite3\Samples\02 - Embedded SQLite3 ORM\Project02.dpr added, on 6/29/2010 6:53:52 PM Lib\SQLite3\Samples\02 - Embedded SQLite3 ORM\Project02.res added, on 6/29/2010 6:52:44 PM Lib\SQLite3\Samples\03 - NamedPipe Client-Server\Project03Client.dof added, on 6/29/2010 6:54:32 PM Lib\SQLite3\Samples\03 - NamedPipe Client-Server\Project03Client.dpr added, on 6/29/2010 6:54:22 PM Lib\SQLite3\Samples\03 - NamedPipe Client-Server\Project03Client.res added, on 6/29/2010 6:54:02 PM Lib\SQLite3\Samples\03 - NamedPipe Client-Server\Project03Server.dof added, on 6/29/2010 6:56:08 PM Lib\SQLite3\Samples\03 - NamedPipe Client-Server\Project03Server.dpr added, on 6/29/2010 6:56:00 PM Lib\SQLite3\Samples\03 - NamedPipe Client-Server\Project03Server.res added, on 6/29/2010 6:55:58 PM Lib\SQLite3\Samples\03 - NamedPipe Client-Server\Unit2.dfm added, on 1/24/2010 5:33:26 PM Lib\SQLite3\Samples\03 - NamedPipe Client-Server\Unit2.pas added, on 6/29/2010 6:56:06 PM Lib\SQLite3\Samples\04 - HTTP Client-Server\Project04Client.dof added, on 6/29/2010 6:56:28 PM Lib\SQLite3\Samples\04 - HTTP Client-Server\Project04Client.dpr added, on 6/29/2010 6:56:24 PM Lib\SQLite3\Samples\04 - HTTP Client-Server\Project04Client.res added, on 6/29/2010 6:56:22 PM Lib\SQLite3\Samples\04 - HTTP Client-Server\Project04Server.dof added, on 6/29/2010 6:57:12 PM Lib\SQLite3\Samples\04 - HTTP Client-Server\Project04Server.dpr added, on 6/29/2010 6:56:52 PM Lib\SQLite3\Samples\04 - HTTP Client-Server\Project04Server.res added, on 6/29/2010 6:56:50 PM Lib\SQLite3\Samples\04 - HTTP Client-Server\Unit2.dfm added, on 6/27/2010 5:24:14 PM Lib\SQLite3\Samples\04 - HTTP Client-Server\Unit2.pas added, on 6/29/2010 6:58:32 PM Lib\SQLite3\Samples\05 - Report created from code\TestSQLite3Pages.dpr added, on 6/30/2010 6:16:24 PM Lib\SQLite3\Samples\05 - Report created from code\Unit1.dfm added, on 6/30/2010 7:07:06 PM Lib\SQLite3\Samples\05 - Report created from code\Unit1.pas added, on 6/30/2010 7:04:40 PM Lib\SQLite3\ServiceTestForm.dfm added, on 6/27/2010 5:24:14 PM Lib\SQLite3\ServiceTestForm.pas added, on 6/27/2010 5:24:14 PM Lib\SQLite3\ServiceTestSQL3.dof added, on 7/10/2010 6:48:08 PM Lib\SQLite3\ServiceTestSQL3.dpr added, on 6/27/2010 5:24:14 PM Lib\SQLite3\ServiceTestSQL3.res added, on 6/27/2010 5:24:14 PM Lib\SQLite3\sqlite3.c added, on 6/27/2010 5:24:14 PM Lib\SQLite3\SQLite3.pas added, on 7/5/2010 6:53:14 PM Lib\SQLite3\SQLite3BtnOk.bmp added, on 6/27/2010 5:24:14 PM Lib\SQLite3\SQLite3Commons.pas added, on 7/12/2010 10:54:16 AM Lib\SQLite3\SQLite3FastCgiServer.pas added, on 6/27/2010 5:24:14 PM Lib\SQLite3\SQLite3HttpClient.pas added, on 6/27/2010 5:24:14 PM Lib\SQLite3\SQLite3HttpServer.pas added, on 7/5/2010 5:43:20 PM Lib\SQLite3\SQLite3i18n.pas added, on 6/27/2010 5:24:14 PM Lib\SQLite3\SQLite3Pages.pas added, on 7/10/2010 6:51:22 PM Lib\SQLite3\SQLite3Service.pas added, on 6/27/2010 5:24:14 PM Lib\SQLite3\SQLite3ToolBar.pas added, on 7/6/2010 9:00:06 PM Lib\SQLite3\SQLite3UI.pas added, on 7/6/2010 9:00:06 PM Lib\SQLite3\SQLite3UILogin.dfm added, on 6/27/2010 5:24:14 PM Lib\SQLite3\SQLite3UILogin.pas added, on 6/27/2010 5:24:14 PM Lib\SQLite3\SQLite3UILogin.png added, on 6/27/2010 5:24:14 PM Lib\SQLite3\SQLite3UILogin.rc added, on 6/27/2010 5:24:14 PM Lib\SQLite3\SQLite3UILogin.RES added, on 6/27/2010 5:24:14 PM Lib\SQLite3\SQLite3UIOptions.dfm added, on 6/27/2010 5:24:14 PM Lib\SQLite3\SQLite3UIOptions.pas added, on 7/6/2010 9:00:06 PM Lib\SQLite3\SQLite3UIQuery.dfm added, on 6/27/2010 5:24:14 PM Lib\SQLite3\SQLite3UIQuery.pas added, on 6/27/2010 5:24:14 PM Lib\SQLite3\TestSQL3.cfg added, on 7/4/2010 3:30:32 PM Lib\SQLite3\TestSQL3.dof added, on 7/5/2010 5:56:00 PM Lib\SQLite3\TestSQL3.dpr added, on 7/5/2010 5:56:00 PM Lib\SQLite3\TestSQL3.dproj added, on 7/5/2010 4:54:26 PM Documents\SQLite3\Common\SQLite3 Framework.scr added, on 7/12/2010 1:18:14 PM Documents\SQLite3\Synopse SQLite3 Framework\Synopse SQLite3 Framework.pro added, on 7/12/2010 1:19:46 PM
"First commit" Commit performed in 0.4 s.
-=- Process complete: press Escape or Enter to close the form -=-
Note that all delphi source code files were added, together with the .scr and .pro files from the documentation related folders.
Close the log screen with the Escape key.
Now the main screen contains the commit. Just click on the commit line, and all corresponding files will appear in the next column. Double click on any file to view its content directly from SynProject.
By default, the Synopse SQLite3 Framework.pro file has been created, and filled from a basic template.
The whole documentation process follows a complete coverage, matching ISO / IEC best practices:
You can add your own documents or requirements to the steps above, if this layout is not enough for your needs. Or you can just use one part of it, e.g. SAD or Tests. But the main benefit of SynProject will become obvious as soon as your whole documentation set will be maintained within the tool.
From the main screen of SynProject, click on the "Docs" button (with the Word icon), or press the F2 key to display the main Release Documentation Editor:
Tip: you can also launch the tool and specify the .pro file name as command-line parameter, to bypass the whole .dvs / versioning features. That is, if you associate the .pro file extension with SynProject.exe, you can open any documentation by a double-click on the .pro file.
We now will make some changes to the file content. The Template is pretty basic up to now... but it's easy updating the documentation.
The documentation file is architectures as a standard .ini file, i.e. with some [Sections]:
In order to browse the documentation content and all these sections, you can:
Now we will click on the Wizard button (located between the "floppy/save" button and the "Word" button) to create the necessary Design Input content.
Note that the Wizard is able to modify most of the document content. In particular, the headers of most sections can be edited easily from fields on the User Interface, which can be handy for you.
Here is the main screen of the Documentation Wizard:
Just click on the page you want to access. We'll click on "3 - Design Input details", then update the Design input values. We click on a DI item on the left list, then we change the fields content on the right, and click on another DI item, and confirm to save changes.
The "Risk Assesment" is to be filled with some values. Note we'll put "Initial release" in associated Request and Risk justification, because it's a first release of the project.
The following screen content:
will be converted by the Wizard to the following documentation values:
[DI-1.1] Risk=1,1,3,Arnaud Bouchez,Initial release Request=Initial release Ident=The framework must be Client/Server oriented
Now we will setup the SAD (Software Architecture Document) parameters, which will allow to parse the source code and retrieve useful information from it.
From the Wizard, we'll click on the "13 - Software Architecture modules" page. Then click on the first module item (i.e. "SAD-Main"), confirm its creation by "Yes". Then we enter a name for displaying this module, and a version number. We entered "DefaultPath=D:\Dev" as parameter in the [SAD] section. So we just need to enter "Lib\SQLite3" in the "Source path" field. We'll enter "TestSQL3.dpr" as main source code file: this file name will be parsed, and all used units will be added to the main repository.
We have to save changes for this item by clicking on the "SAD-Main" item, in order to let the "Include path" and other fields to be enabled. We just put "Lib;Lib\SQLite3" in the include path, in order that all common Synopse library units (like SynCommons or SynPDF) will be parsed with the library.
The page of this module will look like this:
Then we force SynProject to parse all source code. From the editor main toolbar, we click on the "Word" button, then select the "SAD" document, then click on the special command named "Parse all source code again":
Note that the source code will be parsed (it's very fast), and SynProject will create two files:
7/12/2010 2:27:44 PM Info[0]: Cache file = D:\Dev\Documents\SQLite3\Synopse SQLite3 Framework\Synopse SQLite3 Framework.sad Info[0]: #&91;SAD].Source = Main
FillUnits(SAD-Main) -> TestSQL3.dpr Info[0]: DefaultPath = D:\DEV\ Info[0]: IncludePath = Lib;Lib\SQLite3 Info[0]: OutdatedCacheAutoRecreate is ON Info[2]: Now parsing file Lib\SQLite3\TestSQL3.dpr... Info[2]: Now parsing file Lib\SynCrtSock.pas... Info[2]: Now parsing file Lib\SynCommons.pas... Info[2]: Now parsing file Lib\SQLite3\SQLite3.pas... Info[2]: Now parsing file Lib\SQLite3\SQLite3Commons.pas... Info[2]: Now parsing file Lib\SQLite3\SQLite3FastCgiServer.pas... Info[2]: Now parsing file Lib\SQLite3\SQLite3HttpClient.pas... Info[2]: Now parsing file Lib\SQLite3\SQLite3HttpServer.pas... Info[2]: Now parsing file Lib\SynZip.pas... Info[2]: Now parsing file Lib\SQLite3\SQLite3i18n.pas... Info[2]: Now parsing file Lib\SQLite3\SQLite3Service.pas... Info[2]: Now parsing file Lib\SynSelfTests.pas... Info[2]: Now parsing file Lib\SynCrypto.pas... Info[2]: Now parsing file Lib\SynWinSock.pas... Info[2]: Now parsing file Lib\SynPdf.pas... Info[2]: Write new data to cache
Info[2]: Files not found during process: Classes.pas,ComCtrls.pas,Contnrs.pas,Controls.pas,ExtCtrls.pas,FastMM4.pas,Forms.pas,Graphics.pas,LibC.pas,Menus.pas,Messages.pas,StdCtrls.pas,SysUtils.pas,Types.pas,UxTheme.pas,Windows.pas,WinSVC.pas
Then we'll create all diagrams from the source code, by selecting the following private menu from the SAD document:
Under Vista or Seven, or if you are not logged as administrator on your Computer under XP, you'll have an error message the first time you launch any GraphViz generation. The internal GraphViz engine need to be registered to the system once. You can either launch the command line specified on screen, or run SynProject.exe one time with administrator rights (right click then "Run as Administrator"), then create some diagrams as administrator. Then exit SynProject, and it will then be sufficient to run SynProject with current user rights, without any problem about generating diagrams.
Then we click directly on the SAD/SAD menu item, and the Software Architecture Document is created (as a .rtf file) then converted to a native Word document using Word itself, then the resulting Word document is opened. You can also select "SAD pdf" to directly render a .pdf file (requires Office 2007 or later), without opening the original Word document - which can be slow if it contains a lot of data. You can note that the .rtf creation by SynProject is quite immediate: most time is spend within Word, for conversion from .rtf to native .doc format, especially if there are a lot of diagrams and hyperlinks inside the documentation. But you can create Word documents of more than 1000 pages with SynProject, without any problem. Word will be slow, but SynProject itself won't complain about this data amount. ;)
You can download a sample word document directly generated by SynProject from sampledoc.zip.
As you may have observed, the format used in the .pro file content is quite easy to follow.
List of all special lines commands which can be entered:
You can use our forum, and the SynProject dedicated section, to post your comments or reactions.
I hope I've raised some interest about SynProject.
And don't forget it is published as Open Source: you are welcome to contribute, and adapt it to your needs - as soon as you follow the GPL license terms, of course!