Skip to content

[BUG] Running export_ci or export from HISE CLI Doesn't Properly Embed Webview Resources in Compiled Binaries #424

@jackkilgore

Description

@jackkilgore

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 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();

exportWebViewResources() seems to be a JUCE command with the following code:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions