-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Hemanth Krishna <[email protected]>
- Loading branch information
1 parent
736525d
commit a0a5248
Showing
2 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,5 @@ | |
|
||
# Go workspace file | ||
go.work | ||
.idea/ | ||
.idea/ | ||
.bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
PROJECT_NAME = "sorobix-formatter" | ||
BASE=$(shell pwd) | ||
BUILD_DIR=$(BASE)/bin | ||
VERSION ?= "v1.0" | ||
BUILD_DATE = $(shell date -u +"%Y-%m-%dT%H:%M:%SZ") | ||
COMMIT_SHA = $(shell git rev-parse --short HEAD) | ||
LDFLAGS = -ldflags "-w -X main.version=${VERSION} -X main.buildDate=${BUILD_DATE} -X main.commit=${COMMIT_SHA}" | ||
PACKAGE = $(shell go list -m) | ||
|
||
.PHONY: clean | ||
clean: | ||
@echo "> Cleaning Build targets" | ||
rm -rf bin | ||
|
||
.PHONY: deps | ||
deps: | ||
@echo "> Installing dependencies" | ||
@go mod tidy | ||
@go mod download | ||
|
||
.PHONY: build | ||
build: deps | ||
@echo "> Building Binary" | ||
go build ${LDFLAGS} -o ${BUILD_DIR}/${PROJECT_NAME} | ||
@echo "> Binary has been built successfully" | ||
|
||
|
||
.PHONY: run | ||
run: build | ||
@echo "> Running ${PROJECT_NAME}" | ||
${BUILD_DIR}/${PROJECT_NAME} |