From 805e9e395736ce900de57912cec8a0a8259e034f Mon Sep 17 00:00:00 2001 From: claudemiro Date: Sat, 5 Mar 2016 09:27:40 -0300 Subject: [PATCH] Removed Makefile and Add a Rakefile --- Makefile | 13 ------------- Rakefile | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 13 deletions(-) delete mode 100644 Makefile create mode 100644 Rakefile diff --git a/Makefile b/Makefile deleted file mode 100644 index 92fe4da..0000000 --- a/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -default: debug - -debug: - GO15VENDOREXPERIMENT=1 go install -ldflags "-w" github.com/dimiro1/ipe - -run-debug: debug - ${GOPATH}/bin/ipe --config ${GOPATH}/src/github.com/dimiro1/ipe/config.json -logtostderr=true -v=2 - -test: - GO15VENDOREXPERIMENT=1 go test -bench . `go list ./... | grep -v vendor | grep -v functional | grep -v github.com/dimiro1/ipe$$` - -dev-deps: - go get github.com/pusher/pusher-http-go diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..ecadc40 --- /dev/null +++ b/Rakefile @@ -0,0 +1,56 @@ +# Copyright 2016 Claudemiro Alves Feitosa Neto. All rights reserved. +# Use of this source code is governed by a MIT-style +# license that can be found in the LICENSE file. + +require 'rake/clean' + +VERSION = 'v1.0.0' +GITHASH = `git rev-parse --short HEAD` +DATE = Time.now.strftime '%Y%m%d%H%M%S' + +CLOBBER.include 'build' + +task :default => [:'run-debug'] + +desc 'Build a debug version' +task :debug do + sh "GO15VENDOREXPERIMENT=1 go install -ldflags '-w -X main.version=DEBUG -X main.buildstamp=DEBUG -X main.githash=DEBUG' github.com/dimiro1/ipe" +end + +desc 'Build and run debug version' +task :'run-debug' => :debug do + sh '$GOPATH/bin/ipe --config $GOPATH/src/github.com/dimiro1/ipe/config.json -logtostderr=true -v=2' +end + +desc 'Run test suite' +task :test do + sh 'GO15VENDOREXPERIMENT=1 go test . `glide nv`' +end + +desc 'Download the development dependencies' +task :'dev-deps' do + sh 'go get github.com/pusher/pusher-http-go' +end + +desc 'Generate distributions' +task :distribute => [:linux, :darwin] + +desc 'Generate a linux distribution' +task :linux do + Rake::Task['build'].invoke 'linux' +end + +desc 'Generate a darwin distribution' +task :darwin do + Rake::Task['build'].invoke 'darwin' +end + +task :build, [:os] do |t, args| + t.reenable + os = args[:os] + + sh "mkdir -p build/#{os}" + sh "GO15VENDOREXPERIMENT=1 GOOS=#{os} GOARCH=amd64 go build -ldflags '-X main.version=#{VERSION} -X main.buildstamp=#{DATE} -X main.githash=#{GITHASH}' -o build/#{os}/ipe github.com/dimiro1/ipe" + sh "cp ipe/config-example.json build/#{os}/config.json" + sh "tar -C build/#{os} -czf build/ipe_#{VERSION}_#{os}_amd64.tar.gz ." +end \ No newline at end of file