-
-
Notifications
You must be signed in to change notification settings - Fork 6
Setting Up a Development Environment
Follow these instruction for Ubuntu/Xubuntu: https://www.digitalocean.com/community/tutorials/how-to-install-go-1-6-on-ubuntu-16-04.
Note: I used ~/Projects/go
as GOPATH
.
This is needed to package the localization files. After you update a locale_LANG.ini
file, run make bindata
to package it.
cd ~/Projects/go
go get -u github.com/jteeuwen/go-bindata
go install github.com/jteeuwen/go-bindata/go-bindata
cd ~/Projects/go
go get code.gitea.io/gitea
cd ~/Projects/go/src/code.gitea.io/gitea
make build
Fork the https://github.com/unfoldingWord-dev/gogs repository into your own github account.
cd ~/Projects/go/src/code.gitea.io/gitea
git remote set-url origin https://github.com/unfoldingWord-dev/gogs.git
git fetch --all && git reset --hard origin/master
Note: Do not switch to the develop branch before you have finished the steps above.
git branch --no-track develop refs/remotes/origin/develop
git branch --set-upstream-to=origin/develop develop
git checkout develop
git remote add myfork https://github.com/phillip-hopper/gogs.git
cd ~/Projects
git clone [email protected]:unfoldingWord-dev/gogs-custom.git
cd ~/Projects/go/src/code.gitea.io/gitea
ln -s ~/Projects/gogs-custom custom
See https://github.com/go-lang-plugin-org/go-lang-idea-plugin/wiki/Documentation.
- File > Settings > Languages & Frameworks > Go > Go Libraries
- Add ~/Projects/go/src/code.gitea.io/gitea to "Project libraries"
- File > Project Structure > Project > Project SDK > New > GO SDK
- Select the directory where GO was installed (not your project directory)
- Run > Edit configurations
- Add "Go Application"
- Name it "gitea". This is the name IntelliJ will use for the executable, it should be ignored in .gitignore.
- Run kind = "File"
- File = "/home/team43/Projects/go/src/code.gitea.io/gitea/main.go"
- Output directory = "/home/team43/Projects/go/src/code.gitea.io/gitea"
- Working directory = "/home/team43/Projects/go/src/code.gitea.io/gitea"
- Program arguments = "web"
You should now be able to run and debug Gitea/Gogs in IntelliJ
I added a "Go Test" configuration running all the tests in a directory, as described in the documentation for the plugin
Note: I was receiving an error during testing that said security/pam_appl.h
was not found. I resolved this by installing libpam0g-dev
:
sudo apt-get install libpam0g-dev
Note: when the yaml library was updated, I started receiving an error saying gopkg.in/check.v1
was missing. This is a dependency of the yaml library that is only needed for unit testing:
go get gopkg.in/check.v1