aidebuild

Builds multi-language packages and related documentation

AIDE API docs

Description

This packages provides utilities to develop multi-language modular tools for web based applications.

  • It is based on the npmjs package system and on the git versioning system.

  • This and all related packages are distributed under CECILL-C (a GNU GPL compatible licence adapted also to European regulation rules) and CC-BY (for the documentation and media resources) licences.

  (open in new tab)

Manifest

This open-ended packages target who knows programming and how to install software, using command line terminal, to avoid any non necessary opaque, when not spurious, user interface overload.

What is shared here is essentially existing software usage: hours of foraging and testing in order to find the best tools and best tool's options is simply horded in the documented scripts and makefile.

Focus is put on the documentation: good developers write the documentation before the code, explicitizing what is to be done, before doing it, don't they? Several standard existing software are summoned via make actions to this end.

Another way to save time is to have scripted the generation of certain files (e.g., the README); nothing clever, just avoiding copy-paste time and mistake when the package evolves.

It also offers an alternative to non pythonolic (i.e., Python addicted), but agnostic developers that are not frighten of using the best adapted language for their purpose.

Technical choices

The code is expected to be a set of C/C++ and JavaScript source files, while a Python wrapper is available.

  • JavaScript for web development.
  • C/C++ for efficient parts of the code
  • Python to allow a maximal number of person to use it.

As a web service, it implements a local node.js server, and wrap C/C++ code using the node-addon-api, as defined the aideweb package.

The documentation uses markdown syntax and JsDoc tags, with the jsdoc mechanism and the docdash theme. Documentation generation includes source files normalization (i.e., beautifying or uncrustification), multi-language documentation generation and production of images or PDF from LaTeX formula or latex or libreoffice drawing files.

Coding rules

A few simple coding rules allows multi-language development to be smooth and easy.

Notion of factory

When object oriented programming is not necessary, static methods are encapsulated in "factories", i.e., group of functions, accessible via the factory name, e.g., aidesys::regexMatch(string, regex); in C++ or slugstring.fill(dictionary); in JavaScript, thus without class object instance.

  • Naming conventions:

    • Factory names are all in lower-case.
    • Static method names are verbs, in lower-case. Compounded names use the camelCase convention.
    • Static methods parameters names are nouns. Compounded parameters names hyphenation use the underscore _ hyphen, including JSON tuples data names.
  • Parameters type:

    • Boolean bool, integer int (or uint if unsigned), double (for floating point values) and string are the used scalar values (i.e. literals).
    • Otherwise, parameters are objects, defined via classes.

Notion of Classes

  • For multi-language call, classes better use:

    • Parameter-less constructor (which is fine also for internal language use).
    • Setters: i.e., set(value) method to set the whole object, and set(name, value) to set an object parameter.
    • Getters: i.e., get(name) or getName() method to get an object parameter or isName() to get a boolean value parameter.
      • The at(name) method does not create a default value while the get(name) may create an entry for this parameter (in coherence with a subscript [] operator.
      • The object size() or count() methods are not prefixed by get in coherence with the main usage.
    • Casters: e.g., asString() to get the whole representation as a string (with similar convention for other convention).
  • Naming conventions:

    • Class names are nouns, instance names are verbs. Compounded names use the camelCase convention, methods parameters are nouns, using underscore _ hyphen.
    • The toString() method is prohibited, because of Python wrapping.

Package repository

Installation

User simple installation

  • npm install git+https://gitlab.inria.fr/line/aide-group/aidebuild.git

Co-developper installation

Please refer to the installation guide for installation.

Usage

npm script usage

npm install --quiet : installs all package dependencies and sources.
npm run build: builds the different compiled, documentation and test files.
npm test     : runs functional and non-regression tests.
npm run clean: cleans installation files.

Dependencies

Author