MATLAB-Community-Toolboxes-at-INCF / neuropixels-toolkit

(Under construction) Neuropixel Toolkit is a set of unified Matlab tools for manipulating Neuropixel and Kilosort datasets
MIT License
2 stars 3 forks source link

Create package for one-click Add-on Explorer install #7

Open vijayiyer05 opened 3 years ago

apjanke commented 2 years ago

We're talking about building a Matlab Toolbox .mltbx installer file here, right?

I'd recommend you take a look at how my MatlabProjectTemplate does this. There are a couple gotchas with Matlab *.prj files that are used to build Toolbox .mltbx installer files. In particular, the Matlab toolbox-building tools bake absolute paths to things into the .prj files. That's unsuitable for source trees in projects with multiple developers, or that need to work across multiple machines or different operating systems. To work around this, you can create a templated .prj.in file, and process that to produce the actual .prj file at build time, treating the .prj file as an intermediate build step artifact, not the main definition of the Toolbox build.

Here's an example of the actual code that implements the .prj.in trick.

I'd also suggest you adopt the policy of "Neuropixel Toolkit works as a Matlab Toolbox, but it doesn't have to be used as one, and works just fine when run directly from the repo or regular-zip-file distribution too". If your code only works right when installed as a Matlab Toolbox, that's going to clog up your development workflow because you'll need to do an .mltbx build and install each time you want to test your code, and can't effectively edit the live source code files.

vijayiyer05 commented 2 years ago

@apjanke It's great to know about your MATLAB Project Template project, thanks for sharing!

This issue corresponds to one of the stretch goals for this project cycle. It might end up being smaller-scale: to simply work through the .mltbx creation and seeing/showing how it works. It need not use the project framework, but it's great to have these extra tools and tips to help make that work more smoothly.

Completely agree with your final point: .mltbx should be a bonus, not a replacement for other workflows.