buildnis 0.1.11
A distributed, platform independent build system that can handle C++20 modules and Fortran modules (and should be flexible enough to build anything else).
Requires Python: >=3.9
Keywords: build,build system,C++,Fortran

# Buildnis

[![MIT license badge](https://img.shields.io/github/license/Release-Candidate/Buildnis)](https://github.com/Release-Candidate/Buildnis/blob/main/LICENSE)
[![Python version badge](https://img.shields.io/pypi/pyversions/buildnis)](https://www.python.org/downloads/)
[![PIP version badge](https://img.shields.io/pypi/v/buildnis)](https://pypi.org/project/buildnis/)
[![ReadTheDocs badge](https://readthedocs.org/projects/buildnis/badge/?version=latest&style=flat)](https://buildnis.readthedocs.io/en/latest/)
[![Code Climate Maintainability badge](https://api.codeclimate.com/v1/badges/c5e672a62eeaba8e6fdf/maintainability)](https://codeclimate.com/github/Release-Candidate/Buildnis/maintainability)
[![DeepSource Issue badge](https://deepsource.io/gh/Release-Candidate/Buildnis.svg/?label=active+issues&show_trend=true)](https://deepsource.io/gh/Release-Candidate/Buildnis/?ref=repository-badge)
[![Codecov badge](https://codecov.io/gh/Release-Candidate/Buildnis/branch/main/graph/badge.svg?token=E26YQKPZ0E)](https://codecov.io/gh/Release-Candidate/Buildnis)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Black action badge](https://github.com/Release-Candidate/Buildnis/actions/workflows/black.yml/badge.svg)](https://github.com/Release-Candidate/Buildnis/actions/workflows/black.yml)
[![Flake8 badge](https://github.com/Release-Candidate/Buildnis/actions/workflows/flake8.yml/badge.svg)](https://github.com/Release-Candidate/Buildnis/actions/workflows/flake8.yml)
[![Pycodestyle badge](https://github.com/Release-Candidate/Buildnis/actions/workflows/pycodestyle.yml/badge.svg)](https://github.com/Release-Candidate/Buildnis/actions/workflows/pycodestyle.yml)
[![Pydocstyle badge](https://github.com/Release-Candidate/Buildnis/actions/workflows/pydocstyle.yml/badge.svg)](https://github.com/Release-Candidate/Buildnis/actions/workflows/pydocstyle.yml)
[![Pyflakes badge](https://github.com/Release-Candidate/Buildnis/actions/workflows/pyflakes.yml/badge.svg)](https://github.com/Release-Candidate/Buildnis/actions/workflows/pyflakes.yml)
[![Bandit badge](https://github.com/Release-Candidate/Buildnis/actions/workflows/bandit.yml/badge.svg)](https://github.com/Release-Candidate/Buildnis/actions/workflows/bandit.yml)
[![Linux action badge](https://github.com/Release-Candidate/Buildnis/actions/workflows/linux.yml/badge.svg?branch=main)](https://github.com/Release-Candidate/Buildnis/actions/workflows/linux.yml)
[![OS X action badge](https://github.com/Release-Candidate/Buildnis/actions/workflows/osx.yml/badge.svg)](https://github.com/Release-Candidate/Buildnis/actions/workflows/osx.yml)
[![Windows action badge](https://github.com/Release-Candidate/Buildnis/actions/workflows/windows.yml/badge.svg)](https://github.com/Release-Candidate/Buildnis/actions/workflows/windows.yml)
[![Tests Ubuntu 20.04 badge](https://github.com/Release-Candidate/Buildnis/actions/workflows/linux_test.yml/badge.svg)](https://github.com/Release-Candidate/Buildnis/actions/workflows/linux_test.yml)
[![Tests Mac OS X latest badge](https://github.com/Release-Candidate/Buildnis/actions/workflows/osx_test.yml/badge.svg)](https://github.com/Release-Candidate/Buildnis/actions/workflows/osx_test.yml)
[![Tests Windows 2019 badge](https://github.com/Release-Candidate/Buildnis/actions/workflows/windows_test.yml/badge.svg)](https://github.com/Release-Candidate/Buildnis/actions/workflows/windows_test.yml)

Distributed, platform independent build system that can handle C++20 and Fortran modules and is flexible enough to build any language and handle (almost ;) any build step imaginable.

## Table of Contents

- [Buildnis](#buildnis)
  - [Table of Contents](#table-of-contents)
  - [Installation and Usage](#installation-and-usage)
    - [Installation](#installation)
      - [Using a Virtual Environment](#using-a-virtual-environment)
      - [Installation of Buildnis](#installation-of-buildnis)
    - [Usage](#usage)
  - [Bug Reports and Feature Requests](#bug-reports-and-feature-requests)
  - [Contributing to the Project](#contributing-to-the-project)
  - [Project Websites](#project-websites)
  - [Changelog](#changelog)
  - [License](#license)

## Installation and Usage

You need at least Python 3.9, no older version works.

### Installation

#### Using a Virtual Environment

I _highly_ recommend that you use a virtual environment using [virtualenv](https://virtualenv.pypa.io/en/latest/) to check out Buildnis.
First install the package `virtualenv` using `pip`:

```shell
python -m pip install virtualenv
```

then you set up a directory to use as the path for your virtual Python environment:

```shell
python -m virtualenv PATH_TO_YOUR_VENV
```

with `PATH_TO_YOUR_VENV` the directory, in which you want to install the virtual environment. This should generate a script to source (on Linux, OS X and other unixish platforms) or execute (Windows). So, on Windows call

```shell
PATH_TO_YOUR_VENV\Scripts\activate.bat
```

 on Unixes you source the activation script using

```shell
source PATH_TO_YOUR_VENV/bin/activate
```

 If you now install the packages, they're installed in this virtual environment and can't break your 'real' Python installation.

When you want to leave the virtual environment, call the script `deactivate`. More detailed documentation of `virtualenv` you find at [Virtualenv User Guide](https://virtualenv.pypa.io/en/stable/user_guide.html)

#### Installation of Buildnis

You can install Buildnis using pip: `python -m pip install buildnis`.

To upgrade your installed version use `python -m pip install --upgrade buildnis`

### Usage

The best way to test Buildnis is to check out the test project from Github: [Test Project on Github](https://github.com/Release-Candidate/Buildnis/tree/main/test_project) and run Buildnis there:

`python -m buildnis --generated-conf-dir conf_out test_project\project_config.json`

This reads the project's configuration `test_project\project_config.json` and stores all generated configurations to the directory `conf_out`.

If you want to delete the generated configuration files, call the program with the option `--distclean`:

`python -m buildnis --distclean`

To get an overview of all supported command-line options and arguments call Buildnis with the argument `-h` or `--help`:

`python -m buildnis --help`

The supported command-line options and arguments:

``` text
usage: python -m buildnis [-h] [--version] [--log-file LOG_FILE] [-q | -v | --debug] [--generated-conf-dir DIR_PATH] [--configure] [--build [TARGET ...]] [--install [TARGET ...]]
                   [--clean] [--distclean]
                   [PROJECT_CONFIG_FILE]

Buildnis is a build system used to build software.

Examples:

    To build using the default config file "./project_config.json":
        python buildnis.py

        This is the same as:
        python buildnis.py ./project_config.json

    To load the project config file in the directory 'local_test':
        python buildnis.py local_test\project_config.json

    To configure the build system:
        python buildnis.py --configure

    To build the default targets:
        python buildnis.py --build

    To build the targets named 'executable' and 'library':
        python buildnis.py --build executable library

        This is the same as
        python buildnis.py --build executable --build library

    To install the default targets:
        python buildnis.py --install

    To install the targets named 'executable' and 'library':
        python buildnis.py --install executable library

        This is the same as
        python buildnis.py --install executable --install library

    To clean up, delete all files generated by the build:
        python buildnis.py --clean

    To delete the generated configuration too:
        python buildnis.py --distclean

positional arguments:
  PROJECT_CONFIG_FILE   path to the project config JSON file to use for the build. If no file is given, the default: "./project_config.json" is used

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit

Logging options:
  Options that are about logging

  --log-file LOG_FILE   If this is set, the program writes verbose messages to LOG_FILE, does not change output to the console. Default is none.
  -q, --quiet           Run quiet, only output error messages.
  -v, --verbose         Increase verbosity of the program, get more messages. Can be used more than once, like "-vv"
  --debug               Set logging level to the highest available, the same as "-vv"

Output:
  Sets options for the generated files

  --generated-conf-dir DIR_PATH
                        The directory in which the autogenerated configuration files will be stored. Default: the same directory the project config PROJECT_CONFIG_FILE is in.

Phases of the build:
  Only run one of the phases of a full build.

  --configure           Configure the project.
  --build [TARGET ...]  Build the project. If a list of targets is given, these targets are build. The default is to build the default target.
  --install [TARGET ...]
                        Install the given targets. If no target is given, installs the project's default target.
  --clean               Clean the project. Deletes all files and directories generated during the build.
  --distclean           Start from scratch, delete generated configuration. Deletes all files and directories generated during the build and the configuration.

See website https://github.com/Release-Candidate/Buildnis for a detailed description.

```

## Bug Reports and Feature Requests

Please use the [GitHub issue page](https://github.com/Release-Candidate/Buildnis/issues/new/choose) to file bug reports or feature requests.

There you also find the issue tracker: [GitHub issues](https://github.com/Release-Candidate/Buildnis/issues)

## Contributing to the Project

See file [CONTRIBUTING.md](https://github.com/Release-Candidate/Buildnis/blob/main/CONTRIBUTING.md) for details.

## Project Websites

Main project website containing the source code at [GitHub](https://github.com/Release-Candidate/Buildnis)

Documentation at [Read the Docs](https://buildnis.readthedocs.io/en/latest/)

The PyPI (pip) package at [PyPI package](https://pypi.org/project/buildnis/)

Report a bug or feature request at [GitHub report issue](https://github.com/Release-Candidate/Buildnis/issues/new/choose)

Bug and other requests tracker at [GitHub issue tracker](https://github.com/Release-Candidate/Buildnis/issues)

## Changelog

See file [CHANGELOG.md](https://github.com/Release-Candidate/Buildnis/blob/main/CHANGELOG.md)

## License

Buildnis is licensed under the MIT license, see file [LICENSE](https://github.com/Release-Candidate/Buildnis/blob/main/LICENSE).