Skip to content

Commit

Permalink
feat(build): add windows and osx builds to Travis (#224)
Browse files Browse the repository at this point in the history
Simplify Makefile in the process.

Fixes #223
Fixes #225
  • Loading branch information
moorereason authored and xcoulon committed Oct 26, 2018
1 parent e029040 commit 94a8009
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 34 deletions.
15 changes: 10 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
31 changes: 2 additions & 29 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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=\
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 94a8009

Please sign in to comment.