You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem
When web view is present in a HISE project, the HISE CLI commands export and export_ci do not embed the web resources in the binary files. In contrast, exporting through the HISE GUI properly embeds all web resources in the final binaries. EG, the temporary file externalFile (supposedly) containing all web resources has size of ~200KB when running from CLI vs. a size of ~900KB from HISE GUI. Note, that changing the architecture, or standalone vs. plugin type, or cleaning the binaries/pooled resources does nothing to remedy the problem.
Namely it seems to be an issues with BaseExporter::exportEmbeddedFiles() call to ValueTree webViewResources = chainToExport->getMainController()->exportWebViewResources();
Juce::ValueTree GlobalScriptCompileBroadcaster::exportWebViewResources()
{
ValueTree v("WebViewResources");
for (const auto& wv : webviews)
{
auto data = std::get<1>(wv);
auto projectRoot = dynamic_cast<MainController*>(this)->getCurrentFileHandler().getRootFolder();
// We only embed file resources that are in the project directory (because then we'll assume
// that they are not likely to be installed on the end user's computer).
auto shouldEmbedResource = data->getRootDirectory().isAChildOf(projectRoot);
if (shouldEmbedResource)
{
auto id = std::get<0>(wv).toString();
auto c = data->exportAsValueTree();
c.setProperty("ID", id, nullptr);
v.addChild(c, -1, nullptr);
}
}
return v;
}
Perhaps the shouldEmbedResource is throwing a false negative due to the HISE CLI not correctly setting the project root?
Conclusion
This is just a theory. Anyway, let me know if you need any more info from me, or if you can reproduce it, or if I can do anything to help with the issue! The ability to completely automate the build process without a GUI would be quite nice! :,)
Cheers,
Jack
The text was updated successfully, but these errors were encountered:
jackkilgore
changed the title
[BUG] Running export_ci or export from HISE CLI Doesn't Properly Embed Webview Resources in externalFiles
[BUG] Running export_ci or export from HISE CLI Doesn't Properly Embed Webview Resources in Compiled Binaries
Sep 13, 2023
Unfortunately it can't be solved implicitely because the webview actually needs to be opened at least once to fetch all resources so in a command line context where no UI is present this will not work.
What you need instead is to export the project once from the GUI: If there is a webview present, it will collect and cache the embedded resources into a file in the Images folder:
I haven't checked whether the resource file created on Windows will also work on mac, so I've added two locations based on the OS - you can check whether the exported webview file on Windows works on macOS too, if that's the case you can just copy it over, otherwise you need to export it once on each platform (it might be possible that the OS native browsers will request different URL formats etc).
From then on the command line utility will pickup the cached version and make sure that the resources are correct. If you try to export it without the file present, it should throw a export error.
If you want to fully automate this you can include these files in your version control system but just remember to run the export once from the GUI when you make changes to the webview data.
Hi! I'm working with Lunacy to automate HISE exports.
Environment
Problem
When web view is present in a HISE project, the HISE CLI commands
export
andexport_ci
do not embed the web resources in the binary files. In contrast, exporting through the HISE GUI properly embeds all web resources in the final binaries. EG, the temporary fileexternalFile
(supposedly) containing all web resources has size of ~200KB when running from CLI vs. a size of ~900KB from HISE GUI. Note, that changing the architecture, orstandalone vs. plugin
type, or cleaning the binaries/pooled resources does nothing to remedy the problem.Namely it seems to be an issues with
BaseExporter::exportEmbeddedFiles()
call toValueTree webViewResources = chainToExport->getMainController()->exportWebViewResources();
exportWebViewResources()
seems to be a JUCE command with the following code:Perhaps the
shouldEmbedResource
is throwing a false negative due to the HISE CLI not correctly setting the project root?Conclusion
This is just a theory. Anyway, let me know if you need any more info from me, or if you can reproduce it, or if I can do anything to help with the issue! The ability to completely automate the build process without a GUI would be quite nice! :,)
Cheers,
Jack
The text was updated successfully, but these errors were encountered: