Removed Makefile and Add a Rakefile
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user