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

Introjucer: minor internal changes.

This commit is contained in:
jules 2012-04-24 13:34:37 +01:00
parent 7d4bbd114a
commit 54bdb48972
5 changed files with 47 additions and 15 deletions

View file

@ -82,6 +82,7 @@ public:
#endif
}
bool isAndroid() const { return true; }
bool isPossibleForCurrentProject() { return projectType.isGUIApplication(); }
bool usesMMFiles() const { return false; }
bool canCopeWithDuplicateFiles() { return false; }

View file

@ -64,6 +64,7 @@ public:
virtual int getVisualStudioVersion() const { return 0; }
virtual bool isLinux() const { return false; }
virtual bool isOSX() const { return false; }
virtual bool isAndroid() const { return false; }
//==============================================================================
String getName() const { return name; }

View file

@ -582,16 +582,23 @@ void LibraryModule::getConfigFlags (Project& project, OwnedArray<Project::Config
}
//==============================================================================
static bool exporterTargetMatches (const String& test, String target)
{
target = target.trim();
if (target.startsWithChar ('!'))
return ! exporterTargetMatches (test, target.substring (1).trimStart());
return target == test || target.isEmpty();
}
bool LibraryModule::fileTargetMatches (ProjectExporter& exporter, const String& target)
{
if (target.startsWithChar ('!'))
return ! fileTargetMatches (exporter, target.substring (1).trim());
if (target == "xcode") return exporter.isXcode();
if (target == "msvc") return exporter.isVisualStudio();
if (target == "linux") return exporter.isLinux();
return true;
if (exporter.isXcode()) return exporterTargetMatches ("xcode", target);
if (exporter.isVisualStudio()) return exporterTargetMatches ("msvc", target);
if (exporter.isLinux()) return exporterTargetMatches ("linux", target);
if (exporter.isAndroid()) return exporterTargetMatches ("android", target);
return target.isEmpty();
}
void LibraryModule::findWildcardMatches (const File& localModuleFolder, const String& wildcardPath, Array<File>& result) const
@ -643,6 +650,35 @@ void LibraryModule::findAndAddCompiledCode (ProjectExporter& exporter, ProjectSa
}
}
void LibraryModule::getLocalCompiledFiles (Array<File>& result) const
{
const var compileArray (moduleInfo ["compile"]); // careful to keep this alive while the array is in use!
const Array<var>* const files = compileArray.getArray();
if (files != nullptr)
{
for (int i = 0; i < files->size(); ++i)
{
const var& file = files->getReference(i);
const String filename (file ["file"].toString());
if (filename.isNotEmpty()
#if JUCE_MAC
&& exporterTargetMatches ("xcode", file ["target"].toString())
#elif JUCE_WINDOWS
&& exporterTargetMatches ("msvc", file ["target"].toString())
#elif JUCE_LINUX
&& exporterTargetMatches ("linux", file ["target"].toString())
#endif
)
{
const File compiledFile (moduleFolder.getChildFile (filename));
result.add (compiledFile);
}
}
}
}
static void addFileWithGroups (Project::Item& group, const RelativePath& file, const String& path)
{
const int slash = path.indexOfChar (File::separator);

View file

@ -50,6 +50,7 @@ public:
void prepareExporter (ProjectExporter&, ProjectSaver&) const;
void createPropertyEditors (ProjectExporter&, PropertyListBuilder&) const;
void getConfigFlags (Project&, OwnedArray<Project::ConfigFlag>& flags) const;
void getLocalCompiledFiles (Array<File>& files) const;
static String getInfoFileName() { return "juce_module_info"; }

View file

@ -115,13 +115,6 @@ void Project::setMissingDefaultValues()
moveOldPropertyFromProjectToAllExporters (Ids::bigIcon);
moveOldPropertyFromProjectToAllExporters (Ids::smallIcon);
for (Project::ExporterIterator exporter (*this); exporter.next();)
if (exporter->getNumConfigurations() == 0)
exporter->createDefaultConfigs();
if (! projectRoot.getChildWithName (Tags::exporters).isValid())
createDefaultExporters();
getProjectType().setMissingProjectProperties (*this);
if (! projectRoot.hasProperty (Ids::bundleIdentifier))