1 /******************************************************************************
3 * Copyright (C) 1997-2014 by Dimitri van Heesch.
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
11 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
23 //static const int maxCmdLine = 40960;
25 QCString writePlantUMLSource(const QCString &outDir,const QCString &fileName,const QCString &content)
27 QCString baseName(4096);
28 static int umlindex=1;
30 if (fileName.isEmpty()) // generate name
32 baseName = outDir+"/inline_umlgraph_"+QCString().setNum(umlindex++);
34 else // user specified name
37 int i=baseName.findRev('.');
38 if (i!=-1) baseName = baseName.left(i);
39 baseName.prepend(outDir+"/");
41 QFile file(baseName+".pu");
42 if (!file.open(IO_WriteOnly))
44 err("Could not open file %s for writing\n",baseName.data());
46 QCString text = "@startuml\n";
49 file.writeBlock( text, text.length() );
54 void generatePlantUMLOutput(const char *baseName,const char *outDir,PlantUMLOutputFormat format)
56 static QCString plantumlJarPath = Config_getString("PLANTUML_JAR_PATH");
58 QCString pumlExe = "java";
59 QCString pumlArgs = "-Djava.awt.headless=true -jar \""+plantumlJarPath+"plantuml.jar\" ";
83 //printf("*** running: %s %s outDir:%s %s\n",pumlExe.data(),pumlArgs.data(),outDir,outFile);
84 msg("Running PlantUML on generated file %s.pu\n",baseName);
85 portable_sysTimerStart();
86 if ((exitCode=portable_system(pumlExe,pumlArgs,FALSE))!=0)
88 err("Problems running PlantUML. Verify that the command 'java -jar \"%splantuml.jar\" -h' works from the command line\n",
89 plantumlJarPath.data());
91 else if (Config_getBool("DOT_CLEANUP"))
93 QFile(QCString(baseName)+".pu").remove();
95 portable_sysTimerStop();