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.

102 lines
4.3KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2020 - Raw Material Software Limited
  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 6 End-User License
  8. Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
  9. End User License Agreement: www.juce.com/juce-6-licence
  10. Privacy Policy: www.juce.com/juce-privacy-policy
  11. Or: You may also use this code under the terms of the GPL v3 (see
  12. www.gnu.org/licenses).
  13. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  14. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  15. DISCLAIMED.
  16. ==============================================================================
  17. */
  18. #pragma once
  19. //==============================================================================
  20. struct ProjectBuildInfo
  21. {
  22. ProjectBuildInfo() : tree (MessageTypes::BUILDINFO) {}
  23. ProjectBuildInfo (const ValueTree& t) : tree (t) {}
  24. Array<File> getCompileUnits() const
  25. {
  26. Array<File> files;
  27. for (int i = 0; i < tree.getNumChildren(); ++i)
  28. if (tree.getChild(i).hasType (MessageTypes::COMPILEUNIT))
  29. files.add (File (tree.getChild(i) [Ids::file].toString()));
  30. return files;
  31. }
  32. // This is a list of all cpp and header files that are actually "user" code
  33. // rather than system or internal files
  34. Array<File> getUserFiles() const
  35. {
  36. Array<File> files;
  37. for (int i = 0; i < tree.getNumChildren(); ++i)
  38. if (tree.getChild(i).hasType (MessageTypes::USERFILE))
  39. files.add (File (tree.getChild(i) [Ids::file].toString()));
  40. return files;
  41. }
  42. void setFiles (const Array<File>& compileUnits, const Array<File>& allUserFiles)
  43. {
  44. for (const File& f : compileUnits)
  45. {
  46. ValueTree file (MessageTypes::COMPILEUNIT);
  47. file.setProperty (Ids::file, f.getFullPathName(), nullptr);
  48. tree.appendChild (file, nullptr);
  49. }
  50. for (const File& f : allUserFiles)
  51. {
  52. ValueTree file (MessageTypes::USERFILE);
  53. file.setProperty (Ids::file, f.getFullPathName(), nullptr);
  54. tree.appendChild (file, nullptr);
  55. }
  56. }
  57. StringArray getSystemIncludes() const { return separateJoinedStrings (tree [Ids::systempath]); }
  58. StringArray getUserIncludes() const { return separateJoinedStrings (tree [Ids::userpath]); }
  59. void setSystemIncludes (const StringArray& s) { tree.setProperty (Ids::systempath, concatenateListOfStrings (s), nullptr); }
  60. void setUserIncludes (const StringArray& s) { tree.setProperty (Ids::userpath, concatenateListOfStrings (s), nullptr); }
  61. String getGlobalDefs() const { return tree [Ids::defines]; }
  62. void setGlobalDefs (const String& defs) { tree.setProperty (Ids::defines, defs, nullptr); }
  63. String getCompileFlags() const { return tree [Ids::extraCompilerFlags]; }
  64. void setCompileFlags (const String& f) { tree.setProperty (Ids::extraCompilerFlags, f, nullptr); }
  65. String getUtilsCppInclude() const { return tree [Ids::utilsCppInclude]; }
  66. void setUtilsCppInclude (const String& s) { tree.setProperty (Ids::utilsCppInclude, s, nullptr); }
  67. String getJuceModulesFolder() const { return tree [Ids::juceModulesFolder]; }
  68. void setJuceModulesFolder (const String& s) { tree.setProperty (Ids::juceModulesFolder, s, nullptr); }
  69. StringArray getExtraDLLs() const { return separateJoinedStrings (tree [Ids::extraDLLs]); }
  70. void setExtraDLLs (const StringArray& s) { tree.setProperty (Ids::extraDLLs, concatenateListOfStrings (s), nullptr); }
  71. String getWindowsTargetPlatformVersion() const { return tree [Ids::liveWindowsTargetPlatformVersion]; }
  72. void setWindowsTargetPlatformVersion (const String& s) { tree.setProperty (Ids::liveWindowsTargetPlatformVersion, s, nullptr); }
  73. ValueTree tree;
  74. };