Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rosylilly/gopkg2files
https://github.com/rosylilly/gopkg2files
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/rosylilly/gopkg2files
- Owner: rosylilly
- License: mit
- Created: 2022-08-13T10:59:52.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-13T16:18:13.000Z (over 2 years ago)
- Last Synced: 2024-12-22T13:14:53.259Z (15 days ago)
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gopkg2files
Convert go packages to files list.
## Usage
Install `github.com/rosylilly/gopkg2files/cmd/gopkg2files`.
Write your makefile like below:
```Makefile
GO?=goGO_ALL_PACKAGES:=$(shell ${GO} list ./...)
GO_ROOT_PACKAGE:=$(shell ${GO} list .)
GO_CMD_PACKAGES:=$(shell ${GO} list ./cmd/...)GO_CMD_ARTIFACTS:=$(patsubst ${GO_ROOT_PACKAGE}/cmd/%,bin/%,${GO_CMD_PACKAGES})
GOPKG2FILES?=gopkg2files
.PHONY: build
build: ${GO_CMD_ARTIFACTS}.SECONDEXPANSION:
bin/%: Makefile $$(shell ${GOPKG2FILES} ${GO_ROOT_PACKAGE}/cmd/%)
@${GO} build -o $@ $(patsubst bin/%,${GO_ROOT_PACKAGE}/cmd/%,$@)
```and Run `make build` to build binaries on changed dependent go files.
## Options
```
$ ./bin/gopkg2files -h
Usage of gopkg2files:
-cgo
list cgo files
-debug
debug mode
-goroot
list undered $GOROOT files
-test
list test files
-w string
Working directory (default ".")
-xtest
list xtest files
```## Author
Sho Kusano / @rosylilly