1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Projucer: Check command-line JUCE modules path before the global path when creating PIPs from JUCE examples

This commit is contained in:
ed 2019-01-07 11:19:48 +00:00
parent 84513eef8f
commit 02b7c0936d
2 changed files with 25 additions and 6 deletions

View file

@ -254,11 +254,11 @@ ValueTree PIPGenerator::createExporterChild (const String& exporterName)
if (isJUCEExample (pipFile) && exporterRequiresExampleAssets (exporterName, metadata[Ids::name]))
{
auto juceDir = getAppSettings().getStoredPath (Ids::jucePath, TargetOS::getThisOS()).get().toString();
auto examplesDir = getExamplesDirectory();
if (isValidJUCEExamplesDirectory (File (juceDir).getChildFile ("examples")))
if (examplesDir != File())
{
auto assetsDirectoryPath = File (juceDir).getChildFile ("examples").getChildFile ("Assets").getFullPathName();
auto assetsDirectoryPath = examplesDir.getChildFile ("Assets").getFullPathName();
exporter.setProperty (exporterName == "ANDROIDSTUDIO" ? Ids::androidExtraAssetsFolder
: Ids::customXcodeResourceFolders,
@ -357,12 +357,12 @@ Result PIPGenerator::setProjectSettings (ValueTree& jucerTree)
if (useLocalCopy && isJUCEExample (pipFile))
{
auto juceDir = getAppSettings().getStoredPath (Ids::jucePath, TargetOS::getThisOS()).get().toString();
auto examplesDir = getExamplesDirectory();
if (isValidJUCEExamplesDirectory (File (juceDir).getChildFile ("examples")))
if (examplesDir != File())
{
defines += ((defines.isEmpty() ? "" : " ") + String ("PIP_JUCE_EXAMPLES_DIRECTORY=")
+ Base64::toBase64 (File (juceDir).getChildFile ("examples").getFullPathName()));
+ Base64::toBase64 (examplesDir.getFullPathName()));
}
else
{
@ -556,3 +556,21 @@ String PIPGenerator::getPathForModule (const String& moduleID) const
return {};
}
File PIPGenerator::getExamplesDirectory() const
{
if (juceModulesPath != File())
{
auto examples = juceModulesPath.getSiblingFile ("examples");
if (isValidJUCEExamplesDirectory (examples))
return examples;
}
auto examples = File (getAppSettings().getStoredPath (Ids::jucePath, TargetOS::getThisOS()).get().toString()).getChildFile ("examples");
if (isValidJUCEExamplesDirectory (examples))
return examples;
return {};
}

View file

@ -75,6 +75,7 @@ private:
StringArray getPluginCharacteristics() const;
String getPathForModule (const String&) const;
File getExamplesDirectory() const;
//==============================================================================
File pipFile, outputDirectory, juceModulesPath;