cwe

Tuesday, Oct 23, 2018

cwe

… is a tool to build software within a mono repository. Though you might use cwe to run the build it self it is best combined with another build tool like task or make.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

cwe is build with Go. So you need to have a Go environment up and running. Support for Go with modules is planned but not in place. See Go’s Getting Started to setup your Go environment.

Installing

To get the code of cwe you can run go get:

go get -u github.com/monobuild/cwe

Within $GOPATH/src/github.com/monobuild/cwe you should be able to run a test:

go run cmd/cwe/main.go

Deployment

You can download the binary from the releases page or use the deb package to install it on a Debian system.

Usage

How does cwe work

Let’s start with a sample:

cwe --extra-env a=b c=d -- echo ${TEST} ${a} ${c}

with a .cwe.env containing the following data:

env:
  TEST: "Hello world!"

the result is:

Hello World! b d

Command line parameters

--extra-env allows to add an additional environment variable using the commandline

--quiet makes cwe no printing out own information

Pass -- before the real command to have cwe not parsing program’s argument

What is in a .cwe.env file

The .cwe.env file contains a dictionary named env and is serialized in YAML ( Yet Another Markup Language ).

Windows

On Windows the file is called _cwe.env