Code Monkey home page Code Monkey logo

build's Introduction

SYNOPSIS

Build is an opinionated c++ build-tool. It uses git and node.js. It's made for use with the datcxx project.

MOTIVATION

C++ build tools and package managers are highly ambitious and try to solve a larger set of problems than needed for this project. Let's make something that...

  • Uses a subset of package.json.
  • No semver, or package-locks, use git commit hashes.
  • No login, no users, no analytics, no fancy features.

INSTALL

npm install -g datcxx/build

USAGE

All projects must have a package.json.

build -h

INIT

Use the init command to automatically create a package.json file.

build init

ADD DEPENDENCY

Use the add command to add a dependency.

build add foo/bar

Adding a dependency with a hash will lock the dependency and install that exact commit at install-time. Without a hash, the dependency will get assigned the latest commit hash of the remote at install-time.

build add foo/bar ceda12f

INSTALL DEPENDENCIES

Use the i command to recursively install dependencies.

build i

BUILD YOUR PROJECT

To build your project, don't specify any commands just type build. Use the DEBUG=true environment variable if you want to print what the compiler is being asked to do.

build

When no command is specified, all flags are passed to the compiler. For example following flags are sent to the compiler.

build -g -O0

PACKAGE.JSON

FIELDS

name

Name is required. But unlike npm the name and version do not create a unique identity in the world for your package. In fact, version is not used at all.

description

Put a description in it. It’s a string. This helps you remember what the package does.

files

A list of files to include. Nothing is included by default. Does not currently support globs.

repository

A string that specifies the place where the code lives. This is helpful for people who want to contribute.

scripts

The “scripts” property is a dictionary containing script commands that are run at various times in the lifecycle of your package. The key is the lifecycle event, and the value is the command to run at that point. The following scripts are supported.

  • install Run AFTER the package is installed.
  • test Run by the npm test command.

You can also create your own arbitrary scripts and run them with the command build run <script-name>.

EXAMPLE

{
  "name": "hypercore",
  "description": "Hypercore is a secure, distributed append-only log.",
  "repository": "[email protected]:datcxx/cxx-hypercore.git",
  "dependencies": {
    "[email protected]:datcxx/cxx-flat-tree": "c051eac4"
  },
  "scripts": {
    "test": "c++ -std=c++2a test/index.cxx lib/hypercore.so -o test/index && ./test/index",
    "greeting": "echo Hello, World"
  },
  "flags": [
    "-shared",
    "-o ./lib/hypercore.so",
    "-std=c++2a",
    "-ferror-limit=2"
  ],
  "files": [
    "index.hxx",
    "index.cxx"
  ]
}

TODO

Nice to have - as of now there is no caching strategy.

build's People

Contributors

heapwolf avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.