drud/build-tools

Name: build-tools

Owner: DRUD

Description: Build tools for inclusion in other projects for standard approach to building

Created: 2017-01-29 17:42:56.0

Updated: 2017-07-26 17:53:50.0

Pushed: 2018-02-21 22:07:17.0

Homepage:

Size: 139

Language: Makefile

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build tools for standard makefile

These build tools live at https://github.com/drud/build-tools. If you are viewing this README in any other repository, it's important to know that modifications should never be made directly, and instead should be made to the base repository and pulled in via the instructions below.

These tools add standard components (sub-makefiles and build scripts) as well as example starters for the Makefile and .circleci/config.yml.

Add build-tools for the first time to a Makefile

Download the build_updates.sh script and run it in the directory where the build-tools should be added.

Update build-tools directory from this repository using subtree merge

Download the latest build_updates.sh and run it in the build-tools directory:

uild-tools
 -O build_updates.sh https://raw.githubusercontent.com/drud/build-tools/master/build_update.sh
d +x build_update.sh
ild_update.sh
Set up a Makefile to begin with
Additional chores when installing:
Basic targets and capabilities

Using this base will allow you to build with standard targets like build, test, container, push, clean:


 linux
 darwin
 gofmt
 govet
 govendor
 golint
 codecoroner
 static (gofmt, govet, golint, govendor)
 test
 container
 push
 VERSION=0.3.0 container
 VERSION=0.3.0 push
 clean

On Windows, using the tools described below, use the command:

Program Files\git\bin\bash" -c "make"
Program Files\git\bin\bash" -c "make test"
Program Files\git\bin\bash" -c "make test TESTARGS='-run TestSomething'"
Program Files\git\bin\bash" -c "make gofmt"

If you're using Powershell instead of cmd, just prepend an & on the command, as in:

\Program Files\git\bin\bash" -c "make"

(Note that if you're working with the code, you can just run git bash and do make (and anything else you want) from inside it.)

Installed requirements

You'll need:

On windows the building is somewhat more difficult due to the build being bash/linux/make-oriented, but support is provided. You need:

(You can certainly install the base gnu make package, and the traditional git for windows package should work fine. Chocolatey installs are recommended here because there are many, many ways to get mixes of unix-style components that absolutely don't work. Microsoft's lovely bash-for-windows is a great tool, but it's an actual Ubuntu environment so isn't a good place for testing Windows builds.)

Golang compiler component

golang projects and static analysis functions like gofmt are built in a container from drud/golang-build-container (from https://github.com/drud/golang-build-container). The version of the container is specified in build-tools.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.