From 21307c947db8e47aa452125869083112518ea322 Mon Sep 17 00:00:00 2001 From: ge Date: Thu, 28 Nov 2024 21:16:38 +0300 Subject: [PATCH] build: rename comptime vars, add -skip-unused --- Dockerfile | 2 +- Makefile | 2 +- habr/api.v | 2 +- habraview.v | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 23d6abf..931fbd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM thevlang/vlang:latest AS builder COPY . . -RUN v -prod -cc gcc -cflags -static -cflags -s -d habraview_version=$(git describe --tags) . -o /habraview +RUN v -prod -skip-unused -cc gcc -cflags -static -cflags -s -d hv_version=$(git describe --tags) . -o /habraview FROM scratch AS prod COPY --from=builder /habraview . diff --git a/Makefile b/Makefile index a0b41cf..3b2d4b4 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,2 @@ bin: - v -prod -cflags -static -d habraview_version=$$(git describe --tags) . + v -prod -skip-unused -cflags -static -d hv_version=$$(git describe --tags) . diff --git a/habr/api.v b/habr/api.v index 1bf7cfa..634f2f3 100644 --- a/habr/api.v +++ b/habr/api.v @@ -3,7 +3,7 @@ module habr import net.http pub struct Habr { - baseurl string = $d('habr_baseurl', 'https://habr.com') + baseurl string = $d('hv_habr_baseurl', 'https://habr.com') } pub fn Habr.new() Habr { diff --git a/habraview.v b/habraview.v index 1699066..7f2297f 100644 --- a/habraview.v +++ b/habraview.v @@ -76,7 +76,7 @@ fn main() { name: 'habraview' usage: '[host][:port]' description: 'Habr.com posts viewer.' - version: $d('habraview_version', '0.0.0') + version: $d('hv_version', '0.0.0') defaults: struct { man: false }