Skip to main content

The Craftr build system

PyPI Version CII Best Practices

Craftr is a meta build system based on Python 3 scripts which produces Ninja build manifests. It enforces the use of modular build definitions that can be re-used easily and ships with a standard library supporting various programming languages and common libraries.

Features

  • [x] Aims to be cross-platform compatible (regularly tested on Windows, Mac OS and Linux)

  • [x] Build definitions divided into versioned modules

  • [x] Embedd actual Python functions into the build process (keyword Tasks)

  • [x] Dependency-lock files for fully reproducible builds

  • [ ] Package manager (hosted on Craftr.net)

Basic Usage

$ craftr version                            # Print Craftr version and exit
$ craftr export                             # Generate Ninja manifest
$ craftr build [target [target [...]]]      # Build all or the specified target(s)
$ craftr clean [-r] [target [target [...]]] # Clean all or the specified target(s)
$ craftr startpackage <name> [directory]    # Start a new Craftr project (manifest, Craftrfile)
$ craftr lock                               # Generate a .dependency-lock file (after craftr export)

C++ Example

cxx = load('craftr.lang.cxx')
program = cxx.executable(
  inputs = cxx.compile_cpp(sources = glob('src/**/*.cpp')),
  output = 'main'
)

Java Example

java = load('craftr.lang.java')
jar = java.jar(
  inputs = java.compile(src_dir = local('src')),
  output = 'myapp',
  entry_point = 'Main'
)

C# Example

cs = load('craftr.lang.csharp')
app = cs.compile(
  sources = glob('src/**/*.cs'),
  output = 'Main',
  target = 'exe'
)

Cython Exmple

cython = load('craftr.lang.cython')
primes = cython.project(
  sources = [local('Primes.pyx')],
  main = local('Main.pyx')
)
run = runtarget(primes.main)

How to Contribute

Please create an Issue if you have any questions, problems or feature requests.

Installation

Make sure you specify the specific version you want to install since there is no untagged version of Craftr 2.x available on PyPI yet and otherwise Pip will install Craftr 1.x (which is quite different). To get the newest stable version of Craftr 2, use

$ pip install craftr-build==2.0.0

To get the cutting edge development version, I suggest installing Craftr from the Git repository into a virtualenv.

$ virtualenv -p python3 env && source env/bin/activate
$ git clone https://github.com/craftr-build/craftr.git -b development
$ cd craftr
$ pip install -e .

Requirements

Python Dependencies (automatically installed)

License

The Craftr build system
Copyright (C) 2016  Niklas Rosenstein

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

For more information, see the LICENSE.txt file.

Metadata

Release files for craftr-build 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for craftr-build 2.0.0
File Size Uploaded Provenance Actions
craftr-build-2.0.0.zip 396.2 kB Without provenance Details for craftr-build-2.0.0.zip

Release files / craftr-build-2.0.0.zip

Download URL craftr-build-2.0.0.zip
Size 396.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e4d9cefa27a68a87b6717deb7cbc88482b5e854a852509734ad544877978ccab
BLAKE2b-256 checksum
How to use checksums
101e56d8d3b9ac2dafd6a4407dc7ba683a1375cde10880a4b4b6e7397b151b1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for craftr-build 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page