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

Projucer: Fixed a crash in the android exporter when VST3 is enabled

This commit is contained in:
jules 2017-05-03 15:42:38 +01:00
parent f4046909ab
commit 7f5abd41b1
3 changed files with 21 additions and 29 deletions

View file

@ -770,7 +770,7 @@ private:
//==============================================================================
String createDefaultClassName() const
{
String s (project.getBundleIdentifier().toString().toLowerCase());
auto s = project.getBundleIdentifier().toString().toLowerCase();
if (s.length() > 5
&& s.containsChar ('.')
@ -790,11 +790,8 @@ private:
void initialiseDependencyPathValues()
{
sdkPath.referTo (Value (new DependencyPathValueSource (getSetting (Ids::androidSDKPath),
Ids::androidSDKPath, TargetOS::getThisOS())));
ndkPath.referTo (Value (new DependencyPathValueSource (getSetting (Ids::androidNDKPath),
Ids::androidNDKPath, TargetOS::getThisOS())));
sdkPath.referTo (Value (new DependencyPathValueSource (getSetting (Ids::androidSDKPath), Ids::androidSDKPath, TargetOS::getThisOS())));
ndkPath.referTo (Value (new DependencyPathValueSource (getSetting (Ids::androidNDKPath), Ids::androidNDKPath, TargetOS::getThisOS())));
}
//==============================================================================
@ -807,9 +804,7 @@ private:
createDirectoryOrThrow (targetFolder);
LibraryModule* const coreModule = getCoreModule (modules);
if (coreModule != nullptr)
if (auto* coreModule = getCoreModule (modules))
{
File javaDestFile (targetFolder.getChildFile (className + ".java"));
@ -840,16 +835,14 @@ private:
.replace ("JuceAppActivity", className);
}
File javaSourceFile (javaSourceFolder.getChildFile ("JuceAppActivity.java"));
StringArray javaSourceLines (StringArray::fromLines (javaSourceFile.loadFileAsString()));
auto javaSourceFile = javaSourceFolder.getChildFile ("JuceAppActivity.java");
auto javaSourceLines = StringArray::fromLines (javaSourceFile.loadFileAsString());
{
MemoryOutputStream newFile;
for (int i = 0; i < javaSourceLines.size(); ++i)
for (const auto& line : javaSourceLines)
{
const String& line = javaSourceLines[i];
if (line.contains ("$$JuceAndroidMidiImports$$"))
newFile << juceMidiImports;
else if (line.contains ("$$JuceAndroidMidiCode$$"))

View file

@ -86,10 +86,9 @@ ProjectExporter* ProjectExporter::createNewExporter (Project& project, const int
StringArray ProjectExporter::getExporterNames()
{
StringArray s;
Array<ExporterTypeInfo> types (getExporterTypes());
for (int i = 0; i < types.size(); ++i)
s.add (types.getReference(i).name);
for (auto& e : getExporterTypes())
s.add (e.name);
return s;
}
@ -225,20 +224,23 @@ void ProjectExporter::createDependencyPathProperties (PropertyListBuilder& props
{
if (shouldBuildTargetType (ProjectType::Target::VST3PlugIn) || project.isVST3PluginHost())
{
props.add (new DependencyPathPropertyComponent (project.getFile().getParentDirectory(), getVST3PathValue(), "VST3 SDK Folder"),
"If you're building a VST3 plugin or host, this must be the folder containing the VST3 SDK. This can be an absolute path, or a path relative to the Projucer project file.");
if (dynamic_cast<DependencyPathValueSource*> (&getVST3PathValue().getValueSource()) != nullptr)
props.add (new DependencyPathPropertyComponent (project.getFile().getParentDirectory(), getVST3PathValue(), "VST3 SDK Folder"),
"If you're building a VST3 plugin or host, this must be the folder containing the VST3 SDK. This can be an absolute path, or a path relative to the Projucer project file.");
}
if (shouldBuildTargetType (ProjectType::Target::AAXPlugIn) && project.shouldBuildAAX())
{
props.add (new DependencyPathPropertyComponent (project.getFile().getParentDirectory(), getAAXPathValue(), "AAX SDK Folder"),
"If you're building an AAX plugin, this must be the folder containing the AAX SDK. This can be an absolute path, or a path relative to the Projucer project file.");
if (dynamic_cast<DependencyPathValueSource*> (&getAAXPathValue().getValueSource()) != nullptr)
props.add (new DependencyPathPropertyComponent (project.getFile().getParentDirectory(), getAAXPathValue(), "AAX SDK Folder"),
"If you're building an AAX plugin, this must be the folder containing the AAX SDK. This can be an absolute path, or a path relative to the Projucer project file.");
}
if (shouldBuildTargetType (ProjectType::Target::RTASPlugIn) && project.shouldBuildRTAS())
{
props.add (new DependencyPathPropertyComponent (project.getFile().getParentDirectory(), getRTASPathValue(), "RTAS SDK Folder"),
"If you're building an RTAS, this must be the folder containing the RTAS SDK. This can be an absolute path, or a path relative to the Projucer project file.");
if (dynamic_cast<DependencyPathValueSource*> (&getRTASPathValue().getValueSource()) != nullptr)
props.add (new DependencyPathPropertyComponent (project.getFile().getParentDirectory(), getRTASPathValue(), "RTAS SDK Folder"),
"If you're building an RTAS, this must be the folder containing the RTAS SDK. This can be an absolute path, or a path relative to the Projucer project file.");
}
}

View file

@ -155,9 +155,8 @@ private:
int exporterIndex;
//==============================================================================
class SettingsComp : public Component
struct SettingsComp : public Component
{
public:
SettingsComp (ProjectExporter* exp)
: group (exp->getName(), ExporterItem::getIconForExporter (exp))
{
@ -169,11 +168,9 @@ private:
parentSizeChanged();
}
void parentSizeChanged() override { updateSize (*this, group); }
void parentSizeChanged() override { updateSize (*this, group); }
void resized() override { group.setBounds (getLocalBounds().withTrimmedLeft (12)); }
void resized() override { group.setBounds (getLocalBounds().withTrimmedLeft (12)); }
private:
PropertyGroupComponent group;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SettingsComp)