Skip to content

Commit

Permalink
remove PLANTUML_RUN_FAST because FAST is default.
Browse files Browse the repository at this point in the history
- remove PLANTUML_RUN_FAST in config.xml
- Do not make plantuml (.pu) file for each  plantuml script. (ex. inline_umlgraph_#.pu)
  But, make type plantuml files (ex. inline_umlgraph_<type>..pu)
  • Loading branch information
cheoljoo committed Jan 6, 2019
1 parent f002c2c commit 51bba9d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 128 deletions.
10 changes: 0 additions & 10 deletions src/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3533,16 +3533,6 @@ to be found in the default search path.
<![CDATA[
When using plantuml, the specified paths are searched for files specified by the \c !include
statement in a plantuml block.
]]>
</docs>
</option>
<option type='bool' id='PLANTUML_RUN_FAST' defval='0'>
<docs>
<![CDATA[
If the \c PLANTUML_RUN_FAST tag is set to \c YES, doxygen will run java once for improving the performance.
This will run once at the end of process like dot graphics processing.
It will remove duplicated runs when you edit a little and it will support multiple thread for multi processor.
Finally it will reduce the doxygen running time about plantuml.
]]>
</docs>
</option>
Expand Down
9 changes: 3 additions & 6 deletions src/doxygen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11922,12 +11922,9 @@ void generateOutput()
g_s.end();
}

if (Config_getBool(PLANTUML_RUN_FAST))
{
g_s.begin("Running plantuml with JAVA...\n");
PlantumlManager::instance()->run();
g_s.end();
}
g_s.begin("Running plantuml with JAVA...\n");
PlantumlManager::instance()->run();
g_s.end();

if (Config_getBool(HAVE_DOT))
{
Expand Down
120 changes: 8 additions & 112 deletions src/plantuml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,16 @@ QCString writePlantUMLSource(const QCString &outDir,const QCString &fileName,con
Debug::print(Debug::Plantuml,0,"*** %s puName: %s\n","writePlantUMLSource",qPrint(puName));
Debug::print(Debug::Plantuml,0,"*** %s imgName: %s\n","writePlantUMLSource",qPrint(imgName));

QFile file(baseName+".pu");
if (!file.open(IO_WriteOnly))
{
err("Could not open file %s for writing\n",baseName.data());
}
QCString text = "@startuml "+imgName+"\n";
text+=content;
text+="\n@enduml\n";
file.writeBlock( text, text.length() );
file.close();
//Debug::print(Debug::Plantuml,0,"*** %s baseFileName text: %s\n","writePlantUMLSource",qPrint(text));

if(Config_getBool(PLANTUML_RUN_FAST)){
QCString qcOutDir(outDir);
uint pos = qcOutDir.findRev("/");
QCString generateType(qcOutDir.right(qcOutDir.length() - (pos + 1)) );
Debug::print(Debug::Plantuml,0,"*** %s generateType: %s\n","writePlantUMLSource",qPrint(generateType));
PlantumlManager::instance()->insert(generateType,puName,format,text);
Debug::print(Debug::Plantuml,0,"*** %s generateType: %s\n","writePlantUMLSource",qPrint(generateType));
}
QCString qcOutDir(outDir);
uint pos = qcOutDir.findRev("/");
QCString generateType(qcOutDir.right(qcOutDir.length() - (pos + 1)) );
Debug::print(Debug::Plantuml,0,"*** %s generateType: %s\n","writePlantUMLSource",qPrint(generateType));
PlantumlManager::instance()->insert(generateType,puName,format,text);
Debug::print(Debug::Plantuml,0,"*** %s generateType: %s\n","writePlantUMLSource",qPrint(generateType));

return baseName;
}
Expand All @@ -98,43 +88,6 @@ void generatePlantUMLOutput(const char *baseName,const char *outDir,PlantUMLOutp
QCString plantumlConfigFile = Config_getString(PLANTUML_CFG_FILE);
QCString dotPath = Config_getString(DOT_PATH);

QCString pumlExe = "java";
QCString pumlArgs = "";

//printf("*** %s %s\n","generatePlantUMLOutput",baseName);
QStrList &pumlIncludePathList = Config_getList(PLANTUML_INCLUDE_PATH);
char *s=pumlIncludePathList.first();
if (s)
{
pumlArgs += "-Dplantuml.include.path=\"";
pumlArgs += s;
s = pumlIncludePathList.next();
}
while (s)
{
pumlArgs += portable_pathListSeparator();
pumlArgs += s;
s = pumlIncludePathList.next();
}
if (pumlIncludePathList.first()) pumlArgs += "\" ";
pumlArgs += "-Djava.awt.headless=true -jar \""+plantumlJarPath+"plantuml.jar\" ";
if (!plantumlConfigFile.isEmpty())
{
pumlArgs += "-config \"";
pumlArgs += plantumlConfigFile;
pumlArgs += "\" ";
}
if (Config_getBool(HAVE_DOT) && !dotPath.isEmpty())
{
pumlArgs += "-graphvizdot \"";
pumlArgs += dotPath;
pumlArgs += "dot";
pumlArgs += portable_commandExtension();
pumlArgs += "\" ";
}
pumlArgs+="-o \"";
pumlArgs+=outDir;
pumlArgs+="\" ";
QCString imgName = baseName;
// The basename contains path, we need to strip the path from the filename in order
// to create the image file name which should be included in the index.qhp (Qt help index file).
Expand All @@ -146,50 +99,15 @@ void generatePlantUMLOutput(const char *baseName,const char *outDir,PlantUMLOutp
switch (format)
{
case PUML_BITMAP:
pumlArgs+="-tpng";
imgName+=".png";
break;
case PUML_EPS:
pumlArgs+="-teps";
imgName+=".eps";
break;
case PUML_SVG:
pumlArgs+="-tsvg";
imgName+=".svg";
break;
}
pumlArgs+=" \"";
pumlArgs+=baseName;
pumlArgs+=".pu\" ";
pumlArgs+="-charset UTF-8 ";
int exitCode;
msg("Running PlantUML on generated file %s.pu\n",baseName);
if(!Config_getBool(PLANTUML_RUN_FAST)){ // ! Config_getBool(PLANTUML_RUN_FAST)
portable_sysTimerStart();
Debug::print(Debug::Plantuml,0,"*** running: %s %s outDir:%s %s\n",qPrint(pumlExe),qPrint(pumlArgs),outDir,baseName);
if ((exitCode=portable_system(pumlExe,pumlArgs,TRUE))!=0)
{
err("Problems running PlantUML. Verify that the command 'java -jar \"%splantuml.jar\" -h' works from the command line. Exit code: %d\n",
plantumlJarPath.data(),exitCode);
}
else if (Config_getBool(DOT_CLEANUP))
{
QFile(QCString(baseName)+".pu").remove();
}
portable_sysTimerStop();

if ( (format==PUML_EPS) && (Config_getBool(USE_PDFLATEX)) )
{
QCString epstopdfArgs(maxCmdLine);
epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"",baseName,baseName);
portable_sysTimerStart();
if ((exitCode=portable_system("epstopdf",epstopdfArgs))!=0)
{
err("Problems running epstopdf. Check your TeX installation! Exit code: %d\n",exitCode);
}
portable_sysTimerStop();
}
}

Doxygen::indexList->addImageFile(imgName);
}
Expand Down Expand Up @@ -319,7 +237,7 @@ void PlantumlManager::runPlantumlContent(QDict< QList <QCString> > &PlantumlFile
for (it.toFirst();(nb=it.current());++it)
{
QCString pumlArguments(pumlArgs);
msg("Running PlantUML on %s PlantumlFiles in %s\n",qPrint(pumlType),qPrint(it.currentKey()));
msg("Generating PlantUML %s Files in %s\n",qPrint(pumlType),qPrint(it.currentKey()));
QList<QCString> *list = PlantumlFiles[it.currentKey()];
Debug::print(Debug::Plantuml,0,"*** %s PlantumlFiles key:%s size:%d\n","PlantumlManager::print Files",qPrint(it.currentKey()),(*list).count());
QListIterator<QCString> li(*list);
Expand Down Expand Up @@ -364,6 +282,7 @@ void PlantumlManager::runPlantumlContent(QDict< QList <QCString> > &PlantumlFile
}
else if (Config_getBool(DOT_CLEANUP))
{
Debug::print(Debug::Plantuml,0,"*** %s Remove %s file\n","PlantumlManager::runPlantumlContent",qPrint(puFileName));
file.remove();
}
portable_sysTimerStop();
Expand All @@ -389,29 +308,6 @@ void PlantumlManager::runPlantumlContent(QDict< QList <QCString> > &PlantumlFile
}
}

if (Config_getBool(DOT_CLEANUP))
{
Debug::print(Debug::Plantuml,0,"*** %s Remove pu files\n","PlantumlManager::runPlantumlContent");
QDictIterator< QList<QCString> > it( PlantumlFiles); // See QDictIterator
QList<QCString> *list;
for (it.toFirst();(list=it.current());++it)
{
QListIterator<QCString> li(*list);
QCString *nb;
for (li.toFirst();(nb=li.current());++li)
{
QCString pumlName = "";
pumlName+=Config_getString(OUTPUT_DIRECTORY);
pumlName+="/";
pumlName+=it.currentKey();
pumlName+="/";
pumlName+=*nb;
pumlName+=".pu";
QFile(pumlName).remove();
}
}
}

}

void PlantumlManager::run()
Expand Down

0 comments on commit 51bba9d

Please sign in to comment.