googlesamples / unity-jar-resolver

Unity plugin which resolves Android & iOS dependencies and performs version management
Other
1.21k stars 337 forks source link

[FR] Don't process hidden [*]Dependencies.xml files #608

Open vizgl opened 1 year ago

vizgl commented 1 year ago

Feature proposal

I use custom build script with many conditions. For some builds I want to remove libs. I made it by setting hidden flag on folders to true. In that case unity don't add scripts, resources etc to the final apk file. But EDM is not process such cases. It still read []Dependencies.xml files and add .aar files.

I propose add check for parent folders / files to match hidden flag to false before process it.

a-maurice commented 1 year ago

Hi @vizgl

That's an interesting use case. We use the AssetDatabase to find the xml files: https://github.com/googlesamples/unity-jar-resolver/blob/3dfc84aba31425c1def8a2da7027757d4b3d59fd/source/AndroidResolver/src/XmlDependencies.cs#L62 https://github.com/googlesamples/unity-jar-resolver/blob/31ff5311c2f5ab102b0b9bc6827de6b858b9c3e3/source/VersionHandlerImpl/src/VersionHandlerImpl.cs#L2723

Based on the Unity documentation, it seems like hiding files should presumably work with that, but maybe it doesn't (https://docs.unity3d.com/Manual/SpecialFolders.html)

It might be a bit of time before we can look into this more. In the meantime, a possibility might be in your script that is hiding/unhiding folders, find and rename *Dependencies.xml files into something else to hide them (and back to the original name to unhide them).