Modules Manager: JPM

I've written, for my own benefit, a JUCE modules manager.  But I think I'd like to share it if people are interested in contributing.

It's a bit like npm, but for JUCE modules. 

What does it do I hear you say... :)

Well, for example, you type: 

jpm install juce_core@3.1.1

And it downloads and installs juce_core, and configures your .jucer file for you. 

Or even:

jpm install juce_*@4.0.1

To download and setup everything starting with juce_

It also saves a local file containing a specification for the modules and versions you used with the project so if you share it without the modules someone else can run jpm install and it'll go and download all the same stuff, at the same version.   It caches the modules locally so it's quick too.

It stores all the modules in a folder called jpm_modules in your JUCE project.

Why do you want this?

  • It's quick, easy and extendable.
  • It saves faffing around with the 'set modules paths' stuff which is painful when you have non-JUCE modules to include as well.
  • It makes it easier to reuse code
  • It means you get the right version of the module without having to faff around with git submodules, or bundling the modules with the rest of your code.
  • It makes it easy to find more modules...certainly if other people contribute.  You can type jpm list and it shows you what's available.  

It'll support, shortly, mutiple directories so you can have a local module archive too of your private stuff.   

I'm also planning on having it create and update modules more easily from a bunch of source files.  But that's next ... 

So if you have modules and you'd be interested in adding them to my list, or you fancy having a play with the alpha version, fixing bugs etc let me know :)  I'll post some code in a tic...

PS. it doesn't tackle dependencies at the moment, but that's not a big problem for me right now.

So you get the vibe, heres an example of it running on my Windows box - the directory isn't fully populated: 


C:\Users\Jim\Cide\jpm\test>..\Builds\VisualStudio2015\Debug\jpm.exe list
found: 13
juce/juce_core@3.1.1
juce/juce_core@4.0.2
juce/juce_audio_utils@3.1.1
juce/juce_audio_utils@4.0.2
juce/juce_audio_formats@3.1.1
juce/juce_audio_formats@4.0.2
juce/juce_audio_devices@3.1.1
juce/juce_audio_devices@4.0.2
juce/juce_graphics@3.1.1
juce/juce_graphics@4.0.2
credland/jcf_debug@0.1.0
credland/jcf_debug@0.1.0
drowaudio/drowaudio@master
C:\Users\Jim\Cide\jpm\test>..\Builds\VisualStudio2015\Debug\jpm.exe install drowaudio
install...
found: 1
downloading: drowaudio
url: https://github.com/drowaudio/drowaudio/archive/master.zip

C:\Users\Jim\Cide\jpm\test>dir jpm_modules
 Volume in drive C is Windows
 Volume Serial Number is 7ED6-AD55
 Directory of C:\Users\Jim\Cide\jpm\test\jpm_modules
07/12/2015  18:05    <DIR>          .
07/12/2015  18:05    <DIR>          ..
07/12/2015  18:05    <DIR>          drowaudio
07/12/2015  17:47    <DIR>          juce_core
07/12/2015  17:47    <DIR>          juce_graphics
               0 File(s)              0 bytes
               5 Dir(s)  772,292,333,568 bytes free
2 Likes

Thanks for this, this is something I've been wanting for ages and had thought about trying myself, time allowing. I'd definitely be up for contributing. Have you thought about where to store all the module info? REST access to a database somewhere? I'd be up for helping with that side of things.. 

Wow, very cool.

Just as a heads-up, something I want to do very soon is to simplify the design of modules, probably eliminating the manifest file and changing the way include paths work. Will post more detail when I can!

https://github.com/jcredland/jpm

There's the link.  There's a mac binary there as well.  

Anyone know of other modules we should put on the list?  I'm going to pop the font awesome stuff into a module shortly ... :)

There's something pretty fundamentally wrong about the include pathes for dependencies on other modules at the moment.  If you have a module in some random folder X then how does it know where the JUCE modules will be so it can do something like: 

#include "../juce_core/juce_core.h"

#include "../juce_graphics/juce_graphics.h"

Ah - ignore me... I can do angle brackets and the include paths are all sorted ;-)  

Yeah, one of the things I want to change is to remove all those annoying introjucer-generated indirection headers within your own project folder, and just use angle-bracket includes everywhere.

RIght now with danlin's FontAwesome module, and I've put the lock-free utility classes I have together into a module too: 

I've also fixed it up so you can generate JUCE Modules with the genmodule command and it sorts out the various headers, and juce_module_info file along with a simple Doxygen config.  So to create a module the minimum you need to do is to put your source files in a folder, run jpm and you're done :)   Very pleased with that.  

What I should do now is some proper work ... but what I actually want to do is sort out a new module just so I can use it :)


 $ jpm list
No jucer file found in /Users/jim/juce-toys/multithreading
jpm      : juce package manager
juce/juce_audio_basics                  Classes for audio buffer manipulation, midi message handling, synthesis, etc
juce/juce_audio_devices                 Classes to play and record from audio and midi i/o devices
juce/juce_audio_formats                 Classes for reading and writing various audio file formats
juce/juce_audio_plugin_client           Classes for building VST, VST3, RTAS, AAX and AU plugins
juce/juce_audio_processors              Classes for loading and playing VST, AU, or internally-generated audio processors
juce/juce_audio_utils                   Classes for audio-related GUI and miscellaneous tasks
juce/juce_box2d                         The Box2D physics engine and some utility classes.
juce/juce_browser_plugin_client         Classes for building NPAPI and ActiveX browser plugins.
juce/juce_core                          The essential set of basic JUCE classes, as required by all the other JUCE modules. Includes text, container, memory, threading and i/o functionality.
juce/juce_cryptography                  Classes for various basic cryptography functions, including RSA, Blowfish, MD5, SHA, etc.
juce/juce_data_structures               Classes for undo/redo management, and smart data structures.
juce/juce_events                        Classes for running an application's main event loop and sending/receiving messages, timers, etc.
juce/juce_graphics                      Classes for 2D vector graphics, image loading/saving, font handling, etc
juce/juce_gui_basics                    Basic user-interface components and related classes.
juce/juce_gui_extra                     Miscellaneous GUI classes for specialised tasks.
juce/juce_opengl                        Classes for rendering OpenGL in a JUCE window.
juce/juce_osc                           Open Sound Control implementation
juce/juce_tracktion_marketplace         JUCE classes for online product authentication via the Tracktion marketplace.
juce/juce_video                         Classes for playing video and capturing camera input.
credland/jcf_debug                      Debugging utilities for JUCE
credland/multithreading                 Classes to help with non-locking multithreading issues in real-time software
drowaudio/drowaudio                     DRowAudio audio utilities
drowaudio-stk/stk                       Synth toolkit wrapper
danlin/danlin_fontawesome               Font Awesome toolkit

This is awesome.

Does anyone know if there are plans from the JUCE team to support this, or something similar into becoming a more full-fledged package repository?

A npm or CocoaPods style web app with corresponding CLI tool for JUCE modules would are really useful for the reasons mentioned above.

Well it would be awesome if we were maintaining it :slight_smile: