Pyke is a build tool that can be used to generate any kind of artifacts in small, medium or large projects.
This tool has the same purpose as make, cmake, ant, maven, scons, jam, ninja, ..., but using a slightly different approach.
Pyke aims to be easy to use, easy to extend, multi-platform and fast! Your job is to create things, Pyke’s job is to make your life easier.
I needed an extremely fast built tool that was really easy to use and extend and was able to generate builds in multiple platforms and multiple languages. I tried some build tools but none of them offered what I was looking for, so... pyke was born as a side-project.
The aim is to help you improve productivity.
At this point, if you already know what a build tool is, consider skipping the rest of the section and moving to one of the following sections: Pyke’s features or the getting-started or the Quick Start section.
Before starting with the basic concepts, it might be helpful to start asking why a build tool is useful in the first place. If you think about it, a build tool is useful for executing a list of commands in order to build a project in a deterministic way.
Given this basic definition you might be tempted to ask...
No way!! Are you crazy? Yes, sure, you can do it. You can use a shell script to automate a build, but most of the times this is a really bad idea.
Here are some of reasons for using a build tool instead of a shell script:
Using a build tool is always the right choice if you need a deterministic way of creating some deliverables for your project, either personal, open source or commercial.
Usually build tools are used when you have to compile files or build applications, but you will also benefit from a build tool even if you are creating a web site. For example, in the case of a website, it might handle CSS/JS compression, unit tests, creating an artifact, and even deploying it to production server.
Just to give an example, let’s say you have a really simple C++ project with the following structure:
+ project/
+ src/
- main.cc
- file.cc
- string.cc
+ inc/
- file.h
- string.h
Imagine you want to generate the executable ‘app’ under ‘bin’ folder from this set of files.
Using a shell script and compiling with GCC you would write something like this:
mkdir out/
g++ -c -o out/main.o -Iinc/ main.cc
g++ -c -o out/file.o -Iinc/ file.cc
g++ -c -o out/string.o -Iinc/ string.cc
mkdir bin/
g++ -o bin/app out/*.o
Now, every time you run this script, it will run all the commands, even if no files have changed. Compare that script with the equivalent pyke file:
from pyke.tools.default import *
objects = cc ('src/*.cc', include = 'inc/')
app ('bin/app', objects)
Keep in mind that the pyke file only builds things once (when the sources or header files have been modified) and parallelizes all the commands whenever possible. It automatically detects dependencies so it can parallelize everything automatically, without you having to figure out how to do it. Even more, if the code is portable, it will be able to compile in Linux, Mac OS or Windows without touching a single line.