The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

707 lines
25KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2017 - ROLI Ltd.
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. By using JUCE, you agree to the terms of both the JUCE 5 End-User License
  8. Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
  9. 27th April 2017).
  10. End User License Agreement: www.juce.com/juce-5-licence
  11. Privacy Policy: www.juce.com/juce-5-privacy-policy
  12. Or: You may also use this code under the terms of the GPL v3 (see
  13. www.gnu.org/licenses).
  14. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  15. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  16. DISCLAIMED.
  17. ==============================================================================
  18. */
  19. #pragma once
  20. #include "jucer_ResourceFile.h"
  21. #include "../Project/jucer_Module.h"
  22. #include "jucer_ProjectExporter.h"
  23. //==============================================================================
  24. class ProjectSaver
  25. {
  26. public:
  27. ProjectSaver (Project& p, const File& file)
  28. : project (p),
  29. projectFile (file),
  30. generatedCodeFolder (project.getGeneratedCodeFolder()),
  31. generatedFilesGroup (Project::Item::createGroup (project, getJuceCodeGroupName(), "__generatedcode__", true)),
  32. hasBinaryData (false)
  33. {
  34. generatedFilesGroup.setID (getGeneratedGroupID());
  35. }
  36. struct SaveThread : public ThreadWithProgressWindow
  37. {
  38. public:
  39. SaveThread (ProjectSaver& ps, bool wait, const String& exp)
  40. : ThreadWithProgressWindow ("Saving...", true, false),
  41. saver (ps), result (Result::ok()),
  42. shouldWaitAfterSaving (wait),
  43. specifiedExporterToSave (exp)
  44. {}
  45. void run() override
  46. {
  47. setProgress (-1);
  48. result = saver.save (false, shouldWaitAfterSaving, specifiedExporterToSave);
  49. }
  50. ProjectSaver& saver;
  51. Result result;
  52. bool shouldWaitAfterSaving;
  53. String specifiedExporterToSave;
  54. JUCE_DECLARE_NON_COPYABLE (SaveThread)
  55. };
  56. Result save (bool showProgressBox, bool waitAfterSaving, const String& specifiedExporterToSave)
  57. {
  58. if (showProgressBox)
  59. {
  60. SaveThread thread (*this, waitAfterSaving, specifiedExporterToSave);
  61. thread.runThread();
  62. return thread.result;
  63. }
  64. const String appConfigUserContent (loadUserContentFromAppConfig());
  65. const File oldFile (project.getFile());
  66. project.setFile (projectFile);
  67. OwnedArray<LibraryModule> modules;
  68. project.getModules().createRequiredModules (modules);
  69. checkModuleValidity (modules);
  70. if (errors.size() == 0)
  71. {
  72. writeMainProjectFile();
  73. project.updateModificationTime();
  74. writeAppConfigFile (modules, appConfigUserContent);
  75. writeBinaryDataFiles();
  76. writeAppHeader (modules);
  77. writeModuleCppWrappers (modules);
  78. writeProjects (modules, specifiedExporterToSave, ! showProgressBox);
  79. writeAppConfigFile (modules, appConfigUserContent); // (this is repeated in case the projects added anything to it)
  80. if (generatedCodeFolder.exists())
  81. writeReadmeFile();
  82. }
  83. if (generatedCodeFolder.exists())
  84. deleteUnwantedFilesIn (generatedCodeFolder);
  85. if (errors.size() > 0)
  86. {
  87. project.setFile (oldFile);
  88. return Result::fail (errors[0]);
  89. }
  90. // Workaround for a bug where Xcode thinks the project is invalid if opened immedietely
  91. // after writing
  92. if (waitAfterSaving)
  93. Thread::sleep (2000);
  94. return Result::ok();
  95. }
  96. Result saveResourcesOnly()
  97. {
  98. writeBinaryDataFiles();
  99. if (errors.size() > 0)
  100. return Result::fail (errors[0]);
  101. return Result::ok();
  102. }
  103. Project::Item saveGeneratedFile (const String& filePath, const MemoryOutputStream& newData)
  104. {
  105. if (! generatedCodeFolder.createDirectory())
  106. {
  107. addError ("Couldn't create folder: " + generatedCodeFolder.getFullPathName());
  108. return Project::Item (project, ValueTree(), false);
  109. }
  110. const File file (generatedCodeFolder.getChildFile (filePath));
  111. if (replaceFileIfDifferent (file, newData))
  112. return addFileToGeneratedGroup (file);
  113. return Project::Item (project, ValueTree(), true);
  114. }
  115. Project::Item addFileToGeneratedGroup (const File& file)
  116. {
  117. Project::Item item (generatedFilesGroup.findItemForFile (file));
  118. if (item.isValid())
  119. return item;
  120. generatedFilesGroup.addFileAtIndex (file, -1, true);
  121. return generatedFilesGroup.findItemForFile (file);
  122. }
  123. void setExtraAppConfigFileContent (const String& content)
  124. {
  125. extraAppConfigContent = content;
  126. }
  127. static void writeAutoGenWarningComment (OutputStream& out)
  128. {
  129. out << "/*" << newLine << newLine
  130. << " IMPORTANT! This file is auto-generated each time you save your" << newLine
  131. << " project - if you alter its contents, your changes may be overwritten!" << newLine
  132. << newLine;
  133. }
  134. static const char* getGeneratedGroupID() noexcept { return "__jucelibfiles"; }
  135. Project::Item& getGeneratedCodeGroup() { return generatedFilesGroup; }
  136. static String getJuceCodeGroupName() { return "Juce Library Code"; }
  137. File getGeneratedCodeFolder() const { return generatedCodeFolder; }
  138. bool replaceFileIfDifferent (const File& f, const MemoryOutputStream& newData)
  139. {
  140. filesCreated.add (f);
  141. if (! FileHelpers::overwriteFileWithNewDataIfDifferent (f, newData))
  142. {
  143. addError ("Can't write to file: " + f.getFullPathName());
  144. return false;
  145. }
  146. return true;
  147. }
  148. static bool shouldFolderBeIgnoredWhenCopying (const File& f)
  149. {
  150. return f.getFileName() == ".git" || f.getFileName() == ".svn" || f.getFileName() == ".cvs";
  151. }
  152. bool copyFolder (const File& source, const File& dest)
  153. {
  154. if (source.isDirectory() && dest.createDirectory())
  155. {
  156. Array<File> subFiles;
  157. source.findChildFiles (subFiles, File::findFiles, false);
  158. for (int i = 0; i < subFiles.size(); ++i)
  159. {
  160. const File f (subFiles.getReference(i));
  161. const File target (dest.getChildFile (f.getFileName()));
  162. filesCreated.add (target);
  163. if (! f.copyFileTo (target))
  164. return false;
  165. }
  166. Array<File> subFolders;
  167. source.findChildFiles (subFolders, File::findDirectories, false);
  168. for (int i = 0; i < subFolders.size(); ++i)
  169. {
  170. const File f (subFolders.getReference(i));
  171. if (! shouldFolderBeIgnoredWhenCopying (f))
  172. if (! copyFolder (f, dest.getChildFile (f.getFileName())))
  173. return false;
  174. }
  175. return true;
  176. }
  177. return false;
  178. }
  179. Project& project;
  180. SortedSet<File> filesCreated;
  181. private:
  182. const File projectFile, generatedCodeFolder;
  183. Project::Item generatedFilesGroup;
  184. String extraAppConfigContent;
  185. StringArray errors;
  186. CriticalSection errorLock;
  187. File appConfigFile;
  188. bool hasBinaryData;
  189. // Recursively clears out any files in a folder that we didn't create, but avoids
  190. // any folders containing hidden files that might be used by version-control systems.
  191. bool deleteUnwantedFilesIn (const File& parent)
  192. {
  193. bool folderIsNowEmpty = true;
  194. DirectoryIterator i (parent, false, "*", File::findFilesAndDirectories);
  195. Array<File> filesToDelete;
  196. bool isFolder;
  197. while (i.next (&isFolder, nullptr, nullptr, nullptr, nullptr, nullptr))
  198. {
  199. const File f (i.getFile());
  200. if (filesCreated.contains (f) || shouldFileBeKept (f.getFileName()))
  201. {
  202. folderIsNowEmpty = false;
  203. }
  204. else if (isFolder)
  205. {
  206. if (deleteUnwantedFilesIn (f))
  207. filesToDelete.add (f);
  208. else
  209. folderIsNowEmpty = false;
  210. }
  211. else
  212. {
  213. filesToDelete.add (f);
  214. }
  215. }
  216. for (int j = filesToDelete.size(); --j >= 0;)
  217. filesToDelete.getReference(j).deleteRecursively();
  218. return folderIsNowEmpty;
  219. }
  220. static bool shouldFileBeKept (const String& filename)
  221. {
  222. static const char* filesToKeep[] = { ".svn", ".cvs", "CMakeLists.txt" };
  223. for (int i = 0; i < numElementsInArray (filesToKeep); ++i)
  224. if (filename == filesToKeep[i])
  225. return true;
  226. return false;
  227. }
  228. void writeMainProjectFile()
  229. {
  230. ScopedPointer<XmlElement> xml (project.getProjectRoot().createXml());
  231. jassert (xml != nullptr);
  232. if (xml != nullptr)
  233. {
  234. MemoryOutputStream mo;
  235. xml->writeToStream (mo, String());
  236. replaceFileIfDifferent (projectFile, mo);
  237. }
  238. }
  239. static int findLongestModuleName (const OwnedArray<LibraryModule>& modules)
  240. {
  241. int longest = 0;
  242. for (int i = modules.size(); --i >= 0;)
  243. longest = jmax (longest, modules.getUnchecked(i)->getID().length());
  244. return longest;
  245. }
  246. File getAppConfigFile() const { return generatedCodeFolder.getChildFile (project.getAppConfigFilename()); }
  247. String loadUserContentFromAppConfig() const
  248. {
  249. StringArray lines, userContent;
  250. lines.addLines (getAppConfigFile().loadFileAsString());
  251. bool foundCodeSection = false;
  252. for (int i = 0; i < lines.size(); ++i)
  253. {
  254. if (lines[i].contains ("[BEGIN_USER_CODE_SECTION]"))
  255. {
  256. for (int j = i + 1; j < lines.size() && ! lines[j].contains ("[END_USER_CODE_SECTION]"); ++j)
  257. userContent.add (lines[j]);
  258. foundCodeSection = true;
  259. break;
  260. }
  261. }
  262. if (! foundCodeSection)
  263. {
  264. userContent.add (String());
  265. userContent.add ("// (You can add your own code in this section, and the Projucer will not overwrite it)");
  266. userContent.add (String());
  267. }
  268. return userContent.joinIntoString (newLine) + newLine;
  269. }
  270. void checkModuleValidity (OwnedArray<LibraryModule>& modules)
  271. {
  272. if (project.getNumExporters() == 0)
  273. {
  274. addError ("No exporters found!\n"
  275. "Please add an exporter before saving.");
  276. return;
  277. }
  278. for (LibraryModule** moduleIter = modules.begin(); moduleIter != modules.end(); ++moduleIter)
  279. {
  280. if (const LibraryModule* const module = *moduleIter)
  281. {
  282. if (! module->isValid())
  283. {
  284. addError ("At least one of your JUCE module paths is invalid!\n"
  285. "Please go to the Modules settings page and ensure each path points to the correct JUCE modules folder.");
  286. return;
  287. }
  288. if (project.getModules().getExtraDependenciesNeeded (module->getID()).size() > 0)
  289. {
  290. addError ("At least one of your modules has missing dependencies!\n"
  291. "Please go to the settings page of the highlighted modules and add the required dependencies.");
  292. return;
  293. }
  294. }
  295. else
  296. {
  297. // this should never happen!
  298. jassertfalse;
  299. }
  300. }
  301. }
  302. void writeAppConfig (MemoryOutputStream& out, const OwnedArray<LibraryModule>& modules, const String& userContent)
  303. {
  304. writeAutoGenWarningComment (out);
  305. out << " There's a section below where you can add your own custom code safely, and the" << newLine
  306. << " Projucer will preserve the contents of that block, but the best way to change" << newLine
  307. << " any of these definitions is by using the Projucer's project settings." << newLine
  308. << newLine
  309. << " Any commented-out settings will assume their default values." << newLine
  310. << newLine
  311. << "*/" << newLine
  312. << newLine;
  313. out << "#pragma once" << newLine
  314. << newLine
  315. << "//==============================================================================" << newLine
  316. << "// [BEGIN_USER_CODE_SECTION]" << newLine
  317. << userContent
  318. << "// [END_USER_CODE_SECTION]" << newLine;
  319. out << newLine
  320. << "/*" << newLine
  321. << " ==============================================================================" << newLine
  322. << newLine
  323. << " In accordance with the terms of the JUCE 5 End-Use License Agreement, the" << newLine
  324. << " JUCE Code in SECTION A cannot be removed, changed or otherwise rendered" << newLine
  325. << " ineffective unless you have a JUCE Indie or Pro license, or are using JUCE" << newLine
  326. << " under the GPL v3 license." << newLine
  327. << newLine
  328. << " End User License Agreement: www.juce.com/juce-5-licence" << newLine
  329. << newLine
  330. << " ==============================================================================" << newLine
  331. << "*/" << newLine
  332. << newLine
  333. << "// BEGIN SECTION A" << newLine
  334. << newLine
  335. << "#ifndef JUCE_DISPLAY_SPLASH_SCREEN" << newLine
  336. << " #define JUCE_DISPLAY_SPLASH_SCREEN " << (project.shouldDisplaySplashScreen().getValue() ? "1" : "0") << newLine
  337. << "#endif" << newLine << newLine
  338. << "#ifndef JUCE_REPORT_APP_USAGE" << newLine
  339. << " #define JUCE_REPORT_APP_USAGE " << (project.shouldReportAppUsage().getValue() ? "1" : "0") << newLine
  340. << "#endif" << newLine
  341. << newLine
  342. << "// END SECTION A" << newLine
  343. << newLine
  344. << "#define JUCE_USE_DARK_SPLASH_SCREEN " << (project.splashScreenColour().toString() == "Dark" ? "1" : "0") << newLine;
  345. out << newLine
  346. << "//==============================================================================" << newLine;
  347. const int longestName = findLongestModuleName (modules);
  348. for (int k = 0; k < modules.size(); ++k)
  349. {
  350. LibraryModule* const m = modules.getUnchecked(k);
  351. out << "#define JUCE_MODULE_AVAILABLE_" << m->getID()
  352. << String::repeatedString (" ", longestName + 5 - m->getID().length()) << " 1" << newLine;
  353. }
  354. out << newLine << "#define JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED 1" << newLine;
  355. for (int j = 0; j < modules.size(); ++j)
  356. {
  357. LibraryModule* const m = modules.getUnchecked(j);
  358. OwnedArray<Project::ConfigFlag> flags;
  359. m->getConfigFlags (project, flags);
  360. if (flags.size() > 0)
  361. {
  362. out << newLine
  363. << "//==============================================================================" << newLine
  364. << "// " << m->getID() << " flags:" << newLine;
  365. for (int i = 0; i < flags.size(); ++i)
  366. {
  367. flags.getUnchecked(i)->value.referTo (project.getConfigFlag (flags.getUnchecked(i)->symbol));
  368. const Project::ConfigFlag* const f = flags[i];
  369. const String value (project.getConfigFlag (f->symbol).toString());
  370. out << newLine
  371. << "#ifndef " << f->symbol << newLine;
  372. if (value == Project::configFlagEnabled)
  373. out << " #define " << f->symbol << " 1";
  374. else if (value == Project::configFlagDisabled)
  375. out << " #define " << f->symbol << " 0";
  376. else if (f->defaultValue.isEmpty())
  377. out << " //#define " << f->symbol << " 1";
  378. else
  379. out << " #define " << f->symbol << " " << f->defaultValue;
  380. out << newLine
  381. << "#endif" << newLine;
  382. }
  383. }
  384. }
  385. {
  386. int isStandaloneApplication = 1;
  387. const ProjectType& type = project.getProjectType();
  388. if (type.isAudioPlugin() || type.isDynamicLibrary())
  389. isStandaloneApplication = 0;
  390. out << "//==============================================================================" << newLine
  391. << "#ifndef JUCE_STANDALONE_APPLICATION" << newLine
  392. << " #if defined(JucePlugin_Name) && defined(JucePlugin_Build_Standalone)" << newLine
  393. << " #define JUCE_STANDALONE_APPLICATION JucePlugin_Build_Standalone" << newLine
  394. << " #else" << newLine
  395. << " #define JUCE_STANDALONE_APPLICATION " << isStandaloneApplication << newLine
  396. << " #endif" << newLine
  397. << "#endif" << newLine;
  398. }
  399. if (extraAppConfigContent.isNotEmpty())
  400. out << newLine << extraAppConfigContent.trimEnd() << newLine;
  401. }
  402. void writeAppConfigFile (const OwnedArray<LibraryModule>& modules, const String& userContent)
  403. {
  404. appConfigFile = getAppConfigFile();
  405. MemoryOutputStream mem;
  406. writeAppConfig (mem, modules, userContent);
  407. saveGeneratedFile (project.getAppConfigFilename(), mem);
  408. }
  409. void writeAppHeader (MemoryOutputStream& out, const OwnedArray<LibraryModule>& modules)
  410. {
  411. writeAutoGenWarningComment (out);
  412. out << " This is the header file that your files should include in order to get all the" << newLine
  413. << " JUCE library headers. You should avoid including the JUCE headers directly in" << newLine
  414. << " your own source files, because that wouldn't pick up the correct configuration" << newLine
  415. << " options for your app." << newLine
  416. << newLine
  417. << "*/" << newLine << newLine;
  418. out << "#pragma once" << newLine << newLine;
  419. if (appConfigFile.exists())
  420. out << CodeHelpers::createIncludeStatement (project.getAppConfigFilename()) << newLine;
  421. if (modules.size() > 0)
  422. {
  423. out << newLine;
  424. for (int i = 0; i < modules.size(); ++i)
  425. modules.getUnchecked(i)->writeIncludes (*this, out);
  426. out << newLine;
  427. }
  428. if (hasBinaryData && project.shouldIncludeBinaryInAppConfig().getValue())
  429. out << CodeHelpers::createIncludeStatement (project.getBinaryDataHeaderFile(), appConfigFile) << newLine;
  430. out << newLine
  431. << "#if ! DONT_SET_USING_JUCE_NAMESPACE" << newLine
  432. << " // If your code uses a lot of JUCE classes, then this will obviously save you" << newLine
  433. << " // a lot of typing, but can be disabled by setting DONT_SET_USING_JUCE_NAMESPACE." << newLine
  434. << " using namespace juce;" << newLine
  435. << "#endif" << newLine
  436. << newLine
  437. << "#if ! JUCE_DONT_DECLARE_PROJECTINFO" << newLine
  438. << "namespace ProjectInfo" << newLine
  439. << "{" << newLine
  440. << " const char* const projectName = " << CppTokeniserFunctions::addEscapeChars (project.getTitle()).quoted() << ";" << newLine
  441. << " const char* const versionString = " << CppTokeniserFunctions::addEscapeChars (project.getVersionString()).quoted() << ";" << newLine
  442. << " const int versionNumber = " << project.getVersionAsHex() << ";" << newLine
  443. << "}" << newLine
  444. << "#endif" << newLine;
  445. }
  446. void writeAppHeader (const OwnedArray<LibraryModule>& modules)
  447. {
  448. MemoryOutputStream mem;
  449. writeAppHeader (mem, modules);
  450. saveGeneratedFile (project.getJuceSourceHFilename(), mem);
  451. }
  452. void writeModuleCppWrappers (const OwnedArray<LibraryModule>& modules)
  453. {
  454. for (auto* module : modules)
  455. {
  456. for (auto& cu : module->getAllCompileUnits())
  457. {
  458. MemoryOutputStream mem;
  459. writeAutoGenWarningComment (mem);
  460. mem << "*/" << newLine
  461. << newLine
  462. << "#include " << project.getAppConfigFilename().quoted() << newLine
  463. << "#include <";
  464. if (cu.file.getFileExtension() != ".r") // .r files are included without the path
  465. mem << module->getID() << "/";
  466. mem << cu.file.getFileName() << ">" << newLine;
  467. replaceFileIfDifferent (generatedCodeFolder.getChildFile (cu.getFilenameForProxyFile()), mem);
  468. }
  469. }
  470. }
  471. void writeBinaryDataFiles()
  472. {
  473. const File binaryDataH (project.getBinaryDataHeaderFile());
  474. ResourceFile resourceFile (project);
  475. if (resourceFile.getNumFiles() > 0)
  476. {
  477. auto dataNamespace = project.binaryDataNamespace().toString().trim();
  478. if (dataNamespace.isEmpty())
  479. dataNamespace = "BinaryData";
  480. resourceFile.setClassName (dataNamespace);
  481. Array<File> binaryDataFiles;
  482. int maxSize = project.getMaxBinaryFileSize().getValue();
  483. if (maxSize <= 0)
  484. maxSize = 10 * 1024 * 1024;
  485. Result r (resourceFile.write (binaryDataFiles, maxSize));
  486. if (r.wasOk())
  487. {
  488. hasBinaryData = true;
  489. for (int i = 0; i < binaryDataFiles.size(); ++i)
  490. {
  491. const File& f = binaryDataFiles.getReference(i);
  492. filesCreated.add (f);
  493. generatedFilesGroup.addFileRetainingSortOrder (f, ! f.hasFileExtension (".h"));
  494. }
  495. }
  496. else
  497. {
  498. addError (r.getErrorMessage());
  499. }
  500. }
  501. else
  502. {
  503. for (int i = 20; --i >= 0;)
  504. project.getBinaryDataCppFile (i).deleteFile();
  505. binaryDataH.deleteFile();
  506. }
  507. }
  508. void writeReadmeFile()
  509. {
  510. MemoryOutputStream out;
  511. out << newLine
  512. << " Important Note!!" << newLine
  513. << " ================" << newLine
  514. << newLine
  515. << "The purpose of this folder is to contain files that are auto-generated by the Projucer," << newLine
  516. << "and ALL files in this folder will be mercilessly DELETED and completely re-written whenever" << newLine
  517. << "the Projucer saves your project." << newLine
  518. << newLine
  519. << "Therefore, it's a bad idea to make any manual changes to the files in here, or to" << newLine
  520. << "put any of your own files in here if you don't want to lose them. (Of course you may choose" << newLine
  521. << "to add the folder's contents to your version-control system so that you can re-merge your own" << newLine
  522. << "modifications after the Projucer has saved its changes)." << newLine;
  523. replaceFileIfDifferent (generatedCodeFolder.getChildFile ("ReadMe.txt"), out);
  524. }
  525. void addError (const String& message)
  526. {
  527. const ScopedLock sl (errorLock);
  528. errors.add (message);
  529. }
  530. void writePluginCharacteristicsFile();
  531. void writeProjects (const OwnedArray<LibraryModule>&, const String&, bool);
  532. void saveExporter (ProjectExporter* exporter, const OwnedArray<LibraryModule>& modules)
  533. {
  534. try
  535. {
  536. exporter->create (modules);
  537. if (! exporter->isCLion())
  538. std::cout << "Finished saving: " << exporter->getName() << std::endl;
  539. }
  540. catch (ProjectExporter::SaveError& error)
  541. {
  542. addError (error.message);
  543. }
  544. }
  545. class ExporterJob : public ThreadPoolJob
  546. {
  547. public:
  548. ExporterJob (ProjectSaver& ps, ProjectExporter* pe,
  549. const OwnedArray<LibraryModule>& moduleList)
  550. : ThreadPoolJob ("export"),
  551. owner (ps), exporter (pe), modules (moduleList)
  552. {
  553. }
  554. JobStatus runJob() override
  555. {
  556. owner.saveExporter (exporter, modules);
  557. return jobHasFinished;
  558. }
  559. private:
  560. ProjectSaver& owner;
  561. ScopedPointer<ProjectExporter> exporter;
  562. const OwnedArray<LibraryModule>& modules;
  563. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ExporterJob)
  564. };
  565. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ProjectSaver)
  566. };