Skip to content

Commit 5b5f7b7

Browse files
authored
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.
1 parent 73b4010 commit 5b5f7b7

10 files changed

+26
-303
lines changed

Makefile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ TEST_TAGS ?= sqlite sqlite_unlock_notify
131131

132132
TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(FOMANTIC_WORK_DIR)/node_modules $(DIST) $(MAKE_EVIDENCE_DIR) $(AIR_TMP_DIR) $(GO_LICENSE_TMP_DIR)
133133

134-
GO_DIRS := cmd tests models modules routers build services tools
134+
GO_DIRS := build cmd models modules routers services tests
135135
WEB_DIRS := web_src/js web_src/css
136136

137137
GO_SOURCES := $(wildcard *.go)
@@ -219,7 +219,6 @@ help:
219219
@echo " - tidy run go mod tidy"
220220
@echo " - test[\#TestSpecificName] run unit test"
221221
@echo " - test-sqlite[\#TestSpecificName] run integration test for sqlite"
222-
@echo " - pr#<index> build and start gitea from a PR with integration test data loaded"
223222

224223
.PHONY: go-check
225224
go-check:
@@ -353,7 +352,7 @@ lint-backend: golangci-lint vet editorconfig-checker
353352

354353
.PHONY: watch
355354
watch:
356-
bash tools/watch.sh
355+
bash build/watch.sh
357356

358357
.PHONY: watch-frontend
359358
watch-frontend: node-check node_modules
@@ -939,10 +938,6 @@ generate-manpage:
939938
@gzip -9 man/man1/gitea.1 && echo man/man1/gitea.1.gz created
940939
@#TODO A small script that formats config-cheat-sheet.en-us.md nicely for use as a config man page
941940

942-
.PHONY: pr\#%
943-
pr\#%: clean-all
944-
$(GO) run contrib/pr/checkout.go $*
945-
946941
.PHONY: golangci-lint
947942
golangci-lint:
948943
$(GO) run $(GOLANGCI_LINT_PACKAGE) run

build/backport-locales.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright 2023 The Gitea Authors. All rights reserved.
2+
// SPDX-License-Identifier: MIT
3+
14
//go:build ignore
25

36
package main

build/code-batch-process.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ func newFileCollector(fileFilter string, batchSize int) (*fileCollector, error)
6565
"modules",
6666
"routers",
6767
"services",
68-
"tools",
6968
}
7069
co.includePatterns = append(co.includePatterns, regexp.MustCompile(`.*\.go$`))
7170

build/test-echo.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2023 The Gitea Authors. All rights reserved.
2+
// SPDX-License-Identifier: MIT
3+
4+
//go:build ignore
5+
6+
package main
7+
8+
import (
9+
"fmt"
10+
"io"
11+
"os"
12+
)
13+
14+
func main() {
15+
_, err := io.Copy(os.Stdout, os.Stdin)
16+
if err != nil {
17+
fmt.Fprintf(os.Stderr, "Error: %v", err)
18+
os.Exit(1)
19+
}
20+
}
File renamed without changes.

contrib/autoboot.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

contrib/mysql.sql

Lines changed: 0 additions & 2 deletions
This file was deleted.

contrib/pr/checkout.go

Lines changed: 0 additions & 267 deletions
This file was deleted.

tests/sqlite.ini.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,6 @@ ENABLED = true
111111
[markup.html]
112112
ENABLED = true
113113
FILE_EXTENSIONS = .html
114-
RENDER_COMMAND = `go run tools/external_renderer.go`
114+
RENDER_COMMAND = `go run build/test-echo.go`
115115
IS_INPUT_FILE = false
116116
RENDER_CONTENT_MODE=sanitized

tools/external_renderer.go

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)