{"id":13413692,"url":"https://github.com/lunny/gop","last_synced_at":"2025-03-14T19:33:13.977Z","repository":{"id":57496908,"uuid":"82361529","full_name":"lunny/gop","owner":"lunny","description":"Moved to https://gitea.com/lunny/gop","archived":true,"fork":false,"pushed_at":"2019-03-22T01:35:11.000Z","size":2537,"stargazers_count":49,"open_issues_count":10,"forks_count":7,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-07-31T20:52:38.217Z","etag":null,"topics":["dependency-manager","golang","project-management","tool"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lunny.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-18T04:33:48.000Z","updated_at":"2024-02-21T15:08:14.000Z","dependencies_parsed_at":"2022-09-03T02:30:55.727Z","dependency_job_id":null,"html_url":"https://github.com/lunny/gop","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunny%2Fgop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunny%2Fgop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunny%2Fgop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunny%2Fgop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lunny","download_url":"https://codeload.github.com/lunny/gop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221498771,"owners_count":16833059,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dependency-manager","golang","project-management","tool"],"created_at":"2024-07-30T20:01:46.576Z","updated_at":"2024-10-26T05:31:16.687Z","avatar_url":"https://github.com/lunny.png","language":"Go","readme":"# GOP\n\n[简体中文](README_ZH.md)\n\n[![CircleCI](https://circleci.com/gh/lunny/gop.svg?style=shield)](https://circleci.com/gh/lunny/gop)\n[![codecov](https://codecov.io/gh/lunny/gop/branch/master/graph/badge.svg)](https://codecov.io/gh/lunny/gop)\n[![](https://goreportcard.com/badge/github.com/lunny/gop)](https://goreportcard.com/report/github.com/lunny/gop) \n\nGOP is a project manangement tool for building your golang applications out of global GOPATH. In fact gop will keep both global GOPATH and every project GOPATH. But that means your project will  **not** go-getable. Of course, GOP itself is go-getable. GOP copy all denpendencies from global GOPATH to your project's `src/vendor` directory and all application's sources are also in `src` directory.\n\nA normal process using gop is below:\n\n```\ngit clone xxx@mydata.com:bac/aaa.git\ncd aaa\ngop ensure -g\ngop build\ngop test\n```\n\n## Features\n\n* GOPATH compitable\n* Multiple build targets support\n* Put your projects out of global GOPATH\n\n## Installation\n\nPlease ensure you have installed the `go` command, GOP will invoke it on building or testing\n\n```\ngo get github.com/lunny/gop\n```\n\n## Directory structure\n\nEvery project should have a GOPATH directory structure and put a `gop.yml` int the root directory. This is an example project's directory tree.\n\n```\n\u003cproject root\u003e\n├── gop.yml\n├── bin\n├── doc\n└── src\n    ├── main\n    │   └── main.go\n    ├── models\n    │   └── models.go\n    ├── routes\n    │   └── routes.go\n    └── vendor\n        └── github.com\n            ├── go-xorm\n            │   ├── builder\n            │   ├── core\n            │   └── xorm\n            └── lunny\n                ├── log\n                └── tango\n```\n\n## Gop.yml\n\nGop will recognize a gop project which has `gop.yml`. The file is also a project configuration file. Below is an example. If you didn't define any target, the default target is src/main and the target name is the project name.\n\n```yml\ntargets:\n- name: myproject1\n  dir: main\n  assets:\n  - templates\n  - public\n  - config.ini\n  - key.pem\n  - cert.pem\n- name: myproject2\n  dir: web\n  assets:\n  - templates\n  - public\n  - config.ini\n  monitors:\n  - config.ini\n```\n\n## Command\n\n### init\n\nCreate the default directory structure tree.\n\n```\nmkdir newproject\ncd newproject\ngop init\n```\n\nand you can also create config file for vscode\n\n```\ngop init -e=vscode\n```\n\n### ensure\n\nAutomatically copy dependencies from $GOPATH to local project directory. `-g` will let you automatically call `go get \u003cpackage\u003e` when the package is missing on `GOPATH`. `-u` will always `go get \u003cpackage\u003e` on all the dependencies and copy them to `vendor`.\n\n```\ngop ensure [-g|-u] [target_name]\n```\n\n### status\n\nList all dependencies of this project and show the status.\n\n```\ngop status [target_name]\n```\n\n### add\n\nAdd one or more packages to this project.\n\n```\ngop add \u003cpackage1\u003e \u003cpackage2\u003e\n```\n\n### update\n\nUpdate one or more packages to this project. All missing dependent packages will also be added.\n-f will update exists dependent packages.\n\n```\ngop update [-f] \u003cpackage1\u003e \u003cpackage2\u003e\n```\n\n### rm\n\nRemove one or more packages from this project.\n\n```\ngop rm \u003cpackage1\u003e \u003cpackage2\u003e\n```\n\n### build\n\nRun `go build` on the src directory. If you want to execute ensure before build, you can use `-e` flag.\n\n```\ngop build [-e] [target_name]\n```\n\n### run\n\nRun `go run` on the src directory. `-w` will monitor the go source code changes and\nautomatically build and run again. `-e` will automatically execute `ensure` before every time build.\n\n```\ngop run [-w] [target_name]\n```\n\n### test\n\nRun `go test` on the src directory. If you want to execute ensure before build, you can use `-e` flag.\n\n```\ngop test [-e] [target_name]\n```\n\n### release\n\nRun `go release` on the src directory.\n\n```\ngop release [target_name]\n```\n\n## TODO\n\n* [ ] Versions support, specify a dependency package verison\n* [ ] Support run `gop` in `GOPATH`","funding_links":[],"categories":["Package Management","\u003cspan id=\"包管理-package-management\"\u003e包管理 Package Management\u003c/span\u003e","包管理","Go语言包管理","Relational Databases"],"sub_categories":["HTTP Clients","Advanced Console UIs","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","HTTP客户端","ORM","交流","OpenGL"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunny%2Fgop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flunny%2Fgop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunny%2Fgop/lists"}