Buildtools BuildTranslateInputFile.php updated for git
[spidio.git] / _devtools_cli / codegen.inc.php
blob9dcc165fc142320e8465030ad02d81db3089c679
1 <?php
2 /* This includes library file is used by the codegen.cli and codegen.phpexe scripts
3 * to simply fire up and run the QCodeGen object, itself.
4 */
6 // Call the CLI prepend.inc.php
7 require('cli_prepend.inc.php');
9 // Include the QCodeGen class library
10 require(__QCODO__. '/codegen/QCodeGen.class.php');
12 function PrintInstructions() {
13 global $strCommandName;
14 print('Qcodo Code Generator (Command Line Interface) - ' . QCODO_VERSION . '
15 Copyright (c) 2001 - 2007, QuasIdea Development, LLC
16 This program is free software with ABSOLUTELY NO WARRANTY; you may
17 redistribute it under the terms of The MIT License.
19 Usage: ' . $strCommandName . ' CODEGEN_SETTINGS
21 Where CODEGEN_SETTINGS is the absolute filepath of the codegen_settings.xml
22 file, containing the code generator settings.
24 For more information, please go to www.qcodo.com
25 ');
26 exit();
29 if ($_SERVER['argc'] != 2)
30 PrintInstructions();
32 /////////////////////
33 // Run Code Gen
34 QCodeGen::Run($_SERVER['argv'][1]);
35 /////////////////////
38 if ($strErrors = QCodeGen::$RootErrors) {
39 printf("The following ROOT ERRORS were reported:\r\n%s\r\n\r\n", $strErrors);
40 } else {
41 printf("CodeGen settings (as evaluted from %s):\r\n%s\r\n\r\n", $_SERVER['argv'][1], QCodeGen::GetSettingsXml());
44 foreach (QCodeGen::$CodeGenArray as $objCodeGen) {
45 printf("%s\r\n---------------------------------------------------------------------\r\n", $objCodeGen->GetTitle());
46 printf("%s\r\n", $objCodeGen->GetReportLabel());
47 printf("%s\r\n", $objCodeGen->GenerateAll());
48 if ($strErrors = $objCodeGen->Errors)
49 printf("The following errors were reported:\r\n%s\r\n", $strErrors);
50 print("\r\n");
53 foreach (QCodeGen::GenerateAggregate() as $strMessage) {
54 printf("%s\r\n\r\n", $strMessage);