P Project File
The current project file interface is a simple mechanism to provide all the required inputs to the compiler in XML format.
The P project file below is taken from the TwoPhaseCommit example in Tutorials.
<!-- P project file for the Two Phase Commit example --> <Project> <ProjectName>TwoPhaseCommit</ProjectName> <InputFiles> <PFile>./PSrc/</PFile> <PFile>./PSpec/</PFile> <PFile>./PTst/</PFile> </InputFiles> <OutputDir>./PGenerated/</OutputDir> <!-- Add the dependencies for the Timer machine --> <IncludeProject>../Common/Timer/Timer.pproj</IncludeProject> <!-- Add the dependencies for the FailureInjector machine --> <IncludeProject>../Common/FailureInjector/FailureInjector.pproj</IncludeProject> </Project>
<InputFiles> block provides all the P files that must be compiled together for this project.
<PFile>, you can either specify the path to the P file or to a folder and the P compiler includes all the files in the folder during compilation.
<ProjectName> block provides the name for the project which is used as the output file name.
<OutputDir> block provides the output directory for the generated code.
<IncludeProject> block provides path to other P projects that must be included as dependencies during compilation.
The P compiler simply recursively copies all the P files in the dependency projects and compiles them together.
This feature provides a way to split the P models for a large system into subprojects that can share models.