mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
PIPs: Ensure that the assets directory is copied correctly for mobile examples
This commit is contained in:
parent
c610745ee3
commit
ea826db813
1 changed files with 26 additions and 2 deletions
|
|
@ -63,7 +63,7 @@ static void ensureSingleNewLineAfterIncludes (StringArray& lines)
|
|||
}
|
||||
}
|
||||
|
||||
static String ensureCorrectWhitespace (const String& input)
|
||||
static String ensureCorrectWhitespace (StringRef input)
|
||||
{
|
||||
auto lines = StringArray::fromLines (input);
|
||||
ensureSingleNewLineAfterIncludes (lines);
|
||||
|
|
@ -86,11 +86,16 @@ static bool isJUCEExample (const File& pipFile)
|
|||
return false;
|
||||
}
|
||||
|
||||
static bool isValidExporterName (const String& exporterName)
|
||||
static bool isValidExporterName (StringRef exporterName)
|
||||
{
|
||||
return ProjectExporter::getExporterValueTreeNames().contains (exporterName, true);
|
||||
}
|
||||
|
||||
static bool isMobileExporter (const String& exporterName)
|
||||
{
|
||||
return exporterName == "XCODE_IPHONE" || exporterName == "ANDROIDSTUDIO";
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
PIPGenerator::PIPGenerator (const File& pip, const File& output)
|
||||
: pipFile (pip),
|
||||
|
|
@ -305,6 +310,25 @@ ValueTree PIPGenerator::createExporterChild (const String& exporterName)
|
|||
|
||||
exporter.setProperty (Ids::targetFolder, "Builds/" + ProjectExporter::getTargetFolderForExporter (exporterName), nullptr);
|
||||
|
||||
if (isMobileExporter (exporterName))
|
||||
{
|
||||
auto juceDir = getAppSettings().getStoredPath (Ids::jucePath).toString();
|
||||
|
||||
if (juceDir.isNotEmpty() && isValidJUCEExamplesDirectory (File (juceDir).getChildFile ("examples")))
|
||||
{
|
||||
auto assetsDirectoryPath = File (juceDir).getChildFile ("examples").getChildFile ("Assets").getFullPathName();
|
||||
|
||||
exporter.setProperty (exporterName == "XCODE_IPHONE" ? Ids::customXcodeResourceFolders
|
||||
: Ids::androidExtraAssetsFolder,
|
||||
assetsDirectoryPath, nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
// invalid JUCE path
|
||||
jassertfalse;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
ValueTree configs (Ids::CONFIGURATIONS);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue