1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-14 00:14:18 +00:00

Introjucer: checking for out-of-date introjucer binary.

This commit is contained in:
jules 2013-06-03 22:39:21 +01:00
parent 14ec53de2e
commit d47ac98318
4 changed files with 50 additions and 1 deletions

View file

@ -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")