aidebuild

Builds multi-language compilation packages and related documentation.

AIDE API docs

Description

This packages provides utilities to develop and publish modular tools for web based applications.

  • It is based on the npmjs package system

Technical choices

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

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