Giter Site home page Giter Site logo

cook's Introduction

โ„๏ธ Development is paused for now but may be resumed in the future.

โšก This software is currently in alpha and not ready for production use.

โค๏ธ Contributions to this project are very welcome!

Overview

Cook is an extensible, dynamic, parallel and cross-platform build system. It is based on the concept that writing build definitions should be as powerful and easy as possible, which is why everything in Python. While many other systems may be slightly faster in benchmarks, we believe that, at least for most projects, these differences do not outweigh the advantages you get by using a more powerful system.

Example

Using the built-in rules is straightforward. You just import the corresponding module and call the supplied rule. This is all you need to get a working build going. The following example will automatically work on any supported platform.

from cook import cpp

cpp.executable(
    sources=['main.cpp'],
    destination='main'
)

Executing this script will build an executable using the correct platform-specific details. For example, the output is either named main or main.exe depending on the operating system.

$ ls
BUILD.py  main.cpp  main.h
$ cook
[  0%] Compile main.cpp
[ 50%] Link build/main
[100%] Done.
$ ls build/
main

You can also easily create your own rules. Upon calling, they are executed until the required information is passed back to the system using yield core.publish(...). Everything after that is executed shortly after if the system decides it is necessary to do so.

from cook import core

@core.rule
def replace(source, destination, mapping):
    source = core.resolve(source)
    destination = core.build(destination)

    yield core.publish(
        inputs=[source],
        message='Generating {}'.format(destination),
        outputs=[destination],
        check=mapping
    )

    with open(source) as file:
        content = file.read()
    for key, value in mapping.items():
        content = content.replace(key, value)
    with open(destination, 'w') as file:
        file.write(content)

Please look at the documentation if you want to know more.

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.