Browse Source

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

tags/2021-05-28
jules 12 years ago
parent
commit
d47ac98318
4 changed files with 50 additions and 1 deletions
  1. +1
    -1
      README.txt
  2. +9
    -0
      extras/Introjucer/Source/Application/jucer_Application.h
  3. +39
    -0
      extras/Introjucer/Source/Project/jucer_Module.cpp
  4. +1
    -0
      extras/Introjucer/Source/Project/jucer_Module.h

+ 1
- 1
README.txt View File

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

+ 9
- 0
extras/Introjucer/Source/Application/jucer_Application.h View File

@@ -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;
}


+ 39
- 0
extras/Introjucer/Source/Project/jucer_Module.cpp 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")


+ 1
- 0
extras/Introjucer/Source/Project/jucer_Module.h View File

@@ -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…
Cancel
Save