diff options
author | silverwind <me@silverwind.io> | 2022-09-09 17:33:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-09 17:33:01 +0200 |
commit | b5d21c0adf38a4726b14157786be8ad11c1eda22 (patch) | |
tree | 23c09f5b4ca9c1f640ac8b1372f3bb7ec2120079 /build | |
parent | Make the vscode clone link respect transport protocol (#20557) (diff) | |
download | forgejo-b5d21c0adf38a4726b14157786be8ad11c1eda22.tar.xz forgejo-b5d21c0adf38a4726b14157786be8ad11c1eda22.zip |
Generate go-licenses during tidy again (#21108)
We can not have the `frontend` target depend on golang because of they
way drone is set up. Move the `go-licenses` generation back into `tidy`
where it will now also be checked for consistency during `tidy-check`.
(I assume all `main` branch builds should currently fail [like
this](https://drone.gitea.io/go-gitea/gitea/60244/1/11)).
The reasony why it shouldn't be treated the same as for example `go
generate` is because output files are checked in. tidy is imho the
optimal target to run this after.
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'build')
-rw-r--r-- | build/generate-go-licenses.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/build/generate-go-licenses.go b/build/generate-go-licenses.go index 8840cae4a5..fedfdc315e 100644 --- a/build/generate-go-licenses.go +++ b/build/generate-go-licenses.go @@ -54,9 +54,17 @@ func main() { } path := strings.Replace(path, base+string(os.PathSeparator), "", 1) + name := filepath.Dir(path) + + // There might be a bug somewhere in go-licenses that sometimes interprets the + // root package as "." and sometimes as "code.gitea.io/gitea". Workaround by + // removing both of them for the sake of stable output. + if name == "." || name == "code.gitea.io/gitea" { + continue + } entries = append(entries, LicenseEntry{ - Name: filepath.Dir(path), + Name: name, Path: path, LicenseText: string(licenseText), }) |