b_discussion - depcharge-org/depcharge GitHub Wiki

Just a draft that needs review

DepCharge: A Dependency Manager for Matlab

DepCharge is a combination of best practices and a Matlab utility designed to simplify dependency management in Matlab projects. It draws inspiration from CMake and aims to automate the installation and management of project dependencies.

Key Features

  1. Automated Dependency Installation:

    • Users can install all dependencies automatically by running DepCharge.m.
    • Eliminates the need for manual installation of multiple dependencies.
  2. Dependency Specification:

    • Uses a deplist.json file (or potentially an m-file function returning a struct) to specify dependencies.
    • Includes information such as dependency names, source (git/path/zip), version (tag/commit/branch), and installation options.
  3. Flexible Sourcing:

    • Can source dependencies from various locations:
      • Git repositories
      • Relative file paths
      • Zip files
    • Allows for easy transition between development and distribution stages.
  4. Version Control:

    • Supports specifying exact versions, tags, or branches of dependencies.
    • Option to specify whether later versions are acceptable.
  5. Installation Options:

    • Local installation in a deps folder by default.
    • Option for global installation in Matlab's global installation directory.
  6. Path Management:

    • Automatically adds installed dependencies to the Matlab path.
  7. Recursive Dependency Resolution:

    • Handles sub-projects and their dependencies recursively.
  8. Custom Installation Scripts:

    • Supports custom installation scripts for dependencies with unique requirements.
  9. Project Structure Guidelines:

    • Recommends a standard project layout, including a top-level +project folder with a unique name.
  10. Update Management:

    • Users can update dependencies by pulling new code and running depcharge again.
  11. Distribution Support:

    • Potential feature to automatically package projects for customer distribution.

Usage

  1. Create a deplist.json file in your project root.
  2. Specify your project's dependencies in the deplist.json.
  3. Run depcharge.m to automatically install and set up all dependencies.
  4. Update dependencies by pulling new code and re-running depcharge.m.

Benefits

  • Simplifies the process of organizing and managing complex Matlab projects with multiple dependencies.
  • Improves code reusability without sacrificing ease of installation for end-users.
  • Standardizes project structure and dependency management across Matlab projects.