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.

95 lines
4.0KB

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