| @@ -115,15 +115,8 @@ void ProjucerApplication::initialise (const String& commandLine) | |||
| settings->appearance.refreshPresetSchemeList(); | |||
| initialiseWindows (commandLine); | |||
| #if JUCE_MAC | |||
| MenuBarModel::setMacMainMenu (menuModel, nullptr, "Open Recent"); | |||
| #endif | |||
| versionChecker = new LatestVersionChecker(); | |||
| showLoginFormAsyncIfNotTriedRecently(); | |||
| // do further initialisation in a moment when the message loop has started | |||
| triggerAsyncUpdate(); | |||
| } | |||
| } | |||
| @@ -171,9 +164,22 @@ bool ProjucerApplication::initialiseLogger (const char* filePrefix) | |||
| return logger != nullptr; | |||
| } | |||
| void ProjucerApplication::handleAsyncUpdate() | |||
| { | |||
| initialiseWindows (getCommandLineParameters()); | |||
| #if JUCE_MAC | |||
| MenuBarModel::setMacMainMenu (menuModel, nullptr, "Open Recent"); | |||
| #endif | |||
| versionChecker = new LatestVersionChecker(); | |||
| showLoginFormAsyncIfNotTriedRecently(); | |||
| } | |||
| void ProjucerApplication::initialiseWindows (const String& commandLine) | |||
| { | |||
| const String commandLineWithoutNSDebug (commandLine.replace ("-NSDocumentRevisionsDebugMode YES", "")); | |||
| const String commandLineWithoutNSDebug (commandLine.replace ("-NSDocumentRevisionsDebugMode YES", StringRef())); | |||
| if (commandLineWithoutNSDebug.trim().isNotEmpty() && ! commandLineWithoutNSDebug.trim().startsWithChar ('-')) | |||
| anotherInstanceStarted (commandLine); | |||
| @@ -34,7 +34,8 @@ struct ChildProcessCache; | |||
| //============================================================================== | |||
| class ProjucerApplication : public JUCEApplication, | |||
| private Timer | |||
| private Timer, | |||
| private AsyncUpdater | |||
| { | |||
| public: | |||
| ProjucerApplication(); | |||
| @@ -134,6 +135,7 @@ private: | |||
| void showLoginFormAsyncIfNotTriedRecently(); | |||
| void timerCallback() override; | |||
| void handleAsyncUpdate() override; | |||
| void initCommandManager(); | |||
| }; | |||
| @@ -202,6 +202,9 @@ bool MainWindow::openFile (const File& file) | |||
| jassert (getProjectContentComponent() != nullptr); | |||
| getProjectContentComponent()->reloadLastOpenDocuments(); | |||
| if (Project* p = getProject()) | |||
| p->updateDeprecatedProjectSettingsInteractively(); | |||
| return true; | |||
| } | |||
| } | |||
| @@ -307,6 +307,24 @@ public: | |||
| jassert (targets.size() > 0); | |||
| } | |||
| void updateDeprecatedProjectSettingsInteractively() override | |||
| { | |||
| // check for an old version of the script from the Introjucer | |||
| if (MD5::fromUTF32 (getPostBuildScript()).toHexString() == "265ac212a7e734c5bbd6150e1eae18a1") | |||
| { | |||
| String alertWindowText = iOS ? "Your Xcode (iOS) Exporter settings use an invalid post-build script. Click 'Update' to remove it." | |||
| : "Your Xcode (OSX) Exporter settings use a pre-JUCE 4.2 post-build script to move the plug-in binaries to their plug-in install folders.\n\n" | |||
| "Since JUCE 4.2, this is instead done using \"AU/VST/VST2/AAX/RTAS Binary Location\" in the Xcode (OS X) configuration settings.\n\n" | |||
| "Click 'Update' to remove the script (otherwise your plug-in may not compile correctly)."; | |||
| if (AlertWindow::showOkCancelBox (AlertWindow::WarningIcon, | |||
| "Project settings: " + project.getDocumentTitle(), | |||
| alertWindowText, "Update", "Cancel", | |||
| nullptr, nullptr)) | |||
| getPostBuildScriptValue() = Value(); | |||
| } | |||
| } | |||
| protected: | |||
| //============================================================================== | |||
| class XcodeBuildConfiguration : public BuildConfiguration | |||
| @@ -189,6 +189,8 @@ ProjectExporter::~ProjectExporter() | |||
| { | |||
| } | |||
| void ProjectExporter::updateDeprecatedProjectSettingsInteractively() {} | |||
| File ProjectExporter::getTargetFolder() const | |||
| { | |||
| return project.resolveFilename (getTargetLocationString()); | |||
| @@ -67,6 +67,7 @@ public: | |||
| virtual bool shouldFileBeCompiledByDefault (const RelativePath& path) const; | |||
| virtual bool canCopeWithDuplicateFiles() = 0; | |||
| virtual bool supportsUserDefinedConfigurations() const = 0; // false if exporter only supports two configs Debug and Release | |||
| virtual void updateDeprecatedProjectSettingsInteractively(); | |||
| // IDE targeted by exporter | |||
| virtual bool isXcode() const = 0; | |||
| @@ -133,35 +133,42 @@ void Project::setMissingDefaultValues() | |||
| ProjucerApplication::getApp().updateNewlyOpenedProject (*this); | |||
| } | |||
| void Project::updateDeprecatedProjectSettingsInteractively() | |||
| { | |||
| jassert (! ProjucerApplication::getApp().isRunningCommandLine); | |||
| for (Project::ExporterIterator exporter (*this); exporter.next();) | |||
| exporter->updateDeprecatedProjectSettingsInteractively(); | |||
| } | |||
| void Project::setMissingAudioPluginDefaultValues() | |||
| { | |||
| const String sanitisedProjectName (CodeHelpers::makeValidIdentifier (getTitle(), false, true, false)); | |||
| setValueIfVoid (shouldBuildVST(), true); | |||
| setValueIfVoid (shouldBuildVST3(), false); | |||
| setValueIfVoid (shouldBuildAU(), true); | |||
| setValueIfVoid (shouldBuildAUv3(), false); | |||
| setValueIfVoid (shouldBuildRTAS(), false); | |||
| setValueIfVoid (shouldBuildAAX(), false); | |||
| setValueIfVoid (shouldBuildStandalone(), false); | |||
| setValueIfVoid (getPluginName(), getTitle()); | |||
| setValueIfVoid (getPluginDesc(), getTitle()); | |||
| setValueIfVoid (getPluginManufacturer(), "yourcompany"); | |||
| setValueIfVoid (getPluginManufacturerCode(), "Manu"); | |||
| setValueIfVoid (getPluginCode(), makeValid4CC (getProjectUID() + getProjectUID())); | |||
| setValueIfVoid (getPluginChannelConfigs(), ""); | |||
| setValueIfVoid (getPluginIsSynth(), false); | |||
| setValueIfVoid (getPluginWantsMidiInput(), false); | |||
| setValueIfVoid (getPluginProducesMidiOut(), false); | |||
| setValueIfVoid (getPluginIsMidiEffectPlugin(), false); | |||
| setValueIfVoid (getPluginEditorNeedsKeyFocus(), false); | |||
| setValueIfVoid (getPluginAUExportPrefix(), sanitisedProjectName + "AU"); | |||
| setValueIfVoid (getPluginRTASCategory(), String::empty); | |||
| setValueIfVoid (getBundleIdentifier(), getDefaultBundleIdentifier()); | |||
| setValueIfVoid (getAAXIdentifier(), getDefaultAAXIdentifier()); | |||
| setValueIfVoid (getPluginAAXCategory(), "AAX_ePlugInCategory_Dynamics"); | |||
| setValueIfVoid (shouldBuildVST(), true); | |||
| setValueIfVoid (shouldBuildVST3(), false); | |||
| setValueIfVoid (shouldBuildAU(), true); | |||
| setValueIfVoid (shouldBuildAUv3(), false); | |||
| setValueIfVoid (shouldBuildRTAS(), false); | |||
| setValueIfVoid (shouldBuildAAX(), false); | |||
| setValueIfVoid (shouldBuildStandalone(), false); | |||
| setValueIfVoid (getPluginName(), getTitle()); | |||
| setValueIfVoid (getPluginDesc(), getTitle()); | |||
| setValueIfVoid (getPluginManufacturer(), "yourcompany"); | |||
| setValueIfVoid (getPluginManufacturerCode(), "Manu"); | |||
| setValueIfVoid (getPluginCode(), makeValid4CC (getProjectUID() + getProjectUID())); | |||
| setValueIfVoid (getPluginChannelConfigs(), String()); | |||
| setValueIfVoid (getPluginIsSynth(), false); | |||
| setValueIfVoid (getPluginWantsMidiInput(), false); | |||
| setValueIfVoid (getPluginProducesMidiOut(), false); | |||
| setValueIfVoid (getPluginIsMidiEffectPlugin(), false); | |||
| setValueIfVoid (getPluginEditorNeedsKeyFocus(), false); | |||
| setValueIfVoid (getPluginAUExportPrefix(), sanitisedProjectName + "AU"); | |||
| setValueIfVoid (getPluginRTASCategory(), String()); | |||
| setValueIfVoid (getBundleIdentifier(), getDefaultBundleIdentifier()); | |||
| setValueIfVoid (getAAXIdentifier(), getDefaultAAXIdentifier()); | |||
| setValueIfVoid (getPluginAAXCategory(), "AAX_ePlugInCategory_Dynamics"); | |||
| } | |||
| void Project::updateOldStyleConfigList() | |||
| @@ -371,7 +378,7 @@ void Project::valueTreeParentChanged (ValueTree&) {} | |||
| File Project::resolveFilename (String filename) const | |||
| { | |||
| if (filename.isEmpty()) | |||
| return File::nonexistent; | |||
| return File(); | |||
| filename = replacePreprocessorDefs (getPreprocessorDefs(), filename); | |||
| @@ -741,7 +748,7 @@ File Project::Item::getFile() const | |||
| if (isFile()) | |||
| return project.resolveFilename (state [Ids::file].toString()); | |||
| return File::nonexistent; | |||
| return File(); | |||
| } | |||
| void Project::Item::setFile (const File& file) | |||
| @@ -955,7 +962,7 @@ Project::Item Project::Item::addNewSubGroup (const String& name, int insertIndex | |||
| bool Project::Item::addFileAtIndex (const File& file, int insertIndex, const bool shouldCompile) | |||
| { | |||
| if (file == File::nonexistent || file.isHidden() || file.getFileName().startsWithChar ('.')) | |||
| if (file == File() || file.isHidden() || file.getFileName().startsWithChar ('.')) | |||
| return false; | |||
| if (file.isDirectory()) | |||
| @@ -36,7 +36,7 @@ class Project : public FileBasedDocument, | |||
| { | |||
| public: | |||
| //============================================================================== | |||
| Project (const File& file); | |||
| Project (const File&); | |||
| ~Project(); | |||
| //============================================================================== | |||
| @@ -157,6 +157,7 @@ public: | |||
| bool isVSTPluginHost(); | |||
| bool isVST3PluginHost(); | |||
| void updateDeprecatedProjectSettingsInteractively(); | |||
| //============================================================================== | |||
| class Item | |||