diff --git a/extras/Projucer/Source/Application/jucer_Application.cpp b/extras/Projucer/Source/Application/jucer_Application.cpp index 32b3a0f431..666614dfbc 100644 --- a/extras/Projucer/Source/Application/jucer_Application.cpp +++ b/extras/Projucer/Source/Application/jucer_Application.cpp @@ -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); diff --git a/extras/Projucer/Source/Application/jucer_Application.h b/extras/Projucer/Source/Application/jucer_Application.h index 56cf53d727..e08a847551 100644 --- a/extras/Projucer/Source/Application/jucer_Application.h +++ b/extras/Projucer/Source/Application/jucer_Application.h @@ -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(); }; diff --git a/extras/Projucer/Source/Application/jucer_MainWindow.cpp b/extras/Projucer/Source/Application/jucer_MainWindow.cpp index 3980a41265..1fe39637d2 100644 --- a/extras/Projucer/Source/Application/jucer_MainWindow.cpp +++ b/extras/Projucer/Source/Application/jucer_MainWindow.cpp @@ -202,6 +202,9 @@ bool MainWindow::openFile (const File& file) jassert (getProjectContentComponent() != nullptr); getProjectContentComponent()->reloadLastOpenDocuments(); + if (Project* p = getProject()) + p->updateDeprecatedProjectSettingsInteractively(); + return true; } } diff --git a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_XCode.h b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_XCode.h index 08a0acaaa2..db26b2ac58 100644 --- a/extras/Projucer/Source/Project Saving/jucer_ProjectExport_XCode.h +++ b/extras/Projucer/Source/Project Saving/jucer_ProjectExport_XCode.h @@ -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 diff --git a/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.cpp b/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.cpp index 5f2e7c2175..d26a9a73dd 100644 --- a/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.cpp +++ b/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.cpp @@ -189,6 +189,8 @@ ProjectExporter::~ProjectExporter() { } +void ProjectExporter::updateDeprecatedProjectSettingsInteractively() {} + File ProjectExporter::getTargetFolder() const { return project.resolveFilename (getTargetLocationString()); diff --git a/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.h b/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.h index 3c8059648b..b99519ded2 100644 --- a/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.h +++ b/extras/Projucer/Source/Project Saving/jucer_ProjectExporter.h @@ -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; diff --git a/extras/Projucer/Source/Project/jucer_Project.cpp b/extras/Projucer/Source/Project/jucer_Project.cpp index dd6371f4ae..5afccc1e76 100644 --- a/extras/Projucer/Source/Project/jucer_Project.cpp +++ b/extras/Projucer/Source/Project/jucer_Project.cpp @@ -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()) diff --git a/extras/Projucer/Source/Project/jucer_Project.h b/extras/Projucer/Source/Project/jucer_Project.h index 0c9f31ff3a..4fa42e7779 100644 --- a/extras/Projucer/Source/Project/jucer_Project.h +++ b/extras/Projucer/Source/Project/jucer_Project.h @@ -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