AU component version is always 0 in exported plugins (Xcode exporter misses versionAsHex)
-
Every AU exported from HISE on macOS registers with a component version of 0.0.0, regardless of the project version. The bundle version fields are correct, so this only shows up when a host or validator reads the AudioComponents registration.
Repro
Export any project as AU on macOS, then look at Binaries/Builds/MacOSX/Info-AU.plist:
<key>AudioComponents</key> <array> <dict> ... <key>subtype</key> <string>Mbsf</string> <key>version</key> <integer>0</integer> <!-- always 0 --> </dict> </array> ... <key>CFBundleShortVersionString</key> <string>0.0.30</string> <!-- correct --> <key>CFBundleVersion</key> <string>0.0.30</string> <!-- correct -->I see this on a 0.0.30 project and on two untouched 1.0.0 test projects, so it is not version-string specific.
pluginvalreports the plugin as version 0.0.0 as a result. That is JUCE's own AU format reading it back: juce_AudioUnitPluginFormat.mm calls AudioComponentGetVersion, which returns the value from that plist entry.Cause
In
JUCE/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h,writeInfoPlistFile()setsoptions.version(around line 1839) but never setsoptions.versionAsHex. That member defaults to 0 injuce_PlistOptions.h, andjuce_PlistOptions.cppwrites it straight into theAudioComponentsdict:addPlistDictionaryKey (*dict, "version", versionAsHex);The Mac Makefile exporter does set it (
jucer_ProjectExport_MacMake.h:options.versionAsHex = project.getVersionAsHexInteger();), so the Xcode path is the only one affected, and that is the path HISE uses for macOS export.Fix
One line next to the existing options.version assignment in the Xcode exporter:
options.versionAsHex = owner.project.getVersionAsHexInteger();Since HISE 5 ships a prebuilt Projucer in the JUCE submodule, this needs a Projucer rebuild to reach users, not just the source change.
Impact
Fairly mild but worth fixing. The compiled binary is fine:
JucePlugin_VersionCodeis set correctly fromgetVersionAsHex(), so the AU wrapper'sVersion()returns the right value at runtime and the plugin loads and works normally. What breaks is the registration metadata:- Hosts display the plugin as version 0.0.0.
- AU caches keyed on component version never invalidate across releases, so users updating a plugin may need to clear their AU cache manually before macOS notices anything changed.
Workaround
Until the exporter is fixed you can patch the value per build, but note where:
Info-AU.plistis written by the Projucer--resavestep insidebatchCompileOSX, not by the HISE export, so editing it straight after exporting gets overwritten.The AU component version is the project version packed as
major * 65536 + minor * 256 + patchwritten as a decimal integer, so 0.0.30 becomes 30 and 1.2.3 becomes 66051.Set it with
/usr/libexec/PlistBuddy -c "Set :AudioComponents:0:version 30" "Binaries/Builds/MacOSX/Info-AU.plist"after the resave, then build the.xcodeprojin Xcode.If you drive the build from a script, insert that command into your copy of
batchCompileOSXbetween the--resaveline and thexcodebuildline.Tested against the JUCE 6.1.3 submodule on macOS.