Documentation

Read the latest documentation to see what Valder can do for you.

Code

Get the latest source code, create pull request, comment changesets.

Documentation

Introduction

Valder the Vala code welder is intended to be a general purpose build tool dedicated for Vala language based projects. We try to keep Valder as simple and intuitive as possible mantaining it's elastic and quite powerful design.

Valder is loosely inspired by Maven build tool for Java using only it's general idea of plugins based architecture.

Build recipe

Having in mind further extensions and code readibility Valder introduces a common structure holding all data necessary to build an application with some gap left for custom extensions.

This structure, called later Recipe, consists of several essential elements describing whole build project:

Project information
Basic project information
Section covers some basic project information like name, version, etc
Source code
Set of source code files both for library and runtime compiled binary
Project dependencies
Consists of all dependend libraries
Plugins configuration
A substructure with set of configuration entries for each of instantiated plugin.

In usual situations recipe structure is used internally by Valder and Valder plugins to fill project information in as much as possible automatic manner. Just before running build phase Valder scans current working directory for a configuration file.

Whole recipe is deserialized from recipe file - recipe.bob. This is just a simple JSON file with very meaningful structure.

Work in progress
{ "project": { "name": "Test project", "shortName": "test", "version": "0.0.1", "sources": { "library": [ "./src/library/vala/Test.vala" ], "runtime": [ "./src/main/vala/TestMain.vala" ] }, "dependencies" : [ { "dependency" : "glib", "version" : "2.0" }, { "dependency" : "gobject", "version" : "2.0", "scope" : "both" }, { "dependency" : "gee", "version" : "0.8", "scope" : "library" }, { "dependency" : "gtk+", "version" : "3.0", "scope" : "runtime" } ] }, "plugins": { "collect-sources": { "verbose": true }, "build": { "verbose": false } } }

Valder project structure

Every project that is using Valder as a build tool has to share the same meaningful structure with source code located under appropriate folders:

src
All the source code files, the Input.
library
vala
Place all the Vala files here for a library related source code.
vapi
Holds all VAPI files referenced in library source code.
c
Holds all C files referenced in library source code. Also stores all H files generated by Valder in process of library code compilation.
main
vala
Whole source code located here is treated as runtime executable binary related.
vapi
Holds all VAPI files referenced in runtime executable binary source code.
target
Directory holds all files produced by Valder plugins, the Output.
lib
This directory contains project library binary (.so) generated by Valder in process of library code compilation. Here lands also every library (.so) file that is directly referenced as dependency and could not be found in system libraries.
gir
Specific to build plugin only - when generateGir is set to true directory will contain a library GIR bindings file generated in compile time.
plugins
Directory consists of a set of Valder plugins (.so) files. This one is applicable to Valder project only.

Plugins and recipies

As stated earlier Valder design is created around a Plugin based approach, where each plugin, called later Plugin, is responsible for performing a dedicated action on a set of project source code files. Here you can find a list of plugins shipped with Valder distribution package:

initialize:structure

First plugin used to initialize contents of a new Valder project. It's intented to be used on empty project directory by creating it's default structure. Plugin honors all directories specified in "Valder project structure". Plugin is totally safe and wont harm your current filesystem hierarchy.

Plugin configuration options

Work in progress
{ "project": { ... }, "plugins": { "initialize:structure": { "verbose": false } } }

Usage demonstration

initialize:recipe

This particular plugin is shipped with mechanism for creating an empty project recipe file with some default entries filled in. One can easily generate new recipe with some basic data like project name, version, base PKG Glib dependencies and so on.

Plugin configuration options

Work in progress
{ "project": { ... }, "plugins": { "initialize:recipe": { "verbose": false } } }

Usage demonstration

collect-sources

Plugin aims to traverse recursively through project directory structure and collect a list of Vala source code files. Then the list is strored in project properties available for other plugins.

Plugin configuration options

Work in progress
{ "project": { ... }, "plugins": { "collect-sources": { "verbose": false } } }

Usage demonstration

build

It's basically a refactored ValaCompiler source code tuned a little bit to fit Valder architecture. It uses Vala source code files found by collect-sources plugin and goes through Vala compiler procedure (generating C code, GIR bindings, VAPI files, etc). Usualy you will use this plugin together with collect-sources.

Plugin configuration options

{ "project": { ... }, "plugins": { "build": { "verbose": false, "debug": false, "generate-gir": false, } } }

Usage demonstration

repository:install

Work in progress

repository:scan

Work in progress

repository:copy-libs

Work in progress

debian:package

Work in progress

debian:package-dev

Work in progress

uncrustify

Work in progress

Installation

Bulding Valder using shell scripts

Valder source code package comes together with several shell scripts used to build Valder library and runtime binaries. Because Valder package does not contain compiled binaries you have to do it on your own but only once, Valder is capable of building it's source code with ... itself ;)

First we need to generate Valder library file, go and execute following shell script:

$/valder-source-code> ./build-library.sh

If everything goes fine you will see a libvalder.so library file under target/lib folder. After library has been successfuly generated you can now proceed the similar operation with runtime binary, just run the command:

$/valder-source-code> ./build-cmdline.sh

This one will result with a new runtime binary file located under target/valder

When you are done with the base binaries you can go and build some plugins shipped with Valder package. You can find a number of plugins directories listed in main Valder directory:

plugin-collect-sources
plugin-build
plugin-init
plugin-repository
plugin-uncrustify

Each directory consists of a set of plugin source files in a directory structure compatible with Valder. To compile a plugin source code run a dedicated script located in each plugin directory:

$/plugin-directory> ./build.sh

Repeat the same script invocation for all plugins you are going to use and after library file for each of plugin is generated you can now copy them over to Valder plugins directory by using provided shell script:

$/valder-source-code> ./update-plugins.sh

Questions and Answers

Why another build tool? Isn't make, Cmake, waf or any other out there enough?
Short answer is: nope. Every tool that already exists like make or Cmake isn't dedicated for Vala but rather for C/C++ code. Besides, configuration scheme for any of those build tools is greately complicated. Valder is here to make it easier and fit better for Vala.
I have an idea for a new possible tool, how can I contribute?
If you are familiar with Vala (or Java or C#) have a look at example tools available at source code repository on GitHub. If you don't know how do code - please post me a message or create a GitHub issue with short description, I could think of it in spare time.
Star Valder the Vala code welder Follow @activey