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

VST3 Client: Generate moduleinfo.json into Resources directory of bundle

This commit is contained in:
reuk 2023-05-16 21:08:08 +01:00
parent 06a2089872
commit 77458fb4f9
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C
10 changed files with 162 additions and 152 deletions

View file

@ -798,12 +798,9 @@ public:
}
else if (type == VST3Helper)
{
for (const auto& source : owner.getVST3HelperProgramSources (owner))
{
const auto location = owner.rebaseFromProjectFolderToBuildTarget (source)
.toWindowsStyle();
cppFiles->createNewChildElement ("ClCompile")->setAttribute ("Include", location);
}
const auto location = owner.rebaseFromProjectFolderToBuildTarget (owner.getVST3HelperProgramSource())
.toWindowsStyle();
cppFiles->createNewChildElement ("ClCompile")->setAttribute ("Include", location);
}
}
@ -1344,15 +1341,18 @@ public:
// moduleinfotool doesn't handle Windows-style path separators properly when computing the bundle name
const auto normalisedBundlePath = getOwner().getOutDirFile (config, segments[0]).replace ("\\", "/");
const auto contentsDir = normalisedBundlePath + "\\Contents";
const auto resourceDir = contentsDir + "\\Resources";
return "\r\n"
+ writer.quoted()
+ " -create -version "
+ getOwner().project.getVersionString().quoted()
+ " -path "
+ normalisedBundlePath.quoted()
+ " -output "
+ (getOwner().getOutDirFile (config, segments[0]) + "\\Contents\\moduleinfo.json").quoted();
return "\r\ndel /s /q " + (contentsDir + "\\moduleinfo.json").quoted() + "\r\n"
"if not exist " + resourceDir.quoted() + " mkdir " + resourceDir.quoted() + "\r\n"
+ writer.quoted()
+ " -create -version "
+ getOwner().project.getVersionString().quoted()
+ " -path "
+ normalisedBundlePath.quoted()
+ " -output "
+ (resourceDir + "\\moduleinfo.json").quoted();
}();
const auto pkgScript = copyBuildOutputIntoBundle (segments);

View file

@ -410,11 +410,13 @@ public:
{
if (owner.project.isVst3ManifestEnabled())
{
out << "\t$(V_AT) $(JUCE_OUTDIR)/$(JUCE_TARGET_VST3_MANIFEST_HELPER) "
out << "\t-$(V_AT)mkdir -p $(JUCE_OUTDIR)/$(JUCE_VST3DIR)/Contents/Resources" << newLine
<< "\t-$(V_AT)rm -f $(JUCE_OUTDIR)/$(JUCE_VST3DIR)/Contents/moduleinfo.json" << newLine
<< "\t$(V_AT) $(JUCE_OUTDIR)/$(JUCE_TARGET_VST3_MANIFEST_HELPER) "
"-create "
"-version " << owner.project.getVersionString().quoted() << " "
"-path \"$(JUCE_OUTDIR)/$(JUCE_VST3DIR)\" "
"-output \"$(JUCE_OUTDIR)/$(JUCE_VST3DIR)/Contents/moduleinfo.json\" " << newLine;
"-output \"$(JUCE_OUTDIR)/$(JUCE_VST3DIR)/Contents/Resources/moduleinfo.json\"" << newLine;
}
out << "\t-$(V_AT)[ ! \"$(JUCE_VST3DESTDIR)\" ] || (mkdir -p $(JUCE_VST3DESTDIR) && cp -R $(JUCE_COPYCMD_VST3))" << newLine;
@ -1200,13 +1202,10 @@ private:
}
else if (targetType == MakefileTarget::VST3Helper)
{
for (const auto& source : getVST3HelperProgramSources (*this))
{
targetFiles.emplace_back (source.rebased (projectFolder,
getTargetFolder(),
build_tools::RelativePath::buildTargetFolder),
String{});
}
targetFiles.emplace_back (getVST3HelperProgramSource().rebased (projectFolder,
getTargetFolder(),
build_tools::RelativePath::buildTargetFolder),
String{});
}
return targetFiles;

View file

