Skip to content

Commit 1696afc

Browse files
authored
Merge pull request #310 from cbusbey/rm_gen_packages
Relocate generated code to sub-packages of github.com/quickfixgo/
2 parents d202ca9 + d9d56ed commit 1696afc

File tree

598 files changed

+41
-1733374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

598 files changed

+41
-1733374
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
*~
22
*.swp
33
*.swo
4-
vendor/*/
4+
vendor
55
_test/test
66
_test/echo_server
77
_test/tmp
88
_vendor*
9+
gen

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ install:
2424
- go get -u github.com/golang/dep/cmd/dep
2525
- dep ensure
2626

27-
script: if [ -z "$FIX_TEST" ]; then make generate && make build && make; else make build_accept && make $FIX_TEST; fi
27+
script: make generate; if [ -z "$FIX_TEST" ]; then make build; make; else make build_accept; make $FIX_TEST; fi

Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
all: vet test
22

33
generate:
4-
go run cmd/generate-fix/generate-fix.go spec/*.xml
4+
mkdir -p gen; cd gen; go run ../cmd/generate-fix/generate-fix.go ../spec/*.xml
5+
6+
generate-dist:
7+
cd ..; go run quickfix/cmd/generate-fix/generate-fix.go quickfix/spec/*.xml
58

69
fmt:
7-
go fmt ./...
10+
go fmt `go list ./... | grep -v quickfix/gen`
811

912
vet:
10-
go vet `go list ./... | grep -v /vendor | grep -v fix4 | grep -v fix5 | grep -v fixt`
13+
go vet `go list ./... | grep -v quickfix/gen`
1114

1215
lint:
1316
go get github.com/golang/lint/golint
@@ -17,7 +20,7 @@ test:
1720
go test -v -cover . ./datadictionary ./internal
1821

1922
_build_all:
20-
go build -v `go list ./... | grep -v /vendor`
23+
go build -v `go list ./...`
2124

2225
build_accept:
2326
cd _test; go build -o echo_server

README.md

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,22 @@ See [examples](https://github.com/quickfixgo/examples) for some simple examples
3232

3333
### FIX Message Generation
3434

35-
QuickFIX/Go includes fields, enums, messages, and message components generated from the FIX 4.0 - FIX5.0SP2 specs. For most FIX applications, these generated resources are sufficient. Custom FIX applications may generate source specific to the FIX spec of that application using the `generate-fix` tool included with QuickFIX/Go.
35+
QuickFIX/Go includes separate packages for tags, fields, enums, messages, and message components generated from the FIX 4.0 - FIX5.0SP2 specs. See:
36+
37+
* [github.com/quickfixgo/tag](https://github.com/quickfixgo/tag)
38+
* [github.com/quickfixgo/field](https://github.com/quickfixgo/field)
39+
* [github.com/quickfixgo/enum](https://github.com/quickfixgo/enum)
40+
* [github.com/quickfixgo/fix40](https://github.com/quickfixgo/fix40)
41+
* [github.com/quickfixgo/fix41](https://github.com/quickfixgo/fix41)
42+
* [github.com/quickfixgo/fix42](https://github.com/quickfixgo/fix42)
43+
* [github.com/quickfixgo/fix43](https://github.com/quickfixgo/fix43)
44+
* [github.com/quickfixgo/fix44](https://github.com/quickfixgo/fix44)
45+
* [github.com/quickfixgo/fix50](https://github.com/quickfixgo/fix50)
46+
* [github.com/quickfixgo/fix50sp1](https://github.com/quickfixgo/fix50sp1)
47+
* [github.com/quickfixgo/fix50sp2](https://github.com/quickfixgo/fix50sp2)
48+
* [github.com/quickfixgo/fixt11](https://github.com/quickfixgo/fixt11)
49+
50+
For most FIX applications, these generated resources are sufficient. Custom FIX applications may generate source specific to the FIX spec of that application using the `generate-fix` tool included with QuickFIX/Go.
3651

3752
Following installation, `generate-fix` is installed to `$GOPATH/bin/generate-fix`. Run `$GOPATH/bin/generate-fix --help` for usage instructions.
3853

@@ -71,6 +86,16 @@ $ make
7186

7287
If this exits with exit status 0, then everything is working!
7388

89+
### Generated Code
90+
91+
Generated code from the FIX40-FIX50SP2 specs are available as separate repos under the [QuickFIX/Go organization](https://github.com/quickfixgo). The source specifications for this generated code is located in `spec/`. Generated code can be identified by the `.generated.go` suffix. Any changes to generated code must be captured by changes to source in `cmd/generate-fix`. After making changes to the code generator source, run the following to re-generate the source
92+
93+
```sh
94+
$ make generate-dist
95+
```
96+
97+
If you are making changes to the generated code, please create Pull Requests for these changes for the affected repos.
98+
7499
### Acceptance Tests
75100

76101
QuickFIX/Go has a comprehensive acceptance test suite covering the FIX protocol. These are the same tests used across all QuickFIX implementations.
@@ -79,22 +104,15 @@ QuickFIX/Go acceptance tests depend on ruby in path.
79104

80105
To run acceptance tests,
81106

107+
# generate code locally
108+
make generate
109+
82110
# build acceptance test rig
83111
make build_accept
84112

85113
# run acceptance tests
86114
make accept
87115

88-
### Generated Code
89-
90-
For convenience, generated code from the FIX40-FIX50SP2 specs are included in the QuickFIX/Go repo. The source specifications for this generated code is located in `spec/`. Generated code can be identified by the `.generated.go` suffix. Any changes to generated code must be captured by changes to source in `cmd/generate-fix`. After making changes to the code generator source, run the following to re-generate the source
91-
92-
```sh
93-
$ make generate
94-
```
95-
96-
If you are making changes to the generated code, you will need to include the generated source in the same Pull Request as the changes made to the code generator. You should do this in a separate commit from your code, as this makes PR review easier and Git history simpler to read in the future.
97-
98116
### Dependencies
99117

100118
If you are developing QuickFIX/Go, there are a few tasks you might need to perform related to dependencies.

_test/echo_server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"os/signal"
99

1010
"github.com/quickfixgo/quickfix"
11-
"github.com/quickfixgo/quickfix/field"
12-
"github.com/quickfixgo/quickfix/tag"
11+
"github.com/quickfixgo/quickfix/gen/field"
12+
"github.com/quickfixgo/quickfix/gen/tag"
1313
)
1414

1515
var router *quickfix.MessageRouter = quickfix.NewMessageRouter()

enum/enum.go

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)