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.

99 lines
4.2KB

  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. struct ProjectBuildInfo
  20. {
  21. ProjectBuildInfo() : tree (MessageTypes::BUILDINFO) {}
  22. ProjectBuildInfo (const ValueTree& t) : tree (t) {}
  23. Array<File> getCompileUnits() const
  24. {
  25. Array<File> files;
  26. for (int i = 0; i < tree.getNumChildren(); ++i)
  27. if (tree.getChild(i).hasType (MessageTypes::COMPILEUNIT))
  28. files.add (File (tree.getChild(i) [Ids::file].toString()));
  29. return files;
  30. }
  31. // This is a list of all cpp and header files that are actually "user" code
  32. // rather than system or internal files
  33. Array<File> getUserFiles() const
  34. {
  35. Array<File> files;
  36. for (int i = 0; i < tree.getNumChildren(); ++i)
  37. if (tree.getChild(i).hasType (MessageTypes::USERFILE))
  38. files.add (File (tree.getChild(i) [Ids::file].toString()));
  39. return files;
  40. }
  41. void setFiles (const Array<File>& compileUnits, const Array<File>& allUserFiles)
  42. {
  43. for (const File& f : compileUnits)
  44. {
  45. ValueTree file (MessageTypes::COMPILEUNIT);
  46. file.setProperty (Ids::file, f.getFullPathName(), nullptr);
  47. tree.addChild (file, -1, nullptr);
  48. }
  49. for (const File& f : allUserFiles)
  50. {
  51. ValueTree file (MessageTypes::USERFILE);
  52. file.setProperty (Ids::file, f.getFullPathName(), nullptr);
  53. tree.addChild (file, -1, nullptr);
  54. }
  55. }
  56. StringArray getSystemIncludes() const { return separateJoinedStrings (tree [Ids::systempath]); }
  57. StringArray getUserIncludes() const { return separateJoinedStrings (tree [Ids::userpath]); }
  58. void setSystemIncludes (const StringArray& s) { tree.setProperty (Ids::systempath, concatenateListOfStrings (s), nullptr); }
  59. void setUserIncludes (const StringArray& s) { tree.setProperty (Ids::userpath, concatenateListOfStrings (s), nullptr); }
  60. String getGlobalDefs() const { return tree [Ids::defines]; }
  61. void setGlobalDefs (const String& defs) { tree.setProperty (Ids::defines, defs, nullptr); }
  62. String getCompileFlags() const { return tree [Ids::extraCompilerFlags]; }
  63. void setCompileFlags (const String& f) { tree.setProperty (Ids::extraCompilerFlags, f, nullptr); }
  64. String getUtilsCppInclude() const { return tree [Ids::utilsCppInclude]; }
  65. void setUtilsCppInclude (const String& s) { tree.setProperty (Ids::utilsCppInclude, s, nullptr); }
  66. String getJuceModulesFolder() const { return tree [Ids::juceModulesFolder]; }
  67. void setJuceModulesFolder (const String& s) { tree.setProperty (Ids::juceModulesFolder, s, nullptr); }
  68. StringArray getExtraDLLs() const { return separateJoinedStrings (tree [Ids::extraDLLs]); }
  69. void setExtraDLLs (const StringArray& s) { tree.setProperty (Ids::extraDLLs, concatenateListOfStrings (s), nullptr); }
  70. String getWindowsTargetPlatformVersion() const { return tree [Ids::liveWindowsTargetPlatformVersion]; }
  71. void setWindowsTargetPlatformVersion (const String& s) { tree.setProperty (Ids::liveWindowsTargetPlatformVersion, s, nullptr); }
  72. ValueTree tree;
  73. };