Browse Source

Introjucer: minor internal changes.

tags/2021-05-28
jules 13 years ago
parent
commit
54bdb48972
5 changed files with 45 additions and 13 deletions
  1. +1
    -0
      extras/Introjucer/Source/Project Saving/jucer_ProjectExport_Android.h
  2. +1
    -0
      extras/Introjucer/Source/Project Saving/jucer_ProjectExporter.h
  3. +42
    -6
      extras/Introjucer/Source/Project/jucer_Module.cpp
  4. +1
    -0
      extras/Introjucer/Source/Project/jucer_Module.h
  5. +0
    -7
      extras/Introjucer/Source/Project/jucer_Project.cpp

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

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


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

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


+ 42
- 6
extras/Introjucer/Source/Project/jucer_Module.cpp View File

@@ -582,16 +582,23 @@ void LibraryModule::getConfigFlags (Project& project, OwnedArray<Project::Config
} }
//============================================================================== //==============================================================================
bool LibraryModule::fileTargetMatches (ProjectExporter& exporter, const String& target)
static bool exporterTargetMatches (const String& test, String target)
{ {
target = target.trim();
if (target.startsWithChar ('!')) if (target.startsWithChar ('!'))
return ! fileTargetMatches (exporter, target.substring (1).trim());
return ! exporterTargetMatches (test, target.substring (1).trimStart());
if (target == "xcode") return exporter.isXcode();
if (target == "msvc") return exporter.isVisualStudio();
if (target == "linux") return exporter.isLinux();
return target == test || target.isEmpty();
}
return true;
bool LibraryModule::fileTargetMatches (ProjectExporter& exporter, const String& target)
{
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 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) static void addFileWithGroups (Project::Item& group, const RelativePath& file, const String& path)
{ {
const int slash = path.indexOfChar (File::separator); const int slash = path.indexOfChar (File::separator);


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

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


+ 0
- 7
extras/Introjucer/Source/Project/jucer_Project.cpp View File

@@ -115,13 +115,6 @@ void Project::setMissingDefaultValues()
moveOldPropertyFromProjectToAllExporters (Ids::bigIcon); moveOldPropertyFromProjectToAllExporters (Ids::bigIcon);
moveOldPropertyFromProjectToAllExporters (Ids::smallIcon); 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); getProjectType().setMissingProjectProperties (*this);
if (! projectRoot.hasProperty (Ids::bundleIdentifier)) if (! projectRoot.hasProperty (Ids::bundleIdentifier))


Loading…
Cancel
Save