From 8571d9395ba98d5156229ab9adfe0d71a4419296 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sat, 16 Jan 2021 14:43:24 +0200 Subject: [PATCH] preludes: move to vlib/v/preludes --- vlib/v/builder/compile.v | 2 +- {cmd/tools => vlib/v}/preludes/README.md | 12 ++++++------ {cmd/tools => vlib/v}/preludes/live.v | 0 {cmd/tools => vlib/v}/preludes/live_main.v | 0 {cmd/tools => vlib/v}/preludes/live_shared.v | 0 {cmd/tools => vlib/v}/preludes/profiled_program.v | 0 {cmd/tools => vlib/v}/preludes/tests_assertions.v | 0 {cmd/tools => vlib/v}/preludes/tests_with_stats.v | 0 8 files changed, 7 insertions(+), 7 deletions(-) rename {cmd/tools => vlib/v}/preludes/README.md (75%) rename {cmd/tools => vlib/v}/preludes/live.v (100%) rename {cmd/tools => vlib/v}/preludes/live_main.v (100%) rename {cmd/tools => vlib/v}/preludes/live_shared.v (100%) rename {cmd/tools => vlib/v}/preludes/profiled_program.v (100%) rename {cmd/tools => vlib/v}/preludes/tests_assertions.v (100%) rename {cmd/tools => vlib/v}/preludes/tests_with_stats.v (100%) diff --git a/vlib/v/builder/compile.v b/vlib/v/builder/compile.v index f4ed3fa5d6..1aa5658d25 100644 --- a/vlib/v/builder/compile.v +++ b/vlib/v/builder/compile.v @@ -223,7 +223,7 @@ pub fn (v &Builder) get_user_files() []string { mut user_files := []string{} // See cmd/tools/preludes/README.md for more info about what preludes are vroot := os.dir(pref.vexe_path()) - preludes_path := os.join_path(vroot, 'cmd', 'tools', 'preludes') + preludes_path := os.join_path(vroot, 'vlib', 'v', 'preludes') if v.pref.is_livemain || v.pref.is_liveshared { user_files << os.join_path(preludes_path, 'live.v') } diff --git a/cmd/tools/preludes/README.md b/vlib/v/preludes/README.md similarity index 75% rename from cmd/tools/preludes/README.md rename to vlib/v/preludes/README.md index f9be27150b..9d0a8680c0 100644 --- a/cmd/tools/preludes/README.md +++ b/vlib/v/preludes/README.md @@ -1,28 +1,28 @@ # V preludes: -The cmd/tools/preludes/ contains small v code snippets, that V uses when +The vlib/v/preludes/ contains small v code snippets, that V uses when compiling certain v programs. V adds the files below automatically itself. Each file is used in different situations (see below). NB: preludes are *NOT* intended to be used by user programs/modules. -The folder cmd/tools/preludes/ is *NOT* a v module. +The folder vlib/v/preludes/ is *NOT* a v module. ## Details: -### cmd/tools/preludes/live_main.v +### vlib/v/preludes/live_main.v Used when compiling live programs. This file is used by the main executable live program, that starts the file change monitoring thread. Each live program needs module `os` and module `time`, in order for the background file change monitoring thread to work properly. -### cmd/tools/preludes/live_shared.v +### vlib/v/preludes/live_shared.v Used when compiling live programs, for the shared library portion of the live programs, that is reloaded each time the code is changed. -### cmd/tools/preludes/tests_assertions.v +### vlib/v/preludes/tests_assertions.v Used when compiling `_test.v` programs. It specifies how failed assertions will look. -### cmd/tools/preludes/tests_with_stats.v +### vlib/v/preludes/tests_with_stats.v Used when compiling `_test.v` programs with -stats option. It specifies how the result will appear ('assert' vs 'asserts' and so on). diff --git a/cmd/tools/preludes/live.v b/vlib/v/preludes/live.v similarity index 100% rename from cmd/tools/preludes/live.v rename to vlib/v/preludes/live.v diff --git a/cmd/tools/preludes/live_main.v b/vlib/v/preludes/live_main.v similarity index 100% rename from cmd/tools/preludes/live_main.v rename to vlib/v/preludes/live_main.v diff --git a/cmd/tools/preludes/live_shared.v b/vlib/v/preludes/live_shared.v similarity index 100% rename from cmd/tools/preludes/live_shared.v rename to vlib/v/preludes/live_shared.v diff --git a/cmd/tools/preludes/profiled_program.v b/vlib/v/preludes/profiled_program.v similarity index 100% rename from cmd/tools/preludes/profiled_program.v rename to vlib/v/preludes/profiled_program.v diff --git a/cmd/tools/preludes/tests_assertions.v b/vlib/v/preludes/tests_assertions.v similarity index 100% rename from cmd/tools/preludes/tests_assertions.v rename to vlib/v/preludes/tests_assertions.v diff --git a/cmd/tools/preludes/tests_with_stats.v b/vlib/v/preludes/tests_with_stats.v similarity index 100% rename from cmd/tools/preludes/tests_with_stats.v rename to vlib/v/preludes/tests_with_stats.v