| @@ -27,7 +27,7 @@ | |||
| #include "../../ProjectSaving/jucer_ProjectExporter.h" | |||
| #include "../../Utility/UI/PropertyComponents/jucer_FilePathPropertyComponent.h" | |||
| #include "../../Utility/Helpers/jucer_ValueWithDefaultWrapper.h" | |||
| #include "../../Utility/Helpers/jucer_ValueTreePropertyWithDefaultWrapper.h" | |||
| #include "jucer_NewProjectWizard.h" | |||
| @@ -117,7 +117,7 @@ public: | |||
| exportersValue.get(), | |||
| fileOptionsValue.get(), | |||
| modulePathValue.getCurrentValue(), | |||
| modulePathValue.getWrappedValueWithDefault().isUsingDefault(), | |||
| modulePathValue.getWrappedValueTreePropertyWithDefault().isUsingDefault(), | |||
| [safeThis, dir] (std::unique_ptr<Project> project) | |||
| { | |||
| if (safeThis == nullptr) | |||
| @@ -167,12 +167,12 @@ private: | |||
| ValueTree settingsTree { "NewProjectSettings" }; | |||
| ValueWithDefault projectNameValue { settingsTree, Ids::name, nullptr, "NewProject" }, | |||
| modulesValue { settingsTree, Ids::dependencies_, nullptr, projectTemplate.requiredModules, "," }, | |||
| exportersValue { settingsTree, Ids::exporters, nullptr, StringArray (ProjectExporter::getCurrentPlatformExporterTypeInfo().identifier.toString()), "," }, | |||
| fileOptionsValue { settingsTree, Ids::file, nullptr, NewProjectTemplates::getVarForFileOption (projectTemplate.defaultFileOption) }; | |||
| ValueTreePropertyWithDefault projectNameValue { settingsTree, Ids::name, nullptr, "NewProject" }, | |||
| modulesValue { settingsTree, Ids::dependencies_, nullptr, projectTemplate.requiredModules, "," }, | |||
| exportersValue { settingsTree, Ids::exporters, nullptr, StringArray (ProjectExporter::getCurrentPlatformExporterTypeInfo().identifier.toString()), "," }, | |||
| fileOptionsValue { settingsTree, Ids::file, nullptr, NewProjectTemplates::getVarForFileOption (projectTemplate.defaultFileOption) }; | |||
| ValueWithDefaultWrapper modulePathValue; | |||
| ValueTreePropertyWithDefaultWrapper modulePathValue; | |||
| PropertyPanel panel; | |||
| @@ -203,7 +203,7 @@ private: | |||
| PropertyComponent* createModulePathPropertyComponent() | |||
| { | |||
| return new FilePathPropertyComponent (modulePathValue.getWrappedValueWithDefault(), "Path to Modules", true); | |||
| return new FilePathPropertyComponent (modulePathValue.getWrappedValueTreePropertyWithDefault(), "Path to Modules", true); | |||
| } | |||
| PropertyComponent* createExportersPropertyValue() | |||
| @@ -296,8 +296,9 @@ private: | |||
| //============================================================================== | |||
| Value selectedOSValue; | |||
| ValueWithDefault jucePathValue, juceModulePathValue, userModulePathValue, | |||
| vstPathValue, rtasPathValue, aaxPathValue, androidSDKPathValue, clionExePathValue, androidStudioExePathValue; | |||
| ValueTreePropertyWithDefault jucePathValue, juceModulePathValue, userModulePathValue, | |||
| vstPathValue, rtasPathValue, aaxPathValue, androidSDKPathValue, | |||
| clionExePathValue, androidStudioExePathValue; | |||
| Viewport propertyViewport; | |||
| PropertyGroupComponent propertyGroup { "Global Paths", { getIcons().openFolder, Colours::transparentBlack } }; | |||
| @@ -320,18 +320,18 @@ private: | |||
| //============================================================================== | |||
| ValueTree pipTree { "PIPSettings" }; | |||
| ValueWithDefault nameValue { pipTree, Ids::name, nullptr, "MyComponentPIP" }, | |||
| versionValue { pipTree, Ids::version, nullptr }, | |||
| vendorValue { pipTree, Ids::vendor, nullptr }, | |||
| websiteValue { pipTree, Ids::website, nullptr }, | |||
| descriptionValue { pipTree, Ids::description, nullptr }, | |||
| dependenciesValue { pipTree, Ids::dependencies_, nullptr, getModulesRequiredForComponent(), "," }, | |||
| exportersValue { pipTree, Ids::exporters, nullptr, StringArray (ProjectExporter::getCurrentPlatformExporterTypeInfo().identifier.toString()), "," }, | |||
| moduleFlagsValue { pipTree, Ids::moduleFlags, nullptr, "JUCE_STRICT_REFCOUNTEDPOINTER=1" }, | |||
| definesValue { pipTree, Ids::defines, nullptr }, | |||
| typeValue { pipTree, Ids::type, nullptr, "Component" }, | |||
| mainClassValue { pipTree, Ids::mainClass, nullptr, "MyComponent" }, | |||
| useLocalCopyValue { pipTree, Ids::useLocalCopy, nullptr, false }; | |||
| ValueTreePropertyWithDefault nameValue { pipTree, Ids::name, nullptr, "MyComponentPIP" }, | |||
| versionValue { pipTree, Ids::version, nullptr }, | |||
| vendorValue { pipTree, Ids::vendor, nullptr }, | |||
| websiteValue { pipTree, Ids::website, nullptr }, | |||
| descriptionValue { pipTree, Ids::description, nullptr }, | |||
| dependenciesValue { pipTree, Ids::dependencies_, nullptr, getModulesRequiredForComponent(), "," }, | |||
| exportersValue { pipTree, Ids::exporters, nullptr, StringArray (ProjectExporter::getCurrentPlatformExporterTypeInfo().identifier.toString()), "," }, | |||
| moduleFlagsValue { pipTree, Ids::moduleFlags, nullptr, "JUCE_STRICT_REFCOUNTEDPOINTER=1" }, | |||
| definesValue { pipTree, Ids::defines, nullptr }, | |||
| typeValue { pipTree, Ids::type, nullptr, "Component" }, | |||
| mainClassValue { pipTree, Ids::mainClass, nullptr, "MyComponent" }, | |||
| useLocalCopyValue { pipTree, Ids::useLocalCopy, nullptr, false }; | |||
| std::unique_ptr<PIPCreatorLookAndFeel> lf; | |||
| @@ -118,8 +118,8 @@ private: | |||
| //============================================================================== | |||
| class ModuleSettingsPanel : public Component, | |||
| private Value::Listener, | |||
| private Timer | |||
| private ValueTree::Listener, | |||
| private Value::Listener | |||
| { | |||
| public: | |||
| ModuleSettingsPanel (Project& p, const String& modID, TreeView* tree) | |||
| @@ -129,10 +129,21 @@ private: | |||
| modulesTree (tree), | |||
| moduleID (modID) | |||
| { | |||
| auto& appSettings = getAppSettings(); | |||
| appSettings.addProjectDefaultsListener (*this); | |||
| appSettings.addFallbackPathsListener (*this); | |||
| addAndMakeVisible (group); | |||
| refresh(); | |||
| } | |||
| ~ModuleSettingsPanel() override | |||
| { | |||
| auto& appSettings = getAppSettings(); | |||
| appSettings.removeProjectDefaultsListener (*this); | |||
| appSettings.removeFallbackPathsListener (*this); | |||
| } | |||
| void refresh() | |||
| { | |||
| auto& modules = project.getEnabledModules(); | |||
| @@ -150,21 +161,23 @@ private: | |||
| props.add (new CppStandardWarningComponent()); | |||
| group.clearProperties(); | |||
| exporterModulePathDefaultValues.clear(); | |||
| exporterModulePathValues.clear(); | |||
| globalPathValues.clear(); | |||
| for (Project::ExporterIterator exporter (project); exporter.next();) | |||
| { | |||
| if (exporter->isCLion()) | |||
| continue; | |||
| exporterModulePathDefaultValues.add (exporter->getPathForModuleValue (moduleID)); | |||
| auto& defaultValue = exporterModulePathDefaultValues.getReference (exporterModulePathDefaultValues.size() - 1); | |||
| auto modulePathValue = exporter->getPathForModuleValue (moduleID); | |||
| const auto fallbackPath = getAppSettings().getStoredPath (isJUCEModule (moduleID) ? Ids::defaultJuceModulePath | |||
| : Ids::defaultUserModulePath, | |||
| exporter->getTargetOSForExporter()).get().toString(); | |||
| exporterModulePathValues.add (defaultValue.getPropertyAsValue()); | |||
| modulePathValue.setDefault (fallbackPath); | |||
| exporterModulePathValues.add (modulePathValue.getPropertyAsValue()); | |||
| exporterModulePathValues.getReference (exporterModulePathValues.size() - 1).addListener (this); | |||
| auto pathComponent = std::make_unique<FilePathPropertyComponent> (defaultValue, | |||
| auto pathComponent = std::make_unique<FilePathPropertyComponent> (modulePathValue, | |||
| "Path for " + exporter->getUniqueName().quoted(), | |||
| true, | |||
| exporter->getTargetOSForExporter() == TargetOS::getThisOS(), | |||
| @@ -179,21 +192,9 @@ private: | |||
| "This can be an absolute path, or relative to the jucer project folder, but it " | |||
| "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."); | |||
| globalPathValues.add (getAppSettings().getStoredPath (isJUCEModule (moduleID) ? Ids::defaultJuceModulePath : Ids::defaultUserModulePath, | |||
| exporter->getTargetOSForExporter()).getPropertyAsValue()); | |||
| } | |||
| for (int i = 0; i < exporterModulePathDefaultValues.size(); ++i) | |||
| { | |||
| exporterModulePathDefaultValues.getReference (i).onDefaultChange = [this] { startTimer (50); }; | |||
| exporterModulePathValues.getReference (i).addListener (this); | |||
| globalPathValues.getReference (i).addListener (this); | |||
| } | |||
| useGlobalPathValue.removeListener (this); | |||
| useGlobalPathValue.referTo (modules.shouldUseGlobalPathValue (moduleID)); | |||
| useGlobalPathValue = modules.shouldUseGlobalPathValue (moduleID); | |||
| useGlobalPathValue.addListener (this); | |||
| auto menuItemString = (TargetOS::getThisOS() == TargetOS::osx ? "\"Projucer->Global Paths...\"" | |||
| @@ -242,9 +243,15 @@ private: | |||
| String getModuleID() const noexcept { return moduleID; } | |||
| private: | |||
| void valueTreePropertyChanged (ValueTree&, const Identifier& property) override | |||
| { | |||
| if (property == Ids::defaultJuceModulePath || property == Ids::defaultUserModulePath) | |||
| refresh(); | |||
| } | |||
| void valueChanged (Value& v) override | |||
| { | |||
| auto isExporterPathValue = [&] | |||
| auto isExporterPathValue = [this, &v] | |||
| { | |||
| for (auto& exporterValue : exporterModulePathValues) | |||
| if (exporterValue.refersToSameSourceAs (v)) | |||
| @@ -256,18 +263,11 @@ private: | |||
| if (isExporterPathValue) | |||
| project.rescanExporterPathModules(); | |||
| startTimer (50); | |||
| } | |||
| void timerCallback() override | |||
| { | |||
| stopTimer(); | |||
| refresh(); | |||
| } | |||
| //============================================================================== | |||
| Array<ValueWithDefault> exporterModulePathDefaultValues; | |||
| Array<Value> exporterModulePathValues, globalPathValues; | |||
| Array<Value> exporterModulePathValues; | |||
| Value useGlobalPathValue; | |||
| OwnedArray<Project::ConfigFlag> configFlags; | |||
| @@ -2001,7 +2001,7 @@ ValueTree Project::getConfigNode() | |||
| return projectRoot.getOrCreateChildWithName (Ids::JUCEOPTIONS, nullptr); | |||
| } | |||
| ValueWithDefault Project::getConfigFlag (const String& name) | |||
| ValueTreePropertyWithDefault Project::getConfigFlag (const String& name) | |||
| { | |||
| auto configNode = getConfigNode(); | |||
| @@ -243,7 +243,7 @@ public: | |||
| String getVSTNumMIDIInputsString() const { return pluginVSTNumMidiInputsValue.get(); } | |||
| String getVSTNumMIDIOutputsString() const { return pluginVSTNumMidiOutputsValue.get(); } | |||
| static bool checkMultiChoiceVar (const ValueWithDefault& valueToCheck, Identifier idToCheck) noexcept | |||
| static bool checkMultiChoiceVar (const ValueTreePropertyWithDefault& valueToCheck, Identifier idToCheck) noexcept | |||
| { | |||
| if (! valueToCheck.get().isArray()) | |||
| return false; | |||
| @@ -462,10 +462,10 @@ public: | |||
| struct ConfigFlag | |||
| { | |||
| String symbol, description, sourceModuleID; | |||
| ValueWithDefault value; | |||
| ValueTreePropertyWithDefault value; | |||
| }; | |||
| ValueWithDefault getConfigFlag (const String& name); | |||
| ValueTreePropertyWithDefault getConfigFlag (const String& name); | |||
| bool isConfigFlagEnabled (const String& name, bool defaultIsEnabled = false) const; | |||
| //============================================================================== | |||
| @@ -542,15 +542,15 @@ private: | |||
| //============================================================================== | |||
| ValueTree projectRoot { Ids::JUCERPROJECT }; | |||
| ValueWithDefault projectNameValue, projectUIDValue, projectLineFeedValue, projectTypeValue, versionValue, bundleIdentifierValue, companyNameValue, | |||
| companyCopyrightValue, companyWebsiteValue, companyEmailValue, displaySplashScreenValue, splashScreenColourValue, cppStandardValue, | |||
| headerSearchPathsValue, preprocessorDefsValue, userNotesValue, maxBinaryFileSizeValue, includeBinaryDataInJuceHeaderValue, binaryDataNamespaceValue, | |||
| compilerFlagSchemesValue, postExportShellCommandPosixValue, postExportShellCommandWinValue, useAppConfigValue, addUsingNamespaceToJuceHeader; | |||
| ValueTreePropertyWithDefault projectNameValue, projectUIDValue, projectLineFeedValue, projectTypeValue, versionValue, bundleIdentifierValue, companyNameValue, | |||
| companyCopyrightValue, companyWebsiteValue, companyEmailValue, displaySplashScreenValue, splashScreenColourValue, cppStandardValue, | |||
| headerSearchPathsValue, preprocessorDefsValue, userNotesValue, maxBinaryFileSizeValue, includeBinaryDataInJuceHeaderValue, binaryDataNamespaceValue, | |||
| compilerFlagSchemesValue, postExportShellCommandPosixValue, postExportShellCommandWinValue, useAppConfigValue, addUsingNamespaceToJuceHeader; | |||
| ValueWithDefault pluginFormatsValue, pluginNameValue, pluginDescriptionValue, pluginManufacturerValue, pluginManufacturerCodeValue, | |||
| pluginCodeValue, pluginChannelConfigsValue, pluginCharacteristicsValue, pluginAUExportPrefixValue, pluginAAXIdentifierValue, | |||
| pluginAUMainTypeValue, pluginAUSandboxSafeValue, pluginRTASCategoryValue, pluginVSTCategoryValue, pluginVST3CategoryValue, pluginAAXCategoryValue, | |||
| pluginVSTNumMidiInputsValue, pluginVSTNumMidiOutputsValue; | |||
| ValueTreePropertyWithDefault pluginFormatsValue, pluginNameValue, pluginDescriptionValue, pluginManufacturerValue, pluginManufacturerCodeValue, | |||
| pluginCodeValue, pluginChannelConfigsValue, pluginCharacteristicsValue, pluginAUExportPrefixValue, pluginAAXIdentifierValue, | |||
| pluginAUMainTypeValue, pluginAUSandboxSafeValue, pluginRTASCategoryValue, pluginVSTCategoryValue, pluginVST3CategoryValue, pluginAAXCategoryValue, | |||
| pluginVSTNumMidiInputsValue, pluginVSTNumMidiOutputsValue; | |||
| //============================================================================== | |||
| std::unique_ptr<EnabledModulesList> enabledModulesList; | |||
| @@ -90,15 +90,15 @@ public: | |||
| } | |||
| //============================================================================== | |||
| ValueWithDefault androidJavaLibs, androidAdditionalJavaFolders, androidAdditionalResourceFolders, androidProjectRepositories, | |||
| androidRepositories, androidDependencies, androidCustomAppBuildGradleContent, androidScreenOrientation, | |||
| androidCustomActivityClass, androidCustomApplicationClass, androidManifestCustomXmlElements, | |||
| androidGradleSettingsContent, androidVersionCode, androidMinimumSDK, androidTargetSDK, androidTheme, | |||
| androidExtraAssetsFolder, androidOboeRepositoryPath, androidInternetNeeded, androidMicNeeded, androidCameraNeeded, | |||
| androidBluetoothNeeded, androidExternalReadPermission, androidExternalWritePermission, | |||
| androidInAppBillingPermission, androidVibratePermission, androidOtherPermissions, androidPushNotifications, | |||
| androidEnableRemoteNotifications, androidRemoteNotificationsConfigFile, androidEnableContentSharing, androidKeyStore, | |||
| androidKeyStorePass, androidKeyAlias, androidKeyAliasPass, gradleVersion, gradleToolchain, androidPluginVersion; | |||
| ValueTreePropertyWithDefault androidJavaLibs, androidAdditionalJavaFolders, androidAdditionalResourceFolders, androidProjectRepositories, | |||
| androidRepositories, androidDependencies, androidCustomAppBuildGradleContent, androidScreenOrientation, | |||
| androidCustomActivityClass, androidCustomApplicationClass, androidManifestCustomXmlElements, | |||
| androidGradleSettingsContent, androidVersionCode, androidMinimumSDK, androidTargetSDK, androidTheme, | |||
| androidExtraAssetsFolder, androidOboeRepositoryPath, androidInternetNeeded, androidMicNeeded, androidCameraNeeded, | |||
| androidBluetoothNeeded, androidExternalReadPermission, androidExternalWritePermission, | |||
| androidInAppBillingPermission, androidVibratePermission, androidOtherPermissions, androidPushNotifications, | |||
| androidEnableRemoteNotifications, androidRemoteNotificationsConfigFile, androidEnableContentSharing, androidKeyStore, | |||
| androidKeyStorePass, androidKeyAlias, androidKeyAliasPass, gradleVersion, gradleToolchain, androidPluginVersion; | |||
| //============================================================================== | |||
| AndroidProjectExporter (Project& p, const ValueTree& t) | |||
| @@ -335,9 +335,9 @@ protected: | |||
| return "${ANDROID_ABI}"; | |||
| } | |||
| ValueWithDefault androidArchitectures, androidBuildConfigRemoteNotifsConfigFile, | |||
| androidAdditionalXmlValueResources, androidAdditionalDrawableResources, | |||
| androidAdditionalRawValueResources, androidCustomStringXmlElements; | |||
| ValueTreePropertyWithDefault androidArchitectures, androidBuildConfigRemoteNotifsConfigFile, | |||
| androidAdditionalXmlValueResources, androidAdditionalDrawableResources, | |||
| androidAdditionalRawValueResources, androidCustomStringXmlElements; | |||
| }; | |||
| BuildConfiguration::Ptr createBuildConfig (const ValueTree& v) const override | |||
| @@ -188,7 +188,7 @@ public: | |||
| } | |||
| private: | |||
| ValueWithDefault targetPlatformValue; | |||
| ValueTreePropertyWithDefault targetPlatformValue; | |||
| String getTargetPlatformString() const { return targetPlatformValue.get(); } | |||
| @@ -235,7 +235,7 @@ private: | |||
| String getArchitectureTypeString() const { return architectureTypeValue.get(); } | |||
| //============================================================================== | |||
| ValueWithDefault architectureTypeValue; | |||
| ValueTreePropertyWithDefault architectureTypeValue; | |||
| }; | |||
| BuildConfiguration::Ptr createBuildConfig (const ValueTree& tree) const override | |||
| @@ -310,12 +310,12 @@ public: | |||
| } | |||
| private: | |||
| ValueWithDefault warningLevelValue, warningsAreErrorsValue, prebuildCommandValue, postbuildCommandValue, generateDebugSymbolsValue, | |||
| generateManifestValue, enableIncrementalLinkingValue, useRuntimeLibDLLValue, multiProcessorCompilationValue, | |||
| intermediatesPathValue, characterSetValue, architectureTypeValue, fastMathValue, debugInformationFormatValue, | |||
| pluginBinaryCopyStepValue; | |||
| ValueTreePropertyWithDefault warningLevelValue, warningsAreErrorsValue, prebuildCommandValue, postbuildCommandValue, generateDebugSymbolsValue, | |||
| generateManifestValue, enableIncrementalLinkingValue, useRuntimeLibDLLValue, multiProcessorCompilationValue, | |||
| intermediatesPathValue, characterSetValue, architectureTypeValue, fastMathValue, debugInformationFormatValue, | |||
| pluginBinaryCopyStepValue; | |||
| ValueWithDefault vstBinaryLocation, vst3BinaryLocation, rtasBinaryLocation, aaxBinaryLocation, unityPluginBinaryLocation; | |||
| ValueTreePropertyWithDefault vstBinaryLocation, vst3BinaryLocation, rtasBinaryLocation, aaxBinaryLocation, unityPluginBinaryLocation; | |||
| Value architectureValueToListenTo; | |||
| @@ -1600,12 +1600,12 @@ protected: | |||
| mutable File rcFile, iconFile, packagesConfigFile; | |||
| OwnedArray<MSVCTargetBase> targets; | |||
| ValueWithDefault IPPLibraryValue, | |||
| IPP1ALibraryValue, | |||
| MKL1ALibraryValue, | |||
| platformToolsetValue, | |||
| targetPlatformVersion, | |||
| manifestFileValue; | |||
| ValueTreePropertyWithDefault IPPLibraryValue, | |||
| IPP1ALibraryValue, | |||
| MKL1ALibraryValue, | |||
| platformToolsetValue, | |||
| targetPlatformVersion, | |||
| manifestFileValue; | |||
| File getProjectFile (const String& extension, const String& target) const | |||
| { | |||
| @@ -107,7 +107,8 @@ protected: | |||
| private: | |||
| //============================================================================== | |||
| ValueWithDefault architectureTypeValue, pluginBinaryCopyStepValue, vstBinaryLocation, vst3BinaryLocation, unityPluginBinaryLocation; | |||
| ValueTreePropertyWithDefault architectureTypeValue, pluginBinaryCopyStepValue, | |||
| vstBinaryLocation, vst3BinaryLocation, unityPluginBinaryLocation; | |||
| }; | |||
| BuildConfiguration::Ptr createBuildConfig (const ValueTree& tree) const override | |||
| @@ -508,7 +509,7 @@ public: | |||
| } | |||
| private: | |||
| ValueWithDefault extraPkgConfigValue; | |||
| ValueTreePropertyWithDefault extraPkgConfigValue; | |||
| //============================================================================== | |||
| StringPairArray getDefines (const BuildConfiguration& config) const | |||
| @@ -887,11 +887,11 @@ protected: | |||
| //============================================================================== | |||
| bool iOS; | |||
| ValueWithDefault macOSBaseSDK, macOSDeploymentTarget, macOSArchitecture, iosBaseSDK, iosDeploymentTarget, | |||
| customXcodeFlags, plistPreprocessorDefinitions, codeSignIdentity, | |||
| fastMathEnabled, stripLocalSymbolsEnabled, pluginBinaryCopyStepEnabled, | |||
| vstBinaryLocation, vst3BinaryLocation, auBinaryLocation, rtasBinaryLocation, | |||
| aaxBinaryLocation, unityPluginBinaryLocation; | |||
| ValueTreePropertyWithDefault macOSBaseSDK, macOSDeploymentTarget, macOSArchitecture, iosBaseSDK, iosDeploymentTarget, | |||
| customXcodeFlags, plistPreprocessorDefinitions, codeSignIdentity, | |||
| fastMathEnabled, stripLocalSymbolsEnabled, pluginBinaryCopyStepEnabled, | |||
| vstBinaryLocation, vst3BinaryLocation, auBinaryLocation, rtasBinaryLocation, | |||
| aaxBinaryLocation, unityPluginBinaryLocation; | |||
| //============================================================================== | |||
| void valueTreePropertyChanged (ValueTree&, const Identifier& property) override | |||
| @@ -968,7 +968,9 @@ protected: | |||
| if (macOSArchitecture.get() == "default") | |||
| macOSArchitecture.resetToDefault(); | |||
| const auto updateSDKString = [this] (const Identifier& propertyName, ValueWithDefault& value, const String& suffix) | |||
| const auto updateSDKString = [this] (const Identifier& propertyName, | |||
| ValueTreePropertyWithDefault& value, | |||
| const String& suffix) | |||
| { | |||
| auto sdkString = config[propertyName].toString(); | |||
| @@ -3561,24 +3563,24 @@ private: | |||
| const bool iOS; | |||
| ValueWithDefault applicationCategoryValue, | |||
| customPListValue, pListPrefixHeaderValue, pListPreprocessValue, | |||
| subprojectsValue, | |||
| validArchsValue, | |||
| extraFrameworksValue, frameworkSearchPathsValue, extraCustomFrameworksValue, embeddedFrameworksValue, | |||
| postbuildCommandValue, prebuildCommandValue, | |||
| duplicateAppExResourcesFolderValue, iosDeviceFamilyValue, iPhoneScreenOrientationValue, | |||
| iPadScreenOrientationValue, customXcodeResourceFoldersValue, customXcassetsFolderValue, | |||
| appSandboxValue, appSandboxInheritanceValue, appSandboxOptionsValue, | |||
| hardenedRuntimeValue, hardenedRuntimeOptionsValue, | |||
| microphonePermissionNeededValue, microphonePermissionsTextValue, | |||
| cameraPermissionNeededValue, cameraPermissionTextValue, | |||
| bluetoothPermissionNeededValue, bluetoothPermissionTextValue, | |||
| sendAppleEventsPermissionNeededValue, sendAppleEventsPermissionTextValue, | |||
| uiFileSharingEnabledValue, uiSupportsDocumentBrowserValue, uiStatusBarHiddenValue, uiRequiresFullScreenValue, documentExtensionsValue, iosInAppPurchasesValue, | |||
| iosContentSharingValue, iosBackgroundAudioValue, iosBackgroundBleValue, iosPushNotificationsValue, iosAppGroupsValue, iCloudPermissionsValue, | |||
| networkingMulticastValue, iosDevelopmentTeamIDValue, iosAppGroupsIDValue, keepCustomXcodeSchemesValue, useHeaderMapValue, customLaunchStoryboardValue, | |||
| exporterBundleIdentifierValue, suppressPlistResourceUsageValue, useLegacyBuildSystemValue, buildNumber; | |||
| ValueTreePropertyWithDefault applicationCategoryValue, | |||
| customPListValue, pListPrefixHeaderValue, pListPreprocessValue, | |||
| subprojectsValue, | |||
| validArchsValue, | |||
| extraFrameworksValue, frameworkSearchPathsValue, extraCustomFrameworksValue, embeddedFrameworksValue, | |||
| postbuildCommandValue, prebuildCommandValue, | |||
| duplicateAppExResourcesFolderValue, iosDeviceFamilyValue, iPhoneScreenOrientationValue, | |||
| iPadScreenOrientationValue, customXcodeResourceFoldersValue, customXcassetsFolderValue, | |||
| appSandboxValue, appSandboxInheritanceValue, appSandboxOptionsValue, | |||
| hardenedRuntimeValue, hardenedRuntimeOptionsValue, | |||
| microphonePermissionNeededValue, microphonePermissionsTextValue, | |||
| cameraPermissionNeededValue, cameraPermissionTextValue, | |||
| bluetoothPermissionNeededValue, bluetoothPermissionTextValue, | |||
| sendAppleEventsPermissionNeededValue, sendAppleEventsPermissionTextValue, | |||
| uiFileSharingEnabledValue, uiSupportsDocumentBrowserValue, uiStatusBarHiddenValue, uiRequiresFullScreenValue, documentExtensionsValue, iosInAppPurchasesValue, | |||
| iosContentSharingValue, iosBackgroundAudioValue, iosBackgroundBleValue, iosPushNotificationsValue, iosAppGroupsValue, iCloudPermissionsValue, | |||
| networkingMulticastValue, iosDevelopmentTeamIDValue, iosAppGroupsIDValue, keepCustomXcodeSchemesValue, useHeaderMapValue, customLaunchStoryboardValue, | |||
| exporterBundleIdentifierValue, suppressPlistResourceUsageValue, useLegacyBuildSystemValue, buildNumber; | |||
| JUCE_DECLARE_NON_COPYABLE (XcodeProjectExporter) | |||
| }; | |||
| @@ -267,7 +267,7 @@ void ProjectExporter::createPropertyEditors (PropertyListBuilder& props) | |||
| if ((shouldBuildTargetType (build_tools::ProjectType::Target::VSTPlugIn) && project.shouldBuildVST()) || (project.isVSTPluginHost() && supportsTargetType (build_tools::ProjectType::Target::VSTPlugIn))) | |||
| { | |||
| props.add (new FilePathPropertyComponent (vstLegacyPathValueWrapper.getWrappedValueWithDefault(), "VST (Legacy) SDK Folder", true, | |||
| props.add (new FilePathPropertyComponent (vstLegacyPathValueWrapper.getWrappedValueTreePropertyWithDefault(), "VST (Legacy) SDK Folder", true, | |||
| getTargetOSForExporter() == TargetOS::getThisOS(), "*", project.getProjectFolder()), | |||
| "If you're building a VST plug-in or host, you can use this field to override the global VST (Legacy) SDK path with a project-specific path. " | |||
| "This can be an absolute path, or a path relative to the Projucer project file."); | |||
| @@ -275,14 +275,14 @@ void ProjectExporter::createPropertyEditors (PropertyListBuilder& props) | |||
| if (shouldBuildTargetType (build_tools::ProjectType::Target::AAXPlugIn) && project.shouldBuildAAX()) | |||
| { | |||
| props.add (new FilePathPropertyComponent (aaxPathValueWrapper.getWrappedValueWithDefault(), "AAX SDK Folder", true, | |||
| props.add (new FilePathPropertyComponent (aaxPathValueWrapper.getWrappedValueTreePropertyWithDefault(), "AAX SDK Folder", true, | |||
| getTargetOSForExporter() == TargetOS::getThisOS(), "*", project.getProjectFolder()), | |||
| "If you're building an AAX plug-in, this must be the folder containing the AAX SDK. This can be an absolute path, or a path relative to the Projucer project file."); | |||
| } | |||
| if (shouldBuildTargetType (build_tools::ProjectType::Target::RTASPlugIn) && project.shouldBuildRTAS()) | |||
| { | |||
| props.add (new FilePathPropertyComponent (rtasPathValueWrapper.getWrappedValueWithDefault(), "RTAS SDK Folder", true, | |||
| props.add (new FilePathPropertyComponent (rtasPathValueWrapper.getWrappedValueTreePropertyWithDefault(), "RTAS SDK Folder", true, | |||
| getTargetOSForExporter() == TargetOS::getThisOS(), "*", project.getProjectFolder()), | |||
| "If you're building an RTAS plug-in, this must be the folder containing the RTAS SDK. This can be an absolute path, or a path relative to the Projucer project file."); | |||
| } | |||
| @@ -295,7 +295,7 @@ void ProjectExporter::createPropertyEditors (PropertyListBuilder& props) | |||
| "Extra command-line flags to be passed to the compiler. This string can contain references to preprocessor definitions in the " | |||
| "form ${NAME_OF_DEFINITION}, which will be replaced with their values."); | |||
| for (HashMap<String, ValueWithDefault>::Iterator i (compilerFlagSchemesMap); i.next();) | |||
| for (HashMap<String, ValueTreePropertyWithDefault>::Iterator i (compilerFlagSchemesMap); i.next();) | |||
| props.add (new TextPropertyComponent (compilerFlagSchemesMap.getReference (i.getKey()), "Compiler Flags for " + i.getKey().quoted(), 8192, false), | |||
| "The exporter-specific compiler flags that will be added to files using this scheme."); | |||
| @@ -560,7 +560,7 @@ static var getStoredPathForModule (const String& id, const ProjectExporter& exp) | |||
| exp.getTargetOSForExporter()).get(); | |||
| } | |||
| ValueWithDefault ProjectExporter::getPathForModuleValue (const String& moduleID) | |||
| ValueTreePropertyWithDefault ProjectExporter::getPathForModuleValue (const String& moduleID) | |||
| { | |||
| auto* um = getUndoManager(); | |||
| @@ -909,20 +909,22 @@ void ProjectExporter::BuildConfiguration::addGCCOptimisationProperty (PropertyLi | |||
| void ProjectExporter::BuildConfiguration::addRecommendedLinuxCompilerWarningsProperty (PropertyListBuilder& props) | |||
| { | |||
| recommendedWarningsValue.setDefault (""); | |||
| props.add (new ChoicePropertyComponent (recommendedWarningsValue, "Add Recommended Compiler Warning Flags", | |||
| { CompilerNames::gcc, CompilerNames::llvm, "Disabled" }, | |||
| { CompilerNames::gcc, CompilerNames::llvm, "" }), | |||
| "Enable this to add a set of recommended compiler warning flags."); | |||
| recommendedWarningsValue.setDefault (""); | |||
| } | |||
| void ProjectExporter::BuildConfiguration::addRecommendedLLVMCompilerWarningsProperty (PropertyListBuilder& props) | |||
| { | |||
| recommendedWarningsValue.setDefault (""); | |||
| props.add (new ChoicePropertyComponent (recommendedWarningsValue, "Add Recommended Compiler Warning Flags", | |||
| { "Enabled", "Disabled" }, | |||
| { CompilerNames::llvm, "" }), | |||
| "Enable this to add a set of recommended compiler warning flags."); | |||
| recommendedWarningsValue.setDefault (""); | |||
| } | |||
| ProjectExporter::BuildConfiguration::CompilerWarningFlags ProjectExporter::BuildConfiguration::getRecommendedCompilerWarningFlags() const | |||
| @@ -27,7 +27,7 @@ | |||
| #include "../Project/jucer_Project.h" | |||
| #include "../Utility/UI/PropertyComponents/jucer_PropertyComponentsWithEnablement.h" | |||
| #include "../Utility/Helpers/jucer_ValueWithDefaultWrapper.h" | |||
| #include "../Utility/Helpers/jucer_ValueTreePropertyWithDefaultWrapper.h" | |||
| #include "../Project/Modules/jucer_Modules.h" | |||
| class ProjectSaver; | |||
| @@ -157,7 +157,7 @@ public: | |||
| // NB: this is the path to the parent "modules" folder that contains the named module, not the | |||
| // module folder itself. | |||
| ValueWithDefault getPathForModuleValue (const String& moduleID); | |||
| ValueTreePropertyWithDefault getPathForModuleValue (const String& moduleID); | |||
| String getPathForModuleString (const String& moduleID) const; | |||
| void removePathForModule (const String& moduleID); | |||
| @@ -306,9 +306,9 @@ public: | |||
| const ProjectExporter& exporter; | |||
| protected: | |||
| ValueWithDefault isDebugValue, configNameValue, targetNameValue, targetBinaryPathValue, recommendedWarningsValue, optimisationLevelValue, | |||
| linkTimeOptimisationValue, ppDefinesValue, headerSearchPathValue, librarySearchPathValue, userNotesValue, | |||
| usePrecompiledHeaderFileValue, precompiledHeaderFileValue; | |||
| ValueTreePropertyWithDefault isDebugValue, configNameValue, targetNameValue, targetBinaryPathValue, recommendedWarningsValue, optimisationLevelValue, | |||
| linkTimeOptimisationValue, ppDefinesValue, headerSearchPathValue, librarySearchPathValue, userNotesValue, | |||
| usePrecompiledHeaderFileValue, precompiledHeaderFileValue; | |||
| private: | |||
| std::map<String, CompilerWarningFlags> recommendedCompilerWarningFlags; | |||
| @@ -409,13 +409,13 @@ protected: | |||
| const File projectFolder; | |||
| //============================================================================== | |||
| ValueWithDefaultWrapper vstLegacyPathValueWrapper, rtasPathValueWrapper, aaxPathValueWrapper; | |||
| ValueTreePropertyWithDefaultWrapper vstLegacyPathValueWrapper, rtasPathValueWrapper, aaxPathValueWrapper; | |||
| ValueWithDefault targetLocationValue, extraCompilerFlagsValue, extraLinkerFlagsValue, externalLibrariesValue, | |||
| userNotesValue, gnuExtensionsValue, bigIconValue, smallIconValue, extraPPDefsValue; | |||
| ValueTreePropertyWithDefault targetLocationValue, extraCompilerFlagsValue, extraLinkerFlagsValue, externalLibrariesValue, | |||
| userNotesValue, gnuExtensionsValue, bigIconValue, smallIconValue, extraPPDefsValue; | |||
| Value projectCompilerFlagSchemesValue; | |||
| HashMap<String, ValueWithDefault> compilerFlagSchemesMap; | |||
| HashMap<String, ValueTreePropertyWithDefault> compilerFlagSchemesMap; | |||
| mutable Array<Project::Item> itemGroups; | |||
| Project::Item* modulesGroup = nullptr; | |||
| @@ -454,10 +454,16 @@ static Identifier identifierForOS (DependencyPathOS os) noexcept | |||
| return {}; | |||
| } | |||
| ValueWithDefault StoredSettings::getStoredPath (const Identifier& key, DependencyPathOS os) | |||
| ValueTreePropertyWithDefault StoredSettings::getStoredPath (const Identifier& key, DependencyPathOS os) | |||
| { | |||
| auto tree = (os == TargetOS::getThisOS() ? projectDefaults | |||
| : fallbackPaths.getOrCreateChildWithName (identifierForOS (os), nullptr)); | |||
| return { tree, key, nullptr, getFallbackPathForOS (key, os) }; | |||
| } | |||
| void StoredSettings::addProjectDefaultsListener (ValueTree::Listener& l) { projectDefaults.addListener (&l); } | |||
| void StoredSettings::removeProjectDefaultsListener (ValueTree::Listener& l) { projectDefaults.removeListener (&l); } | |||
| void StoredSettings::addFallbackPathsListener (ValueTree::Listener& l) { fallbackPaths.addListener (&l); } | |||
| void StoredSettings::removeFallbackPathsListener (ValueTree::Listener& l) { fallbackPaths.removeListener (&l); } | |||
| @@ -61,7 +61,13 @@ public: | |||
| }; | |||
| //============================================================================== | |||
| ValueWithDefault getStoredPath (const Identifier& key, DependencyPathOS os); | |||
| void addProjectDefaultsListener (ValueTree::Listener&); | |||
| void removeProjectDefaultsListener (ValueTree::Listener&); | |||
| void addFallbackPathsListener (ValueTree::Listener&); | |||
| void removeFallbackPathsListener (ValueTree::Listener&); | |||
| ValueTreePropertyWithDefault getStoredPath (const Identifier& key, DependencyPathOS os); | |||
| bool isJUCEPathIncorrect(); | |||
| //============================================================================== | |||
| @@ -91,13 +91,17 @@ struct PropertyListBuilder | |||
| add (propertyComp); | |||
| } | |||
| void addSearchPathProperty (const Value& value, const String& name, const String& mainHelpText) | |||
| void addSearchPathProperty (const Value& value, | |||
| const String& name, | |||
| const String& mainHelpText) | |||
| { | |||
| add (new TextPropertyComponent (value, name, 16384, true), | |||
| mainHelpText + " Use semi-colons or new-lines to separate multiple paths."); | |||
| } | |||
| void addSearchPathProperty (ValueWithDefault& value, const String& name, const String& mainHelpText) | |||
| void addSearchPathProperty (const ValueTreePropertyWithDefault& value, | |||
| const String& name, | |||
| const String& mainHelpText) | |||
| { | |||
| add (new TextPropertyComponent (value, name, 16384, true), | |||
| mainHelpText + " Use semi-colons or new-lines to separate multiple paths."); | |||
| @@ -28,16 +28,18 @@ | |||
| //============================================================================== | |||
| /** | |||
| Wraps a ValueWithDefault object that has a default which depends on a global value. | |||
| Wraps a ValueTreePropertyWithDefault object that has a default which depends on a global value. | |||
| */ | |||
| class ValueWithDefaultWrapper : private Value::Listener | |||
| class ValueTreePropertyWithDefaultWrapper : private Value::Listener | |||
| { | |||
| public: | |||
| ValueWithDefaultWrapper() = default; | |||
| ValueTreePropertyWithDefaultWrapper() = default; | |||
| void init (const ValueWithDefault& vwd, ValueWithDefault global, TargetOS::OS targetOS) | |||
| void init (const ValueTreePropertyWithDefault& v, | |||
| ValueTreePropertyWithDefault global, | |||
| TargetOS::OS targetOS) | |||
| { | |||
| wrappedValue = vwd; | |||
| wrappedValue = v; | |||
| globalValue = global.getPropertyAsValue(); | |||
| globalIdentifier = global.getPropertyID(); | |||
| os = targetOS; | |||
| @@ -49,7 +51,7 @@ public: | |||
| valueChanged (globalValue); | |||
| } | |||
| ValueWithDefault& getWrappedValueWithDefault() | |||
| ValueTreePropertyWithDefault& getWrappedValueTreePropertyWithDefault() | |||
| { | |||
| return wrappedValue; | |||
| } | |||
| @@ -65,7 +67,7 @@ private: | |||
| wrappedValue.setDefault (getAppSettings().getStoredPath (globalIdentifier, os).get()); | |||
| } | |||
| ValueWithDefault wrappedValue; | |||
| ValueTreePropertyWithDefault wrappedValue; | |||
| Value globalValue; | |||
| Identifier globalIdentifier; | |||