Browse Source

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

tags/2021-05-28
jules 8 years ago
parent
commit
7f5abd41b1
3 changed files with 21 additions and 29 deletions
  1. +7
    -14
      extras/Projucer/Source/Project Saving/jucer_ProjectExport_Android.h
  2. +11
    -9
      extras/Projucer/Source/Project Saving/jucer_ProjectExporter.cpp
  3. +3
    -6
      extras/Projucer/Source/Project/jucer_ConfigTree_Exporter.h

+ 7
- 14
extras/Projucer/Source/Project Saving/jucer_ProjectExport_Android.h 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$$"))


+ 11
- 9
extras/Projucer/Source/Project Saving/jucer_ProjectExporter.cpp 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.");
}
}


+ 3
- 6
extras/Projucer/Source/Project/jucer_ConfigTree_Exporter.h 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 resized() override { group.setBounds (getLocalBounds().withTrimmedLeft (12)); }
void parentSizeChanged() override { updateSize (*this, group); }
void resized() override { group.setBounds (getLocalBounds().withTrimmedLeft (12)); }
private:
PropertyGroupComponent group;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SettingsComp)


Loading…
Cancel
Save