@ -2135,18 +2135,15 @@ private:
}
if (target->type == XcodeTarget::VST3Helper
&& project.getEnabledModules().isModuleEnabled ("juce_audio_processors"))
&& project.getEnabledModules().isModuleEnabled ("juce_audio_plugin_client"))
{
for (const auto& source : getVST3HelperProgramSources (*this))
{
const auto path = rebaseFromProjectFolderToBuildTarget (source);
addFile (FileOptions().withRelativePath ({ expandPath (path.toUnixStyle()), path.getRoot() })
.withSkipPCHEnabled (true)
.withCompilationEnabled (true)
.withInhibitWarningsEnabled (true)
.withCompilerFlags ("-std=c++17 -fobjc-arc")
.withXcodeTarget (target));
}
const auto path = rebaseFromProjectFolderToBuildTarget (getVST3HelperProgramSource());
addFile (FileOptions().withRelativePath ({ expandPath (path.toUnixStyle()), path.getRoot() })
.withSkipPCHEnabled (true)
.withCompilationEnabled (true)
.withInhibitWarningsEnabled (true)
.withCompilerFlags ("-std=c++17 -fobjc-arc")
.withXcodeTarget (target));
}
auto targetName = String (target->getName());
@ -2369,16 +2366,11 @@ private:
}
else if (target->type == XcodeTarget::VST3PlugIn && project.isVst3ManifestEnabled())
{
// Generate the manifest
script << "\"$CONFIGURATION_BUILD_DIR/" << Project::getVST3FileWriterName() << "\" "
"-create "
"-version " << project.getVersionString().quoted() << " "
"-path \"$CONFIGURATION_BUILD_DIR/$FULL_PRODUCT_NAME\" "
"-output \"$CONFIGURATION_BUILD_DIR/$FULL_PRODUCT_NAME/Contents/moduleinfo.json\"\n";
// Sign the manifest (a prerequisite of signing the containing bundle)
script << "xcrun codesign -f -s - \"$CONFIGURATION_BUILD_DIR/$FULL_PRODUCT_NAME/Contents/moduleinfo.json\"\n";
// Sign the full bundle
script << "xcrun codesign -f -s - \"$CONFIGURATION_BUILD_DIR/$FULL_PRODUCT_NAME\"\n";
"-output \"$CONFIGURATION_BUILD_DIR/$FULL_PRODUCT_NAME/Contents/Resources/moduleinfo.json\"\n";
}
target->addShellScriptBuildPhase ("Update manifest", script);
@ -2986,7 +2978,7 @@ private:
output << "\t};\n\trootObject = " << createID ("__root") << " /* Project object */;\n}\n";
}
String addFileReference (String pathString, String fileType = {}) const
String addFileReference (String pathString, const String& fileType = {}) const
{
String sourceTree ("SOURCE_ROOT");
build_tools::RelativePath path (pathString, build_tools::RelativePath::unknown);
@ -3004,7 +2996,7 @@ private:
return addFileOrFolderReference (pathString, sourceTree, fileType.isEmpty() ? getFileType (pathString) : fileType);
}
String addFileOrFolderReference (const String& pathString, String sourceTree, String fileType) const
String addFileOrFolderReference (const String& pathString, const String& sourceTree, const String& fileType) const
{
auto fileRefID = createFileRefID (pathString);
auto filename = build_tools::RelativePath (pathString, build_tools::RelativePath::unknown).getFileName();

View file

@ -223,49 +223,12 @@ public:
.getChildFile ("juce_LV2ManifestHelper.cpp");
}
std::vector<build_tools::RelativePath> getVST3HelperProgramSources (const ProjectExporter& exporter) const
build_tools::RelativePath getVST3HelperProgramSource() const
{
const auto base = getModuleFolderRelativeToProject ("juce_audio_processors").getChildFile ("format_types")
.getChildFile ("VST3_SDK");
const auto publicSdk = base.getChildFile ("public.sdk");
const auto source = publicSdk.getChildFile ("source");
const auto vst = source.getChildFile ("vst");
const auto hosting = vst.getChildFile ("hosting");
const auto plugBase = base.getChildFile ("pluginterfaces")
.getChildFile ("base");
std::vector<build_tools::RelativePath> result
{
hosting.getChildFile ("module.cpp"),
base.getChildFile ("public.sdk")
.getChildFile ("samples")
.getChildFile ("vst-utilities")
.getChildFile ("moduleinfotool")
.getChildFile ("source")
.getChildFile ("main.cpp"),
source.getChildFile ("common")
.getChildFile ("memorystream.cpp"),
source.getChildFile ("common")
.getChildFile ("readfile.cpp"),
vst.getChildFile ("moduleinfo")
.getChildFile ("moduleinfocreator.cpp"),
vst.getChildFile ("moduleinfo")
.getChildFile ("moduleinfoparser.cpp"),
vst.getChildFile ("utility")
.getChildFile ("stringconvert.cpp"),
vst.getChildFile ("vstinitiids.cpp"),
plugBase.getChildFile ("coreiids.cpp"),
plugBase.getChildFile ("funknown.cpp"),
};
if (exporter.isOSX())
result.push_back (hosting.getChildFile ("module_mac.mm"));
else if (exporter.isLinux())
result.push_back (hosting.getChildFile ("module_linux.cpp"));
else if (exporter.isWindows())
result.push_back (hosting.getChildFile ("module_win32.cpp"));
return result;
const auto suffix = isOSX() ? "mm" : "cpp";
return getModuleFolderRelativeToProject ("juce_audio_plugin_client")
.getChildFile ("VST3")
.getChildFile (String ("juce_VST3ManifestHelper.") + suffix);
}
//==============================================================================