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:
parent
84513eef8f
commit
02b7c0936d
2 changed files with 25 additions and 6 deletions
|
|
@ -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 {};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue