mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Introjucer: checking for out-of-date introjucer binary.
This commit is contained in:
parent
14ec53de2e
commit
d47ac98318
4 changed files with 50 additions and 1 deletions
|
|
@ -8,4 +8,4 @@ most applications, and is particularly well-suited for building
|
|||
highly-customised GUIs, and for handling graphics and sound.
|
||||
|
||||
For more information, visit the website:
|
||||
http://www.rawmaterialsoftware.com
|
||||
http://www.juce.com
|
||||
|
|
@ -472,6 +472,15 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
if (ModuleList().isLibraryNewerThanIntrojucer())
|
||||
{
|
||||
AlertWindow::showMessageBox (AlertWindow::WarningIcon,
|
||||
"Introjucer",
|
||||
"This version of the introjucer is out-of-date!"
|
||||
"\n\n"
|
||||
"Always make sure that you're running the very latest version, preferably compiled directly from the juce tree that you're working with!");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -73,6 +73,45 @@ bool ModuleList::isLocalModulesFolderValid()
|
|||
return isModulesFolder (getModulesFolderForJuceOrModulesFolder (getLocalModulesFolder (nullptr)));
|
||||
}
|
||||
|
||||
static int getVersionElement (const String& v, int index)
|
||||
{
|
||||
StringArray parts;
|
||||
parts.addTokens (v, "., ", String::empty);
|
||||
|
||||
return parts [parts.size() - index - 1].getIntValue();
|
||||
}
|
||||
|
||||
static int getJuceVersion (const String& v)
|
||||
{
|
||||
return getVersionElement (v, 2) * 100000
|
||||
+ getVersionElement (v, 1) * 1000
|
||||
+ getVersionElement (v, 0);
|
||||
}
|
||||
|
||||
static int getBuiltJuceVersion()
|
||||
{
|
||||
return JUCE_MAJOR_VERSION * 100000
|
||||
+ JUCE_MINOR_VERSION * 1000
|
||||
+ JUCE_BUILDNUMBER;
|
||||
}
|
||||
|
||||
bool ModuleList::isLibraryNewerThanIntrojucer()
|
||||
{
|
||||
ModuleList list;
|
||||
list.rescan (getModulesFolderForJuceOrModulesFolder (getLocalModulesFolder (nullptr)));
|
||||
|
||||
for (int i = list.modules.size(); --i >= 0;)
|
||||
{
|
||||
const Module* m = list.modules.getUnchecked(i);
|
||||
|
||||
if (m->uid.startsWith ("juce_")
|
||||
&& getJuceVersion (m->version) > getBuiltJuceVersion())
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ModuleList::isJuceFolder (const File& folder)
|
||||
{
|
||||
return folder.getFileName().containsIgnoreCase ("juce")
|
||||
|
|
|
|||
|
|
@ -129,6 +129,7 @@ public:
|
|||
|
||||
static File getDefaultModulesFolder (Project*);
|
||||
static bool isLocalModulesFolderValid();
|
||||
static bool isLibraryNewerThanIntrojucer();
|
||||
|
||||
static File getLocalModulesFolder (Project*);
|
||||
static void setLocalModulesFolder (const File& newFile);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue