From f50480979b2de3be17e0ee60caf104ade5effcb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=91=D0=B0?= =?UTF-8?q?=D0=B4=D1=8F=D0=B5=D0=B2?= Date: Thu, 13 Apr 2023 19:02:27 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD?= =?UTF-8?q?=D0=B0=20=D1=81=D0=B1=D0=BE=D1=80=D0=BA=D0=B0=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D0=B5=D0=BA=D1=82=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 1 + build/ci/Jenkinsfile | 4 +++- cmd/drawio-export/main.go | 7 +++++-- makefile | 6 +++++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 715eb0b..769b075 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,6 +5,7 @@ "версионируется", "Alek", "Aleksei", + "appname", "Badiaev", "Childs", "choco", diff --git a/build/ci/Jenkinsfile b/build/ci/Jenkinsfile index e63eaf0..913d375 100644 --- a/build/ci/Jenkinsfile +++ b/build/ci/Jenkinsfile @@ -112,7 +112,8 @@ pipeline { environment { OUTDIR = 'dist' DIST_TAG = 'empty' - GO_OPT = '-ldflags "-w"' + GO_LDFLAGS = '-w' + GO_OPT = ' ' } steps { echo "***** RELEASE ${PROJECT_NAME} for Linux *****" @@ -140,6 +141,7 @@ pipeline { environment { OUTDIR = 'dist' DIST_TAG = 'empty' + GO_LDFLAGS = '-w' GO_OPT = ' ' } steps { diff --git a/cmd/drawio-export/main.go b/cmd/drawio-export/main.go index a129101..31041fc 100644 --- a/cmd/drawio-export/main.go +++ b/cmd/drawio-export/main.go @@ -8,7 +8,10 @@ import ( "git.mousesoft.ru/ms/drawio-exporter/pkg/drawio" ) -var version string // Версия приложения +var ( + appname string // Наименование приложения + version string // Версия приложения +) func main() { flag.Parse() @@ -17,7 +20,7 @@ func main() { os.Exit(0) } if flagVersion { - fmt.Println("Draw.io Export cli util", version) + fmt.Println(appname, version) os.Exit(0) } if flag.NArg() < 1 { diff --git a/makefile b/makefile index 0f096b8..89b599b 100644 --- a/makefile +++ b/makefile @@ -2,6 +2,7 @@ # ======================== PROJECT_ID := drawio-export +PROJECT_NAME ?= MouseSoft DrawIO Export BIN_SUFFIX := TMPDIR ?= $(CURDIR)/tmp @@ -13,7 +14,10 @@ VERSION ?= $(strip $(shell ./scripts/version.sh)) VERSION_NUMBER := $(strip $(shell ./scripts/version.sh number)) DIST_KIND := $(shell uname -m) -GO_OPT_BASE := -mod vendor -ldflags "-X main.version=${VERSION}" +GO_LDFLAGS ?= +GO_OPT_V := -X "main.version=$(VERSION)" +GO_OPT_APP := -X "main.appname=$(PROJECT_NAME)" +GO_OPT_BASE := -mod vendor -ldflags '$(GO_OPT_V) $(GO_OPT_APP) $(GO_LDFLAGS)' GO_OPT ?= EXPORT_RESULT ?= false # for CI please set EXPORT_RESULT to true COVERAGE_FORMAT ?= html