Skip to content

Latest commit

 

History

History
99 lines (84 loc) · 4.21 KB

README.md

File metadata and controls

99 lines (84 loc) · 4.21 KB

View GHToolbox on File Exchange

GitHub Toolbox Utility

Summary

ghtb provides a simple way to manage toolbox installation of open-source MATLAB Community Toolboxes linked to GitHub (via Releases).

Description

This Toolbox can be accessed via ghtb and provides a way to directly install, uninstall, require, or package MATLAB Community Toolboxes. For upgrade and downgrade use-cases, users can set the override option to force the install. GHToolbox makes the following assumptions:

  • Community Toolbox linked on FileExchange to GitHub via GitHub Releases.
  • Community Toolbox publicly available as open-source on GitHub.
  • Community Toolbox attaches a single .mltbx artifact to GitHub Releases.
  • Community Toolbox name matches the filename of .mltbx artifact.
  • Users do not wish to have multiple simultaneous versions installed i.e. only a single version per Toolbox is installed at any given time.

Here are some examples on how to invoke it once installed or saved to path:

ghtb.install('guzman-raphael/compareVersions') % default: version='latest' and override=false
ghtb.install('guzman-raphael/compareVersions', 'version', '1.0.7') % default: override=false
ghtb.install('guzman-raphael/compareVersions', 'version', '1.0.6', 'override', true)
ghtb.install('guzman-raphael/compareVersions', 'version', ...
             @(v) cellfun(@(x) contains(x, '1.0.'), v, 'uni', true))
ghtb.install('compareVersions.mltbx') %install from local toolbox file
ghtb.uninstall('compareVersions') % uninstalls all versions of Toolbox
requiredToolboxes = {...
    struct(...
        'Name', 'GHToolbox', ...
        'ResolveTarget', 'datajoint/GHToolbox'...
    ), ...
    struct(...
        'Name', 'compareVersions', ...
        'ResolveTarget', 'guzman-raphael/compareVersions', ...
        'Version', '1.0.8'...
    ), ...
    struct(...
        'Name', 'mym', ...
        'ResolveTarget', 'datajoint/mym', ...
        'Version', @(v) cellfun(@(x) contains(x, '2.7.'), v, 'uni', true)...
    )...
};
ghtb.require(requiredToolboxes) % require with prompts
ghtb.require(requiredToolboxes, 'prompt', false)
ghtb.package('GHToolbox', ...
             'Raphael Guzman', ...
             'raphael.h.guzman@gmail.com', ...
             ['''ghtb'' provides a simple way to manage addon installation of ' ...
              'open-source MATLAB Community Toolboxes linked to GitHub (via ' ...
              'Releases).'], ...
             'long description', ...
             {'.vscode', '.git', '.env', '.gitignore', '.travis.yml', 'tests', ...
              '*docker-compose.yml', 'LICENSE', 'matlab.prf', 'package.m', ...
              'README.md'}, ...
             @() ghtb.version, ...
             {'+ghtb'});
ghtb.package('mym', ...
             'Raphael Guzman', ...
             'raphael.h.guzman@gmail.com', ...
             'MySQL API for MATLAB with support for BLOB objects', ...
             'long description', ...
             {'mexa64/libmysqlclient.so.18.4.'}, ...
             @() strjoin(arrayfun(@(x) num2str(x), ...
                                  cell2mat(struct2cell(mym('version'))), ...
                                  'uni', false), ...
                         '.'), ...
             {'distribution/mexa64', 'distribution/mexmaci64', ...
              'distribution/mexw64'}, ...
             'toolboxVersionDir', 'distribution/mexa64', ...
             'toolboxRootDir', 'distribution');
ghtb.version % display GHToolbox version

Installation

(Recommended) Greater than R2016b

  1. Utilize MATLAB built-in GUI i.e. Top Ribbon -> Add-Ons -> Get Add-Ons
  2. Search and Select GHToolbox
  3. Select Add from GitHub

Less than R2016b

  1. Utilize MATLAB built-in GUI i.e. Top Ribbon -> Add-Ons -> Get Add-Ons
  2. Search and Select GHToolbox
  3. Select Download from GitHub
  4. Save GHToolbox.mltbx locally
  5. Navigate in MATLAB tree browser to saved toolbox file
  6. Right-Click and Select Install
  7. Select Install

From Source

  1. Download GHToolbox.mltbx locally
  2. Navigate in MATLAB tree browser to saved toolbox file
  3. Right-Click and Select Install
  4. Select Install