From 5b5f7b756bfca7627b5d1326bf7fe8ef13667b7a Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Sun, 26 Mar 2023 04:22:51 +0800 Subject: Clean some legacy files and move some build files (#23699) * Clean the "tools" directory. The "tools" directory contains only two files, move them. * The "external_renderer.go" works like "cat" command to echo Stdin to Stdout , to help testing. * The `// gobuild: external_renderer` is incorrect, there should be no space: `//gobuild: external_renderer` * The `fmt.Print(os.Args[1])` is not a well-defined behavior, and it's never used. * The "watch.sh" is for "make watch", it's somewhat related to "build" * After this PR, there is no "tools" directory, the project root directory looks slightly simpler than before. * Remove the legacy "contrib/autoboot.sh", there is no "gogs_supervisord.sh" * Remove the legacy "contrib/mysql.sql", it's never mentioned anywhere. * Remove the legacy "contrib/pr/checkout.go", it has been broken for long time, and it introduces unnecessary dependencies of the main code base. --- build/backport-locales.go | 3 +++ build/code-batch-process.go | 1 - build/test-echo.go | 20 ++++++++++++++++++++ build/watch.sh | 8 ++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 build/test-echo.go create mode 100644 build/watch.sh (limited to 'build') diff --git a/build/backport-locales.go b/build/backport-locales.go index efaae52bd4..9421b6925e 100644 --- a/build/backport-locales.go +++ b/build/backport-locales.go @@ -1,3 +1,6 @@ +// Copyright 2023 The Gitea Authors. All rights reserved. +// SPDX-License-Identifier: MIT + //go:build ignore package main diff --git a/build/code-batch-process.go b/build/code-batch-process.go index 9cc47442b2..8556c27ad7 100644 --- a/build/code-batch-process.go +++ b/build/code-batch-process.go @@ -65,7 +65,6 @@ func newFileCollector(fileFilter string, batchSize int) (*fileCollector, error) "modules", "routers", "services", - "tools", } co.includePatterns = append(co.includePatterns, regexp.MustCompile(`.*\.go$`)) diff --git a/build/test-echo.go b/build/test-echo.go new file mode 100644 index 0000000000..093364fcf8 --- /dev/null +++ b/build/test-echo.go @@ -0,0 +1,20 @@ +// Copyright 2023 The Gitea Authors. All rights reserved. +// SPDX-License-Identifier: MIT + +//go:build ignore + +package main + +import ( + "fmt" + "io" + "os" +) + +func main() { + _, err := io.Copy(os.Stdout, os.Stdin) + if err != nil { + fmt.Fprintf(os.Stderr, "Error: %v", err) + os.Exit(1) + } +} diff --git a/build/watch.sh b/build/watch.sh new file mode 100644 index 0000000000..61e3dc40a2 --- /dev/null +++ b/build/watch.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -euo pipefail + +make watch-frontend & +make watch-backend & + +trap 'kill $(jobs -p)' EXIT +wait -- cgit v1.2.3