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.

103 lines
4.3KB

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