From 0b5e56233cbfa85470a2e03e2da76a43b33c63ab Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+ttytm@users.noreply.github.com> Date: Sat, 16 Mar 2024 16:42:52 +0100 Subject: [PATCH] build: follow a default directory structure for V projects (#25) --- .gitignore | 1 + build.vsh | 3 +-- {cmd/v-analyzer => src}/check-updates.v | 0 {cmd/v-analyzer => src}/clear-cache.v | 0 {cmd/v-analyzer => src}/init.v | 0 {cmd/v-analyzer => src}/main.v | 0 {cmd/v-analyzer => src}/up.v | 0 {cmd/v-analyzer => src}/utils.v | 0 8 files changed, 2 insertions(+), 2 deletions(-) rename {cmd/v-analyzer => src}/check-updates.v (100%) rename {cmd/v-analyzer => src}/clear-cache.v (100%) rename {cmd/v-analyzer => src}/init.v (100%) rename {cmd/v-analyzer => src}/main.v (100%) rename {cmd/v-analyzer => src}/up.v (100%) rename {cmd/v-analyzer => src}/utils.v (100%) diff --git a/.gitignore b/.gitignore index 0dd286ef..0da793cf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Binaries for programs and plugins main +v-analyzer **/*.exe **/*.exp **/*.exe~ diff --git a/build.vsh b/build.vsh index b39fde46..04d0792f 100644 --- a/build.vsh +++ b/build.vsh @@ -11,7 +11,6 @@ import term import v.vmod const version = vmod.decode(@VMOD_FILE) or { panic(err) }.version -const code_path = './cmd/v-analyzer' const bin_path = './bin/v-analyzer' + $if windows { '.exe' } $else { '' } const build_commit = os.execute('git rev-parse --short HEAD').output.trim_space() @@ -28,7 +27,7 @@ fn errorln(msg string) { } fn (m ReleaseMode) compile_cmd() string { - base_build_cmd := '${@VEXE} ${code_path} -o ${bin_path} -no-parallel' + base_build_cmd := '${@VEXE} ${@VMODROOT} -o ${bin_path} -no-parallel' cc := if v := os.getenv_opt('CC') { '-cc ${v}' } else { diff --git a/cmd/v-analyzer/check-updates.v b/src/check-updates.v similarity index 100% rename from cmd/v-analyzer/check-updates.v rename to src/check-updates.v diff --git a/cmd/v-analyzer/clear-cache.v b/src/clear-cache.v similarity index 100% rename from cmd/v-analyzer/clear-cache.v rename to src/clear-cache.v diff --git a/cmd/v-analyzer/init.v b/src/init.v similarity index 100% rename from cmd/v-analyzer/init.v rename to src/init.v diff --git a/cmd/v-analyzer/main.v b/src/main.v similarity index 100% rename from cmd/v-analyzer/main.v rename to src/main.v diff --git a/cmd/v-analyzer/up.v b/src/up.v similarity index 100% rename from cmd/v-analyzer/up.v rename to src/up.v diff --git a/cmd/v-analyzer/utils.v b/src/utils.v similarity index 100% rename from cmd/v-analyzer/utils.v rename to src/utils.v