@@ -96,6 +96,16 @@ StringArray ProjectExporter::getExporterNames() | |||||
return s; | return s; | ||||
} | } | ||||
StringArray ProjectExporter::getExporterValueTreeNames() | |||||
{ | |||||
StringArray s; | |||||
for (auto& n : getExporterNames()) | |||||
s.add (getValueTreeNameForExporter (n)); | |||||
return s; | |||||
} | |||||
String ProjectExporter::getValueTreeNameForExporter (const String& exporterName) | String ProjectExporter::getValueTreeNameForExporter (const String& exporterName) | ||||
{ | { | ||||
if (exporterName == XcodeProjectExporter::getNameMac()) | if (exporterName == XcodeProjectExporter::getNameMac()) | ||||
@@ -131,6 +141,22 @@ String ProjectExporter::getValueTreeNameForExporter (const String& exporterName) | |||||
return {}; | return {}; | ||||
} | } | ||||
String ProjectExporter::getTargetFolderForExporter (const String& exporterValueTreeName) | |||||
{ | |||||
if (exporterValueTreeName == "XCODE_MAC") return "MacOSX"; | |||||
if (exporterValueTreeName == "XCODE_IPHONE") return "iOS"; | |||||
if (exporterValueTreeName == "VS2017") return "VisualStudio2017"; | |||||
if (exporterValueTreeName == "VS2015") return "VisualStudio2015"; | |||||
if (exporterValueTreeName == "VS2013") return "VisualStudio2013"; | |||||
if (exporterValueTreeName == "LINUX_MAKE") return "LinuxMakefile"; | |||||
if (exporterValueTreeName == "ANDROIDSTUDIO") return "Android"; | |||||
if (exporterValueTreeName == "CODEBLOCKS_WINDOWS") return "CodeBlocksWindows"; | |||||
if (exporterValueTreeName == "CODEBLOCKS_LINUX") return "CodeBlocksLinux"; | |||||
if (exporterValueTreeName == "CLION") return "CLion"; | |||||
return {}; | |||||
} | |||||
StringArray ProjectExporter::getAllDefaultBuildsFolders() | StringArray ProjectExporter::getAllDefaultBuildsFolders() | ||||
{ | { | ||||
StringArray folders; | StringArray folders; | ||||
@@ -59,8 +59,10 @@ public: | |||||
}; | }; | ||||
static StringArray getExporterNames(); | static StringArray getExporterNames(); | ||||
static StringArray getExporterValueTreeNames(); | |||||
static Array<ExporterTypeInfo> getExporterTypes(); | static Array<ExporterTypeInfo> getExporterTypes(); | ||||
static String getValueTreeNameForExporter (const String& exporterName); | static String getValueTreeNameForExporter (const String& exporterName); | ||||
static String getTargetFolderForExporter (const String& exporterValueTreeName); | |||||
static StringArray getAllDefaultBuildsFolders(); | static StringArray getAllDefaultBuildsFolders(); | ||||
static ProjectExporter* createNewExporter (Project&, const int index); | static ProjectExporter* createNewExporter (Project&, const int index); | ||||
@@ -322,68 +322,11 @@ StringArray getJUCEModules() noexcept | |||||
return juceModuleIds; | return juceModuleIds; | ||||
} | } | ||||
StringArray getJUCEExporters (bool lowerCase) noexcept | |||||
{ | |||||
static StringArray validExportersUpper = | |||||
{ | |||||
"XCODE_MAC", | |||||
"XCODE_IPHONE", | |||||
"VS2013", | |||||
"VS2015", | |||||
"VS2017", | |||||
"LINUX_MAKE", | |||||
"ANDROIDSTUDIO", | |||||
"CODEBLOCKS_WINDOWS", | |||||
"CODEBLOCKS_LINUX", | |||||
"CLION" | |||||
}; | |||||
static StringArray validExportersLower = | |||||
{ | |||||
"xcode_mac", | |||||
"xcode_iphone", | |||||
"vs2013", | |||||
"vs2015", | |||||
"vs2017", | |||||
"linux_make", | |||||
"androidstudio", | |||||
"codeblocks_windows", | |||||
"codeblocks_linux", | |||||
"clion" | |||||
}; | |||||
if (lowerCase) | |||||
return validExportersLower; | |||||
return validExportersUpper; | |||||
} | |||||
bool isJUCEModule (const String& moduleID) noexcept | bool isJUCEModule (const String& moduleID) noexcept | ||||
{ | { | ||||
return getJUCEModules().contains (moduleID); | return getJUCEModules().contains (moduleID); | ||||
} | } | ||||
bool isValidExporterName (const String& exporterName) noexcept | |||||
{ | |||||
return getJUCEExporters().contains (exporterName, true); | |||||
} | |||||
String getTargetFolderForExporter (const String& exporterName) noexcept | |||||
{ | |||||
if (exporterName == "XCODE_MAC") return "MacOSX"; | |||||
if (exporterName == "XCODE_IPHONE") return "iOS"; | |||||
if (exporterName == "VS2017") return "VisualStudio2017"; | |||||
if (exporterName == "VS2015") return "VisualStudio2015"; | |||||
if (exporterName == "VS2013") return "VisualStudio2013"; | |||||
if (exporterName == "LINUX_MAKE") return "LinuxMakefile"; | |||||
if (exporterName == "ANDROIDSTUDIO") return "Android"; | |||||
if (exporterName == "CODEBLOCKS_WINDOWS") return "CodeBlocksWindows"; | |||||
if (exporterName == "CODEBLOCKS_LINUX") return "CodeBlocksLinux"; | |||||
if (exporterName == "CLION") return "CLion"; | |||||
return {}; | |||||
} | |||||
StringArray getModulesRequiredForConsole() noexcept | StringArray getModulesRequiredForConsole() noexcept | ||||
{ | { | ||||
return { "juce_core", | return { "juce_core", | ||||
@@ -59,11 +59,7 @@ void addPlistDictionaryKeyInt (XmlElement* xml, const String& key, int value); | |||||
bool fileNeedsCppSyntaxHighlighting (const File& file); | bool fileNeedsCppSyntaxHighlighting (const File& file); | ||||
StringArray getJUCEModules() noexcept; | StringArray getJUCEModules() noexcept; | ||||
StringArray getJUCEExporters (bool lowerCase = false) noexcept; | |||||
bool isJUCEModule (const String& moduleID) noexcept; | bool isJUCEModule (const String& moduleID) noexcept; | ||||
bool isValidExporterName (const String& exporterName) noexcept; | |||||
String getTargetFolderForExporter (const String& exporterName) noexcept; | |||||
StringArray getModulesRequiredForConsole() noexcept; | StringArray getModulesRequiredForConsole() noexcept; | ||||
StringArray getModulesRequiredForComponent() noexcept; | StringArray getModulesRequiredForComponent() noexcept; | ||||
@@ -25,6 +25,7 @@ | |||||
*/ | */ | ||||
#include "../../Application/jucer_Headers.h" | #include "../../Application/jucer_Headers.h" | ||||
#include "../../ProjectSaving/jucer_ProjectExporter.h" | |||||
#include "jucer_PIPGenerator.h" | #include "jucer_PIPGenerator.h" | ||||
//============================================================================== | //============================================================================== | ||||
@@ -85,6 +86,11 @@ static bool isJUCEExample (const File& pipFile) | |||||
return false; | return false; | ||||
} | } | ||||
static bool isValidExporterName (const String& exporterName) | |||||
{ | |||||
return ProjectExporter::getExporterValueTreeNames().contains (exporterName, true); | |||||
} | |||||
//============================================================================== | //============================================================================== | ||||
PIPGenerator::PIPGenerator (const File& pip, const File& output) | PIPGenerator::PIPGenerator (const File& pip, const File& output) | ||||
: pipFile (pip), | : pipFile (pip), | ||||
@@ -297,7 +303,7 @@ ValueTree PIPGenerator::createExporterChild (const String& exporterName) | |||||
{ | { | ||||
ValueTree exporter (exporterName); | ValueTree exporter (exporterName); | ||||
exporter.setProperty (Ids::targetFolder, "Builds/" + getTargetFolderForExporter (exporterName), nullptr); | |||||
exporter.setProperty (Ids::targetFolder, "Builds/" + ProjectExporter::getTargetFolderForExporter (exporterName), nullptr); | |||||
{ | { | ||||
ValueTree configs (Ids::CONFIGURATIONS); | ValueTree configs (Ids::CONFIGURATIONS); | ||||