Fix: Remove legacy Java dependencies in publishFS for MATLAB 2026a#123
Open
matteozanettii wants to merge 1 commit into
Open
Fix: Remove legacy Java dependencies in publishFS for MATLAB 2026a#123matteozanettii wants to merge 1 commit into
matteozanettii wants to merge 1 commit into
Conversation
Refactor publishFS to use native execution for examples, capturing output and images directly. Remove legacy HTML generation code and streamline the process.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
Following the recent MATLAB Release Notes announcing the progressive deprecation and removal of internal Java support, the
publishFS.mfunction started to fail. The script previously relied heavily on Java-based engines (XML parsing and XSLT transformations viam2mxdom,xslt, andTransformer) to execute code examples and generate the HTML output. This caused crashes in newer MATLAB environments.Solution Implemented
To future-proof the toolbox and ensure maximum compatibility, I completely removed the legacy Java dependencies. I have rewritten the HTML generation engine using a 100% native MATLAB approach.
Key Changes
m2mxdomtransformations with MATLAB's nativeevalcfunction. This allows the script to cleanly and silently capture the printed output of the examples.findobj('Type', 'figure')andsaveas. The script now detects generated plots and embeds them directly into the HTML without relying on XML intermediates.try...catchblock during the execution of the examples. If an example fails (e.g., due to a missing dataset in the workspace),publishFSno longer crashes. Instead, it elegantly captures theMExceptionand prints the error message directly inside the generated HTML<pre class="codeoutput">tag.Impact
tmpfile generation and cleanup processes have been streamlined.