5 编译二进制文件
wonderful edited this page 2021-11-17 10:58:53 +08:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

一 linux下编译 1. 本地的go开放环境中在src文件下进行克隆项目。 git clone https://git.trustie.net/wonderful/gitea-1156.git 2. 可以提前运行 go mod tidy, go mod vendor 以准备环境的需要。随后运行命令: tags=bindata make build 也可以运行完整的命令 TAGS=bindata GOOS=linux GOARCH=amd64 make build 3.得到一个gitea的二进制包。命令 ./gitea 运行。 二 Window下编译 1. 环境准备 - go - git - make 相关配置请上网查看。 2. 相关准备 - 运行命令 go go mod tidy go mod vendor 3.在项目目录下,编译 set go111module=ongo build -tags='bindata'。 4. 如果编译不通过的话,进入下列路径,进行下列操作,再进行编译。 cd ./modules/options/ go run -mod=vendor ../../build/generate-bindata.go ../../options options bindata.go cd ../../modules/public/ go run -mod=vendor ../../build/generate-bindata.go ../../public public bindata.go cd ../../modules/templates/ go run -mod=vendor ../../build/generate-bindata.go ../../templates templates bindata.go