From e766dac21f2baf116ea789d46f46a56c58a2eb4e Mon Sep 17 00:00:00 2001 From: Nils Dijk Date: Mon, 28 Dec 2015 14:49:51 +0100 Subject: [PATCH 1/2] Add rules to generate a thrift-gen release. --- .gitignore | 1 + Makefile | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/.gitignore b/.gitignore index cd7f2ac0..44620d14 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ .DS_Store build Godeps/_workspace +release/ diff --git a/Makefile b/Makefile index 90e0fdf3..9dd668a3 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,9 @@ EXAMPLES=./examples/bench/server ./examples/bench/client ./examples/ping ./examp PKGS := . ./json ./hyperbahn ./thrift ./typed ./trace $(EXAMPLES) TEST_ARG ?= -race BUILD := ./build +RELEASE := ./release +RELEASE_LINUX := $(RELEASE)/linux-x86_64 +RELEASE_DARWIN := $(RELEASE)/darwin-x86_64 SRCS := $(foreach pkg,$(PKGS),$(wildcard $(pkg)/*.go)) export GOPATH = $(GODEPS):$(OLDGOPATH) @@ -32,6 +35,8 @@ packages_test: setup: mkdir -p $(BUILD) mkdir -p $(BUILD)/examples + mkdir -p $(RELEASE_LINUX) + mkdir -p $(RELEASE_DARWIN) get_thrift: scripts/travis/get-thrift.sh @@ -49,6 +54,7 @@ clean: echo Cleaning build artifacts... go clean rm -rf $(BUILD) + rm -rf $(RELEASE) echo fmt format: @@ -108,5 +114,11 @@ thrift_gen: $(BUILD)/thrift-gen --generateThrift --inputFile hyperbahn/hyperbahn.thrift --outputDir hyperbahn/gen-go rm -rf trace/thrift/gen-go/tcollector && $(BUILD)/thrift-gen --generateThrift --inputFile trace/tcollector.thrift --outputDir trace/thrift/gen-go/ +release_thrift_gen: clean setup + GOOS=linux GOARCH=amd64 godep go build -o $(RELEASE_LINUX)/thrift-gen ./thrift/thrift-gen + GOOS=darwin GOARCH=amd64 godep go build -o $(RELEASE_DARWIN)/thrift-gen ./thrift/thrift-gen + tar -czf thrift-gen.tar.gz $(RELEASE) + mv thrift-gen.tar.gz $(RELEASE)/ + .PHONY: all help clean fmt format get_thrift install install_ci packages_test test test_ci vet .SILENT: all help clean fmt format test vet From ea283fc29839c88ddaab700bfb649c05ed883b83 Mon Sep 17 00:00:00 2001 From: Nils Dijk Date: Tue, 29 Dec 2015 11:57:33 +0100 Subject: [PATCH 2/2] rename thrift-gen release directory and address PR comments. --- .gitignore | 2 +- Makefile | 23 +++++++++++------------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 44620d14..0b45c62d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ .DS_Store build Godeps/_workspace -release/ +thrift-gen-release/ diff --git a/Makefile b/Makefile index 9dd668a3..3c81ba4c 100644 --- a/Makefile +++ b/Makefile @@ -5,9 +5,9 @@ EXAMPLES=./examples/bench/server ./examples/bench/client ./examples/ping ./examp PKGS := . ./json ./hyperbahn ./thrift ./typed ./trace $(EXAMPLES) TEST_ARG ?= -race BUILD := ./build -RELEASE := ./release -RELEASE_LINUX := $(RELEASE)/linux-x86_64 -RELEASE_DARWIN := $(RELEASE)/darwin-x86_64 +THRIFT_GEN_RELEASE := ./thrift-gen-release +THRIFT_GEN_RELEASE_LINUX := $(THRIFT_GEN_RELEASE)/linux-x86_64 +THRIFT_GEN_RELEASE_DARWIN := $(THRIFT_GEN_RELEASE)/darwin-x86_64 SRCS := $(foreach pkg,$(PKGS),$(wildcard $(pkg)/*.go)) export GOPATH = $(GODEPS):$(OLDGOPATH) @@ -35,8 +35,8 @@ packages_test: setup: mkdir -p $(BUILD) mkdir -p $(BUILD)/examples - mkdir -p $(RELEASE_LINUX) - mkdir -p $(RELEASE_DARWIN) + mkdir -p $(THRIFT_GEN_RELEASE_LINUX) + mkdir -p $(THRIFT_GEN_RELEASE_DARWIN) get_thrift: scripts/travis/get-thrift.sh @@ -53,8 +53,7 @@ help: clean: echo Cleaning build artifacts... go clean - rm -rf $(BUILD) - rm -rf $(RELEASE) + rm -rf $(BUILD) $(THRIFT_GEN_RELEASE) echo fmt format: @@ -115,10 +114,10 @@ thrift_gen: rm -rf trace/thrift/gen-go/tcollector && $(BUILD)/thrift-gen --generateThrift --inputFile trace/tcollector.thrift --outputDir trace/thrift/gen-go/ release_thrift_gen: clean setup - GOOS=linux GOARCH=amd64 godep go build -o $(RELEASE_LINUX)/thrift-gen ./thrift/thrift-gen - GOOS=darwin GOARCH=amd64 godep go build -o $(RELEASE_DARWIN)/thrift-gen ./thrift/thrift-gen - tar -czf thrift-gen.tar.gz $(RELEASE) - mv thrift-gen.tar.gz $(RELEASE)/ + GOOS=linux GOARCH=amd64 godep go build -o $(THRIFT_GEN_RELEASE_LINUX)/thrift-gen ./thrift/thrift-gen + GOOS=darwin GOARCH=amd64 godep go build -o $(THRIFT_GEN_RELEASE_DARWIN)/thrift-gen ./thrift/thrift-gen + tar -czf thrift-gen-release.tar.gz $(THRIFT_GEN_RELEASE) + mv thrift-gen-release.tar.gz $(THRIFT_GEN_RELEASE)/ -.PHONY: all help clean fmt format get_thrift install install_ci packages_test test test_ci vet +.PHONY: all help clean fmt format get_thrift install install_ci release_thrift_gen packages_test test test_ci vet .SILENT: all help clean fmt format test vet