diff --git a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_Android.h b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_Android.h index 10e6d2406e..63445916dc 100644 --- a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_Android.h +++ b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_Android.h @@ -87,6 +87,13 @@ public: return nullptr; } + //============================================================================== + void initialiseDependencyPathValues() override + { + sdkPath.referTo (Value (new DependencyPathValueSource (getSetting (Ids::androidSDKPath), Ids::androidSDKPath, TargetOS::getThisOS()))); + ndkPath.referTo (Value (new DependencyPathValueSource (getSetting (Ids::androidNDKPath), Ids::androidNDKPath, TargetOS::getThisOS()))); + } + //============================================================================== CachedValue androidRepositories, androidDependencies, androidScreenOrientation, androidActivityClass, androidActivitySubClassName, @@ -132,7 +139,6 @@ public: buildToolsVersion (settings, Ids::buildToolsVersion, nullptr, "26.0.0"), AndroidExecutable (findAndroidExecutable()) { - initialiseDependencyPathValues(); name = getName(); if (getTargetLocationString().isEmpty()) @@ -872,12 +878,6 @@ private: return s + CodeHelpers::makeValidIdentifier (project.getProjectFilenameRoot(), false, true, false); } - void initialiseDependencyPathValues() - { - sdkPath.referTo (Value (new DependencyPathValueSource (getSetting (Ids::androidSDKPath), Ids::androidSDKPath, TargetOS::getThisOS()))); - ndkPath.referTo (Value (new DependencyPathValueSource (getSetting (Ids::androidNDKPath), Ids::androidNDKPath, TargetOS::getThisOS()))); - } - //============================================================================== void copyActivityJavaFiles (const OwnedArray& modules, const File& targetFolder, const String& package) const { diff --git a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_CodeBlocks.h b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_CodeBlocks.h index b219cc7756..ce70b4d59a 100644 --- a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_CodeBlocks.h +++ b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_CodeBlocks.h @@ -91,8 +91,6 @@ public: if (getTargetLocationString().isEmpty()) getTargetLocationValue() = getDefaultBuildsRootFolder() + getTargetFolderName (os); - - initialiseDependencyPathValues(); } //============================================================================== @@ -177,6 +175,21 @@ public: jassert (targets.size() > 0); } + //============================================================================== + void initialiseDependencyPathValues() override + { + DependencyPathOS pathOS = isLinux() ? TargetOS::linux + : TargetOS::windows; + + vst3Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vst3Folder), Ids::vst3Path, pathOS))); + + if (! isLinux()) + { + aaxPath.referTo (Value (new DependencyPathValueSource (getSetting (Ids::aaxFolder), Ids::aaxPath, pathOS))); + rtasPath.referTo (Value (new DependencyPathValueSource (getSetting (Ids::rtasFolder), Ids::rtasPath, pathOS))); + } + } + private: //============================================================================== class CodeBlocksBuildConfiguration : public BuildConfiguration @@ -723,20 +736,6 @@ private: xml.createNewChildElement ("Add")->setAttribute (nm, value); } - void initialiseDependencyPathValues() - { - DependencyPathOS pathOS = isLinux() ? TargetOS::linux - : TargetOS::windows; - - vst3Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vst3Folder), Ids::vst3Path, pathOS))); - - if (! isLinux()) - { - aaxPath.referTo (Value (new DependencyPathValueSource (getSetting (Ids::aaxFolder), Ids::aaxPath, pathOS))); - rtasPath.referTo (Value (new DependencyPathValueSource (getSetting (Ids::rtasFolder), Ids::rtasPath, pathOS))); - } - } - CodeBlocksOS os; OwnedArray targets; diff --git a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_MSVC.h b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_MSVC.h index fd81ccf0bc..eff6772e31 100644 --- a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_MSVC.h +++ b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_MSVC.h @@ -34,8 +34,6 @@ public: getTargetLocationValue() = getDefaultBuildsRootFolder() + folderName; updateOldSettings(); - - initialiseDependencyPathValues(); } virtual int getVisualStudioVersion() const = 0; @@ -132,6 +130,22 @@ public: } } + //============================================================================== + void initialiseDependencyPathValues() override + { + vst3Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vst3Folder), + Ids::vst3Path, + TargetOS::windows))); + + aaxPath.referTo (Value (new DependencyPathValueSource (getSetting (Ids::aaxFolder), + Ids::aaxPath, + TargetOS::windows))); + + rtasPath.referTo (Value (new DependencyPathValueSource (getSetting (Ids::rtasFolder), + Ids::rtasPath, + TargetOS::windows))); + } + //============================================================================== class MSVCBuildConfiguration : public BuildConfiguration { @@ -1698,21 +1712,6 @@ protected: : (".\\" + filename); } - void initialiseDependencyPathValues() - { - vst3Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vst3Folder), - Ids::vst3Path, - TargetOS::windows))); - - aaxPath.referTo (Value (new DependencyPathValueSource (getSetting (Ids::aaxFolder), - Ids::aaxPath, - TargetOS::windows))); - - rtasPath.referTo (Value (new DependencyPathValueSource (getSetting (Ids::rtasFolder), - Ids::rtasPath, - TargetOS::windows))); - } - static bool shouldUseStdCall (const RelativePath& path) { return path.getFileNameWithoutExtension().startsWithIgnoreCase ("juce_audio_plugin_client_RTAS_"); diff --git a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_Make.h b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_Make.h index 67c2d7e35b..440681aa4c 100644 --- a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_Make.h +++ b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_Make.h @@ -310,8 +310,6 @@ public: if (getTargetLocationString().isEmpty()) getTargetLocationValue() = getDefaultBuildsRootFolder() + "LinuxMakefile"; - - initialiseDependencyPathValues(); } //============================================================================== @@ -401,6 +399,14 @@ public: jassert (targets.size() > 0); } + //============================================================================== + void initialiseDependencyPathValues() override + { + vst3Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vst3Folder), + Ids::vst3Path, + TargetOS::linux))); + } + private: bool isWebBrowserComponentEnabled() const { @@ -746,13 +752,6 @@ private: return phonyTargetLine.toString(); } - void initialiseDependencyPathValues() - { - vst3Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vst3Folder), - Ids::vst3Path, - TargetOS::linux))); - } - OwnedArray targets; JUCE_DECLARE_NON_COPYABLE (MakefileProjectExporter) diff --git a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_XCode.h b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_XCode.h index ab3e3cc892..0010622dc8 100644 --- a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_XCode.h +++ b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_XCode.h @@ -61,8 +61,6 @@ public: if (getTargetLocationString().isEmpty()) getTargetLocationValue() = getDefaultBuildsRootFolder() + (iOS ? "iOS" : "MacOSX"); - initialiseDependencyPathValues(); - if (iOS) { if (getScreenOrientationValue().toString().isEmpty()) @@ -362,6 +360,14 @@ public: return (MD5 (getPostBuildScript().toUTF8()).toHexString() == "265ac212a7e734c5bbd6150e1eae18a1"); } + //============================================================================== + void initialiseDependencyPathValues() override + { + vst3Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vst3Folder), Ids::vst3Path, TargetOS::osx))); + aaxPath. referTo (Value (new DependencyPathValueSource (getSetting (Ids::aaxFolder), Ids::aaxPath, TargetOS::osx))); + rtasPath.referTo (Value (new DependencyPathValueSource (getSetting (Ids::rtasFolder), Ids::rtasPath, TargetOS::osx))); + } + protected: //============================================================================== class XcodeBuildConfiguration : public BuildConfiguration @@ -2865,12 +2871,5 @@ private: return getOSXVersionName (version) + " SDK"; } - void initialiseDependencyPathValues() - { - vst3Path.referTo (Value (new DependencyPathValueSource (getSetting (Ids::vst3Folder), Ids::vst3Path, TargetOS::osx))); - aaxPath. referTo (Value (new DependencyPathValueSource (getSetting (Ids::aaxFolder), Ids::aaxPath, TargetOS::osx))); - rtasPath.referTo (Value (new DependencyPathValueSource (getSetting (Ids::rtasFolder), Ids::rtasPath, TargetOS::osx))); - } - JUCE_DECLARE_NON_COPYABLE (XCodeProjectExporter) }; diff --git a/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.cpp b/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.cpp index 13b1ed8c77..e1627f15e6 100644 --- a/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.cpp +++ b/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.cpp @@ -500,7 +500,7 @@ String ProjectExporter::getPathForModuleString (const String& moduleID) const auto exporterPath = settings.getChildWithName (Ids::MODULEPATHS) .getChildWithProperty (Ids::ID, moduleID) [Ids::path].toString(); - if (exporterPath.isEmpty() || project.getModules().shouldUseGlobalPath (moduleID).getValue()) + if (exporterPath.isEmpty() || project.getModules().shouldUseGlobalPath (moduleID)) { auto id = EnabledModuleList::isJuceModule (moduleID) ? Ids::defaultJuceModulePath : Ids::defaultUserModulePath; diff --git a/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.h b/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.h index 746ce2f079..1b058ee215 100644 --- a/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.h +++ b/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.h @@ -81,6 +81,7 @@ public: virtual bool canCopeWithDuplicateFiles() = 0; virtual bool supportsUserDefinedConfigurations() const = 0; // false if exporter only supports two configs Debug and Release virtual void updateDeprecatedProjectSettingsInteractively(); + virtual void initialiseDependencyPathValues() {} // IDE targeted by exporter virtual bool isXcode() const = 0; diff --git a/extras/Projucer/Source/Project Saving/jucer_ProjectSaver.h b/extras/Projucer/Source/Project Saving/jucer_ProjectSaver.h index 20cf92cc40..9a525a1d9b 100644 --- a/extras/Projucer/Source/Project Saving/jucer_ProjectSaver.h +++ b/extras/Projucer/Source/Project Saving/jucer_ProjectSaver.h @@ -674,6 +674,8 @@ private: if (specifiedExporterToSave.isNotEmpty() && exporter->getName() != specifiedExporterToSave) continue; + exporter->initialiseDependencyPathValues(); + if (exporter->getTargetFolder().createDirectory()) { exporter->copyMainGroupFromProject(); diff --git a/extras/Projucer/Source/Project/jucer_ConfigTree_Exporter.h b/extras/Projucer/Source/Project/jucer_ConfigTree_Exporter.h index dc2aeb3f8d..a12bc9df69 100644 --- a/extras/Projucer/Source/Project/jucer_ConfigTree_Exporter.h +++ b/extras/Projucer/Source/Project/jucer_ConfigTree_Exporter.h @@ -32,6 +32,7 @@ public: : project (p), exporter (e), configListTree (exporter->getConfigurations()), exporterIndex (index) { + exporter->initialiseDependencyPathValues(); configListTree.addListener (this); targetLocationValue.referTo (exporter->getTargetLocationValue()); targetLocationValue.addListener (this); diff --git a/extras/Projucer/Source/Project/jucer_ConfigTree_Modules.h b/extras/Projucer/Source/Project/jucer_ConfigTree_Modules.h index bd57571de6..4b95912594 100644 --- a/extras/Projucer/Source/Project/jucer_ConfigTree_Modules.h +++ b/extras/Projucer/Source/Project/jucer_ConfigTree_Modules.h @@ -124,7 +124,6 @@ private: void refresh() { auto& modules = project.getModules(); - const auto& isUsingGlobalPathValue = modules.shouldUseGlobalPath (moduleID); setEnabled (modules.isModuleEnabled (moduleID)); @@ -158,11 +157,11 @@ private: "must be valid on the filesystem of the target machine that will be performing this build. If this " "is empty then the global path will be used."); - pathComponent->setEnabled (! isUsingGlobalPathValue.getValue()); + pathComponent->setEnabled (! modules.shouldUseGlobalPath (moduleID)); pathComponent->getValue().addListener (this); } - globalPathValue.referTo (isUsingGlobalPathValue); + globalPathValue.referTo (modules.getShouldUseGlobalPathValue (moduleID)); auto menuItemString = (TargetOS::getThisOS() == TargetOS::osx ? "\"Projucer->Global Search Paths...\"" : "\"File->Global Search Paths...\""); diff --git a/extras/Projucer/Source/Project/jucer_Module.cpp b/extras/Projucer/Source/Project/jucer_Module.cpp index 7c44259b48..b82cb23550 100644 --- a/extras/Projucer/Source/Project/jucer_Module.cpp +++ b/extras/Projucer/Source/Project/jucer_Module.cpp @@ -222,7 +222,7 @@ static Array getAllPossibleModulePathsFromExporters (Project& project) { auto id = modules.getModuleID (i); - if (modules.shouldUseGlobalPath (id).getValue()) + if (modules.shouldUseGlobalPath (id)) continue; const auto path = exporter->getPathForModuleString (id); @@ -651,7 +651,13 @@ bool EnabledModuleList::isAudioPluginModuleMissing() const && ! isModuleEnabled ("juce_audio_plugin_client"); } -Value EnabledModuleList::shouldUseGlobalPath (const String& moduleID) const +bool EnabledModuleList::shouldUseGlobalPath (const String& moduleID) const +{ + return static_cast (state.getChildWithProperty (Ids::ID, moduleID) + .getProperty (Ids::useGlobalPath)); +} + +Value EnabledModuleList::getShouldUseGlobalPathValue (const String& moduleID) const { return state.getChildWithProperty (Ids::ID, moduleID) .getPropertyAsValue (Ids::useGlobalPath, getUndoManager()); @@ -704,7 +710,7 @@ File EnabledModuleList::findUserModuleFolder (const String& possiblePaths, const File EnabledModuleList::getModuleFolder (const String& moduleID) { - if (shouldUseGlobalPath (moduleID).getValue()) + if (shouldUseGlobalPath (moduleID)) { if (isJuceModule (moduleID)) return getModuleFolderFromPathIfItExists (getAppSettings().getStoredPath (Ids::defaultJuceModulePath).toString(), moduleID, project); @@ -761,7 +767,7 @@ void EnabledModuleList::addModule (const File& moduleFolder, bool copyLocally, b shouldShowAllModuleFilesInProject (moduleID) = true; shouldCopyModuleFilesLocally (moduleID) = copyLocally; - shouldUseGlobalPath (moduleID) = useGlobalPath; + getShouldUseGlobalPathValue (moduleID) = useGlobalPath; RelativePath path (moduleFolder.getParentDirectory(), project.getProjectFolder(), RelativePath::projectFolder); @@ -842,7 +848,7 @@ bool EnabledModuleList::areMostModulesUsingGlobalPath() const for (auto i = getNumModules(); --i >= 0;) { - if (shouldUseGlobalPath (getModuleID (i)).getValue()) + if (shouldUseGlobalPath (getModuleID (i))) ++numYes; else ++numNo; diff --git a/extras/Projucer/Source/Project/jucer_Module.h b/extras/Projucer/Source/Project/jucer_Module.h index a523d24a87..42566ced76 100644 --- a/extras/Projucer/Source/Project/jucer_Module.h +++ b/extras/Projucer/Source/Project/jucer_Module.h @@ -144,7 +144,9 @@ public: bool isModuleEnabled (const String& moduleID) const; - Value shouldUseGlobalPath (const String& moduleID) const; + bool shouldUseGlobalPath (const String& moduleID) const; + Value getShouldUseGlobalPathValue (const String& moduleID) const; + Value shouldShowAllModuleFilesInProject (const String& moduleID); Value shouldCopyModuleFilesLocally (const String& moduleID) const; diff --git a/extras/Projucer/Source/Project/jucer_ModulesPanel.h b/extras/Projucer/Source/Project/jucer_ModulesPanel.h index 297540456c..1ac9b0a25e 100644 --- a/extras/Projucer/Source/Project/jucer_ModulesPanel.h +++ b/extras/Projucer/Source/Project/jucer_ModulesPanel.h @@ -142,7 +142,7 @@ public: //====================================================================== String pathText; - if (project.getModules().shouldUseGlobalPath (moduleID).getValue()) + if (project.getModules().shouldUseGlobalPath (moduleID)) { pathText = "Global"; } @@ -250,14 +250,14 @@ private: auto moduleIDs = moduleList.getAllModules(); for (auto id : moduleIDs) - moduleList.shouldUseGlobalPath (id).setValue (enableGlobalPaths); + moduleList.getShouldUseGlobalPathValue (id).setValue (enableGlobalPaths); } else { auto selected = list.getSelectedRows(); for (auto i = 0; i < selected.size(); ++i) - moduleList.shouldUseGlobalPath (moduleList.getModuleID (selected[i])).setValue (enableGlobalPaths); + moduleList.getShouldUseGlobalPathValue (moduleList.getModuleID (selected[i])).setValue (enableGlobalPaths); } } }