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.

94 lines
3.9KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2015 - ROLI Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. struct ProjectBuildInfo
  18. {
  19. ProjectBuildInfo() : tree (MessageTypes::BUILDINFO) {}
  20. ProjectBuildInfo (const ValueTree& t) : tree (t) {}
  21. Array<File> getCompileUnits() const
  22. {
  23. Array<File> files;
  24. for (int i = 0; i < tree.getNumChildren(); ++i)
  25. if (tree.getChild(i).hasType (MessageTypes::COMPILEUNIT))
  26. files.add (File (tree.getChild(i) [Ids::file].toString()));
  27. return files;
  28. }
  29. // This is a list of all cpp and header files that are actually "user" code
  30. // rather than system or internal files
  31. Array<File> getUserFiles() const
  32. {
  33. Array<File> files;
  34. for (int i = 0; i < tree.getNumChildren(); ++i)
  35. if (tree.getChild(i).hasType (MessageTypes::USERFILE))
  36. files.add (File (tree.getChild(i) [Ids::file].toString()));
  37. return files;
  38. }
  39. void setFiles (const Array<File>& compileUnits, const Array<File>& allUserFiles)
  40. {
  41. for (const File& f : compileUnits)
  42. {
  43. ValueTree file (MessageTypes::COMPILEUNIT);
  44. file.setProperty (Ids::file, f.getFullPathName(), nullptr);
  45. tree.addChild (file, -1, nullptr);
  46. }
  47. for (const File& f : allUserFiles)
  48. {
  49. ValueTree file (MessageTypes::USERFILE);
  50. file.setProperty (Ids::file, f.getFullPathName(), nullptr);
  51. tree.addChild (file, -1, nullptr);
  52. }
  53. }
  54. StringArray getSystemIncludes() const { return separateJoinedStrings (tree [Ids::systempath]); }
  55. StringArray getUserIncludes() const { return separateJoinedStrings (tree [Ids::userpath]); }
  56. void setSystemIncludes (const StringArray& s) { tree.setProperty (Ids::systempath, concatenateListOfStrings (s), nullptr); }
  57. void setUserIncludes (const StringArray& s) { tree.setProperty (Ids::userpath, concatenateListOfStrings (s), nullptr); }
  58. String getGlobalDefs() const { return tree [Ids::defines]; }
  59. void setGlobalDefs (const String& defs) { tree.setProperty (Ids::defines, defs, nullptr); }
  60. String getCompileFlags() const { return tree [Ids::extraCompilerFlags]; }
  61. void setCompileFlags (const String& f) { tree.setProperty (Ids::extraCompilerFlags, f, nullptr); }
  62. String getUtilsCppInclude() const { return tree [Ids::utilsCppInclude]; }
  63. void setUtilsCppInclude (const String& s) { tree.setProperty (Ids::utilsCppInclude, s, nullptr); }
  64. String getJuceModulesFolder() const { return tree [Ids::juceModulesFolder]; }
  65. void setJuceModulesFolder (const String& s) { tree.setProperty (Ids::juceModulesFolder, s, nullptr); }
  66. StringArray getExtraDLLs() const { return separateJoinedStrings (tree [Ids::extraDLLs]); }
  67. void setExtraDLLs (const StringArray& s) { tree.setProperty (Ids::extraDLLs, concatenateListOfStrings (s), nullptr); }
  68. ValueTree tree;
  69. };