From 94a80090bffd42b682e8b1921fc9e439438ead86 Mon Sep 17 00:00:00 2001 From: Cameron Moore Date: Fri, 26 Oct 2018 01:46:31 -0500 Subject: [PATCH] feat(build): add windows and osx builds to Travis (#224) Simplify Makefile in the process. Fixes #223 Fixes #225 --- .travis.yml | 15 ++++++++++----- Makefile | 31 ++----------------------------- 2 files changed, 12 insertions(+), 34 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0e40b13e..6faa3e52 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,25 +1,30 @@ dist: trusty sudo: false -install: - - make install-devtools - - make deps - language: go go: - # - 1.7.x (abandonned - not supported by dep) - "1.8.x" - "1.9.x" - "1.10.x" - "1.11.x" - tip +os: + - linux + - osx + - windows + matrix: fast_finish: true allow_failures: - go: tip +install: + - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then git config --global core.autocrlf true ; fi + - make install-devtools + - make deps + script: # verify that the commit code for the parser was optimized during the code generation - make verify-parser diff --git a/Makefile b/Makefile index 42230f8e..86365897 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,10 @@ # Makefile for the `libasciidoc` project # tools -GIT_BIN_NAME := git -GIT_BIN := $(shell command -v $(GIT_BIN_NAME) 2> /dev/null) -DEP_BIN_NAME := dep -DEP_BIN := $(shell command -v $(DEP_BIN_NAME) 2> /dev/null) -PIGEON_BIN_NAME := pigeon -PIGEON_BIN := $(shell command -v $(PIGEON_BIN_NAME) 2> /dev/null) -GO_BIN_NAME := go -GO_BIN := $(shell command -v $(GO_BIN_NAME) 2> /dev/null) -EXTRA_PATH=$(shell dirname $(GO_BINDATA_BIN)) - CUR_DIR=$(shell pwd) -TMP_PATH=$(CUR_DIR)/tmp INSTALL_PREFIX=$(CUR_DIR)/bin VENDOR_DIR=vendor SOURCE_DIR ?= . -SOURCES := $(shell find $(SOURCE_DIR) -path $(SOURCE_DIR)/vendor -prune -o -name '*.go' -print) COVERPKGS := $(shell go list ./... | grep -v vendor | paste -sd "," -) DEVTOOLS=\ @@ -75,30 +63,15 @@ install-devtools: deps: $(VENDOR_DIR) $(VENDOR_DIR): - $(DEP_BIN) ensure + dep ensure $(INSTALL_PREFIX): # Build artifacts dir @mkdir -p $(INSTALL_PREFIX) -$(TMP_PATH): - @mkdir -p $(TMP_PATH) - .PHONY: prebuild-checks ## Check that all tools where found -prebuild-checks: $(TMP_PATH) $(INSTALL_PREFIX) -ifndef GIT_BIN - $(error The "$(GIT_BIN_NAME)" executable could not be found in your PATH) -endif -ifndef DEP_BIN - $(error The "$(DEP_BIN_NAME)" executable could not be found in your PATH) -endif -ifndef PIGEON_BIN - $(error The "$(PIGEON_BIN_NAME)" executable could not be found in your PATH) -endif -ifndef GO_BIN - $(error The "$(GO_BIN_NAME)" executable could not be found in your PATH) -endif +prebuild-checks: $(INSTALL_PREFIX) .PHONY: generate ## generate the .go file based on the asciidoc grammar