From 1d24fecc1b7c16045588590ddd589636d8777af4 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Wed, 8 Jul 2020 14:29:55 +0300 Subject: [PATCH] cmd: fix building gen_vc.v and vcreate.v by `v build-tools` --- cmd/tools/gen_vc.v | 13 ++++++++----- cmd/tools/vbuild-tools.v | 5 +---- cmd/tools/vcreate.v | 3 ++- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/cmd/tools/gen_vc.v b/cmd/tools/gen_vc.v index 5cff961b39..a8bfd95595 100644 --- a/cmd/tools/gen_vc.v +++ b/cmd/tools/gen_vc.v @@ -1,3 +1,5 @@ +module main + // This tool regenerates V's bootstrap .c files // every time the V master branch is updated. @@ -14,8 +16,6 @@ // --dry-run dont push anything to remote repo // --force force update even if already up to date -module main - import os import log import flag @@ -129,9 +129,8 @@ fn main() { // webhook server mode if flag_options.serve { vweb.run(flag_options.port) - } - // cmd mode - else { + } else { + // cmd mode mut gen_vc := new_gen_vc(flag_options) gen_vc.init() gen_vc.generate() @@ -164,6 +163,10 @@ pub fn (mut ws WebhookServer) init() { //ws.init_once() } +pub fn (mut ws WebhookServer) index() { + eprintln('WebhookServer.index() called') +} + // gen webhook pub fn (mut ws WebhookServer) genhook() { // request data diff --git a/cmd/tools/vbuild-tools.v b/cmd/tools/vbuild-tools.v index b1c0fde386..413206eb4b 100644 --- a/cmd/tools/vbuild-tools.v +++ b/cmd/tools/vbuild-tools.v @@ -7,10 +7,7 @@ import v.util fn main() { args := os.args args_string := args[1..].join(' ') - // TODO: fix cmd/tools/gen_vc.v / vweb too - skips := [ - 'cmd/tools/gen_vc.v' - ] + skips := []string{} util.ensure_modules_for_all_tools_are_installed('-v' in args) if testing.v_build_failing_skipped(args_string.all_before('build-tools'), 'cmd/tools', skips) { exit(1) diff --git a/cmd/tools/vcreate.v b/cmd/tools/vcreate.v index c2c9365fc6..4f34517820 100644 --- a/cmd/tools/vcreate.v +++ b/cmd/tools/vcreate.v @@ -1,3 +1,5 @@ +module main + // Copyright (c) 2019-2020 Alexander Medvednikov. All rights reserved. // Use of this source code is governed by an MIT license // that can be found in the LICENSE file. @@ -6,7 +8,6 @@ // structure of the program in the _current_ directory, while `new` // makes the program structure in a _sub_ directory. Besides that, the // functionality is essentially the same. -module main import os