Skip to content

Commit

Permalink
adjust dev deps handling (#56)
Browse files Browse the repository at this point in the history
* adjust dev deps handling

* cleanup

* refactor tooling
  • Loading branch information
cstaud authored Dec 28, 2022
1 parent feed1ca commit 31617bf
Show file tree
Hide file tree
Showing 10 changed files with 772 additions and 923 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@

.idea
# Dependency directories (remove the comment below to include it)
# vendor/
/.gobincache/
.gobincache

/swagger_flat.json
/swagger_go.json
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#limitations under the License.

.PHONY: download deps generate build help
CHECK_FILES?=$$(go list ./... | grep -v /vendor/)
SWAGGER_SPEC=swagger.json

help: ## Show this help.
Expand All @@ -31,7 +30,7 @@ download: ## Download bitrise swagger specification
wget -q -O $(SWAGGER_SPEC) https://api-docs.bitrise.io/docs/swagger.json

generate: validate ## Generate the API Go client and the JSON document for the UI.
go generate
go generate tools/generate.go

validate: deps ## Check that the swagger spec is valid.
gobin -m -run github.com/go-swagger/go-swagger/cmd/[email protected] validate $(SWAGGER_SPEC)
gobin -run github.com/go-swagger/go-swagger/cmd/[email protected] validate $(SWAGGER_SPEC)
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ require (
github.com/go-openapi/strfmt v0.21.3
github.com/go-openapi/swag v0.22.3
github.com/go-openapi/validate v0.22.0
github.com/go-swagger/go-swagger v0.30.3
github.com/kyoh86/richgo v0.3.11
)
914 changes: 11 additions & 903 deletions go.sum

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions tools.go

This file was deleted.

6 changes: 4 additions & 2 deletions generate.go → tools/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ limitations under the License.

package tools

//go:generate gobin -m -run github.com/go-swagger/go-swagger/cmd/swagger flatten swagger.json -o swagger_flat.json
//go:generate gobin -m -run github.com/go-swagger/go-swagger/cmd/swagger flatten ../swagger.json -o swagger_flat.json
// remove tags to group all operations within a single client
//go:generate sh -c "cat swagger_flat.json | jq '[., (.paths | map_values(.[] |= del(.tags?)) | {paths: .})] | add' > swagger_go.json"
//go:generate gobin -m -run github.com/go-swagger/go-swagger/cmd/swagger generate client -A bitrise-api -f swagger_go.json -t go --default-scheme=https --with-flatten=full
//go:generate gobin -m -run github.com/go-swagger/go-swagger/cmd/swagger generate client -A bitrise-api -f swagger_go.json -t ../go --default-scheme=https --with-flatten=full
// cleanup
//go:generate sh -c "rm swagger_flat.json swagger_go.json"
61 changes: 61 additions & 0 deletions tools/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
module tools

go 1.19

require github.com/go-swagger/go-swagger v0.30.3

require (
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.1.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/go-openapi/analysis v0.21.4 // indirect
github.com/go-openapi/errors v0.20.3 // indirect
github.com/go-openapi/inflect v0.19.0 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/loads v0.21.2 // indirect
github.com/go-openapi/runtime v0.24.1 // indirect
github.com/go-openapi/spec v0.20.7 // indirect
github.com/go-openapi/strfmt v0.21.3 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-openapi/validate v0.22.0 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/jessevdk/go-flags v1.5.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/kr/pretty v0.3.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/shopspring/decimal v1.2.0 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.12.0 // indirect
github.com/subosito/gotenv v1.3.0 // indirect
github.com/toqueteos/webbrowser v1.2.0 // indirect
go.mongodb.org/mongo-driver v1.10.1 // indirect
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/tools v0.1.12 // indirect
gopkg.in/ini.v1 v1.66.4 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 31617bf

Please sign in to comment.