Skip to content

Commit 67164ae

Browse files
committed
[Go] Change the file structure for GOPATH
1 parent 6a013ab commit 67164ae

File tree

63 files changed

+54
-95
lines changed

Some content is hidden

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

63 files changed

+54
-95
lines changed

.gitignore

Lines changed: 11 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -64,58 +64,17 @@ cppbuild/Release
6464
cppbuild/Win32
6565

6666
# golang
67-
gocode/pkg
68-
gocode/src/struct/baseline/*.go
69-
!gocode/src/struct/baseline/*_test.go
70-
gocode/src/struct/baseline-bigendian/*.go
71-
!gocode/src/struct/baseline-bigendian/*_test.go
72-
gocode/src/struct/composite/*.go
73-
!gocode/src/struct/composite/*_test.go
74-
gocode/src/struct/composite_elements/*.go
75-
!gocode/src/struct/composite_elements/*_test.go
76-
gocode/src/struct/since-deprecated/*.go
77-
!gocode/src/struct/since-deprecated/*_test.go
78-
gocode/src/struct/group_with_data*/*.go
79-
!gocode/src/struct/group_with_data*/*_test.go
80-
gocode/src/struct/mktdata/*.go
81-
!gocode/src/struct/mktdata/*_test.go
82-
gocode/src/struct/simple/*.go
83-
!gocode/src/struct/simple/*_test.go
84-
gocode/src/struct/issue*/*.go
85-
!gocode/src/struct/issue*/*_test.go
86-
gocode/src/struct/*/*/*.go
87-
!gocode/src/struct/*/*/*_test.go
88-
gocode/src/struct/example-schema/example-schema*
89-
gocode/src/struct/example-schema/cpu.out
90-
gocode/src/struct/example-socket-clientserver/example-socket-clientserver
91-
gocode/src/struct/extension
92-
gocode/src/struct/extension2
93-
gocode/src/flyweight/baseline/*.go
94-
!gocode/src/flyweight/baseline/*_test.go
95-
gocode/src/flyweight/baseline-bigendian/*.go
96-
!gocode/src/flyweight/baseline-bigendian/*_test.go
97-
gocode/src/flyweight/composite/*.go
98-
!gocode/src/flyweight/composite/*_test.go
99-
gocode/src/flyweight/composite_elements/*.go
100-
!gocode/src/flyweight/composite_elements/*_test.go
101-
gocode/src/flyweight/since-deprecated/*.go
102-
!gocode/src/flyweight/since-deprecated/*_test.go
103-
gocode/src/flyweight/group_with_data*/*.go
104-
!gocode/src/flyweight/group_with_data*/*_test.go
105-
gocode/src/flyweight/mktdata/*.go
106-
!gocode/src/flyweight/mktdata/*_test.go
107-
gocode/src/flyweight/simple/*.go
108-
!gocode/src/flyweight/simple/*_test.go
109-
gocode/src/flyweight/issue*/*.go
110-
!gocode/src/flyweight/issue*/*_test.go
111-
gocode/src/flyweight/*/*/*.go
112-
!gocode/src/flyweight/*/*/*_test.go
113-
gocode/src/flyweight/example-schema/example-schema*
114-
gocode/src/flyweight/example-schema/cpu.out
115-
gocode/src/flyweight/example-socket-clientserver/example-socket-clientserver
116-
gocode/src/flyweight/extension
117-
gocode/src/flyweight/extension2
118-
gocode/src/flyweight/otf/*.sbeir
67+
gocode/*/pkg
68+
gocode/struct/src/*/*.go
69+
!gocode/struct/src/*/*_test.go
70+
gocode/struct/src/*/*/*.go
71+
!gocode/struct/src/*/*/*_test.go
72+
gocode/struct/src/example-schema/example-schema*
73+
gocode/struct/src/example-socket-clientserver/example-socket-clientserver
74+
gocode/flyweight/src/*/*.go
75+
!gocode/flyweight/src/*/*_test.go
76+
gocode/flyweight/src/*/*/*.go
77+
!gocode/flyweight/src/*/*/*_test.go
11978

12079
# csharp
12180
csharp/*/bin

build.gradle

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ tasks.register('generateGolangCodecTestComposite', JavaExec) {
699699
mainClass.set('uk.co.real_logic.sbe.SbeTool')
700700
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
701701
systemProperties(
702-
'sbe.output.dir': 'gocode/src/struct',
702+
'sbe.output.dir': 'gocode/struct/src',
703703
'sbe.target.language': 'golang')
704704
args = ['sbe-tool/src/test/resources/composite-elements-schema-rc4.xml']
705705
}
@@ -708,7 +708,7 @@ tasks.register('generateGolangCodecTestBasic', JavaExec) {
708708
mainClass.set('uk.co.real_logic.sbe.SbeTool')
709709
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
710710
systemProperties(
711-
'sbe.output.dir': 'gocode/src/struct/basic',
711+
'sbe.output.dir': 'gocode/struct/src/basic',
712712
'sbe.target.language': 'golang')
713713
args = ['sbe-tool/src/test/resources/basic-types-schema.xml']
714714
}
@@ -717,7 +717,7 @@ tasks.register('generateGolangCodecTestGroup', JavaExec) {
717717
mainClass.set('uk.co.real_logic.sbe.SbeTool')
718718
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
719719
systemProperties(
720-
'sbe.output.dir': 'gocode/src/struct/group',
720+
'sbe.output.dir': 'gocode/struct/src/group',
721721
'sbe.target.language': 'golang')
722722
args = ['sbe-tool/src/test/resources/basic-group-schema.xml']
723723
}
@@ -726,7 +726,7 @@ tasks.register('generateGolangCodecTestVarData', JavaExec) {
726726
mainClass.set('uk.co.real_logic.sbe.SbeTool')
727727
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
728728
systemProperties(
729-
'sbe.output.dir': 'gocode/src/struct/vardata',
729+
'sbe.output.dir': 'gocode/struct/src/vardata',
730730
'sbe.target.language': 'golang')
731731
args = ['sbe-tool/src/test/resources/basic-variable-length-schema.xml']
732732
}
@@ -735,7 +735,7 @@ tasks.register('generateGolangCodecsWithXIncludes', JavaExec) {
735735
mainClass.set('uk.co.real_logic.sbe.SbeTool')
736736
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
737737
systemProperties(
738-
'sbe.output.dir': 'gocode/src/struct',
738+
'sbe.output.dir': 'gocode/struct/src',
739739
'sbe.target.language': 'golang',
740740
'sbe.xinclude.aware': 'true',
741741
'sbe.validation.xsd': validationXsdPath)
@@ -747,7 +747,7 @@ tasks.register('generateGolangCodecsWithXSD', JavaExec) {
747747
mainClass.set('uk.co.real_logic.sbe.SbeTool')
748748
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
749749
systemProperties(
750-
'sbe.output.dir': 'gocode/src/struct',
750+
'sbe.output.dir': 'gocode/struct/src',
751751
'sbe.target.language': 'golang',
752752
'sbe.xinclude.aware': 'true',
753753
'sbe.validation.xsd': validationXsdPath)
@@ -773,7 +773,7 @@ tasks.register('generateGolangFlyweightCodecTestComposite', JavaExec) {
773773
mainClass.set('uk.co.real_logic.sbe.SbeTool')
774774
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
775775
systemProperties(
776-
'sbe.output.dir': 'gocode/src/flyweight',
776+
'sbe.output.dir': 'gocode/flyweight/src',
777777
'sbe.go.generate.generate.flyweights': 'true',
778778
'sbe.target.language': 'golang')
779779
args = ['sbe-tool/src/test/resources/composite-elements-schema-rc4.xml']
@@ -783,7 +783,7 @@ tasks.register('generateGolangFlyweightCodecTestBasic', JavaExec) {
783783
mainClass.set('uk.co.real_logic.sbe.SbeTool')
784784
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
785785
systemProperties(
786-
'sbe.output.dir': 'gocode/src/flyweight/basic',
786+
'sbe.output.dir': 'gocode/flyweight/src/basic',
787787
'sbe.go.generate.generate.flyweights': 'true',
788788
'sbe.target.language': 'golang')
789789
args = ['sbe-tool/src/test/resources/basic-types-schema.xml']
@@ -793,7 +793,7 @@ tasks.register('generateGolangFlyweightCodecTestGroup', JavaExec) {
793793
mainClass.set('uk.co.real_logic.sbe.SbeTool')
794794
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
795795
systemProperties(
796-
'sbe.output.dir': 'gocode/src/flyweight/group',
796+
'sbe.output.dir': 'gocode/flyweight/src/group',
797797
'sbe.go.generate.generate.flyweights': 'true',
798798
'sbe.target.language': 'golang')
799799
args = ['sbe-tool/src/test/resources/basic-group-schema.xml']
@@ -803,7 +803,7 @@ tasks.register('generateGolangFlyweightCodecTestVarData', JavaExec) {
803803
mainClass.set('uk.co.real_logic.sbe.SbeTool')
804804
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
805805
systemProperties(
806-
'sbe.output.dir': 'gocode/src/flyweight/vardata',
806+
'sbe.output.dir': 'gocode/flyweight/src/vardata',
807807
'sbe.go.generate.generate.flyweights': 'true',
808808
'sbe.target.language': 'golang')
809809
args = ['sbe-tool/src/test/resources/basic-variable-length-schema.xml']
@@ -813,7 +813,7 @@ tasks.register('generateGolangFlyweightCodecsWithXIncludes', JavaExec) {
813813
mainClass.set('uk.co.real_logic.sbe.SbeTool')
814814
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
815815
systemProperties(
816-
'sbe.output.dir': 'gocode/src/flyweight',
816+
'sbe.output.dir': 'gocode/flyweight/src',
817817
'sbe.go.generate.generate.flyweights': 'true',
818818
'sbe.target.language': 'golang',
819819
'sbe.xinclude.aware': 'true',
@@ -826,7 +826,7 @@ tasks.register('generateGolangFlyweightCodecsWithXSD', JavaExec) {
826826
mainClass.set('uk.co.real_logic.sbe.SbeTool')
827827
classpath = project(':sbe-tool').sourceSets.main.runtimeClasspath
828828
systemProperties(
829-
'sbe.output.dir': 'gocode/src/flyweight',
829+
'sbe.output.dir': 'gocode/flyweight/src',
830830
'sbe.go.generate.generate.flyweights': 'true',
831831
'sbe.target.language': 'golang',
832832
'sbe.xinclude.aware': 'true',

gocode/Makefile

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,91 +19,91 @@ all: example test # bench
1919
# This target is used to build golang files using parent gradle
2020
# script's invocation of sbe-tool in case it needs to be run again. We
2121
# use this one output file to check that dependency as it's simple
22-
DEP=src/struct/simple/SbeMarshalling.go
22+
DEP=struct/src/simple/SbeMarshalling.go
2323
$(DEP): $(SBE_JAR)
2424
(cd ..; ./gradlew generateGolangCodecs)
25-
(export GOPATH=$(GOPATH) && \
26-
cd src/struct/simple && \
25+
(export GOPATH=$(GOPATH)/struct && \
26+
cd struct/src/simple && \
2727
go build && \
2828
$(SAVE_FORMAT) \
2929
go fmt && \
3030
go test)
3131

3232
# Will regenerate codecs by removing dependencies
3333
clean:
34-
rm -f src/struct/*/SbeMarshalling.go src/struct/*/*/SbeMarshalling.go
34+
rm -f struct/src/*/SbeMarshalling.go struct/src/*/*/SbeMarshalling.go
3535

36-
# Example code and benchmarking
37-
example: src/struct/example-schema/example-schema
38-
src/struct/example-schema/example-schema: $(DEP)
39-
(export GOPATH=$(GOPATH) && \
40-
cd src/struct/example-schema && \
36+
# Example code and benchmarking
37+
example: struct/src/example-schema/example-schema
38+
struct/src/example-schema/example-schema: $(DEP)
39+
(export GOPATH=$(GOPATH)/struct && \
40+
cd struct/src/example-schema && \
4141
go build && \
4242
go fmt && \
4343
./example-schema)
4444

4545
bench: $(DEP)
46-
(export GOPATH=$(GOPATH) && \
47-
cd src/struct/example-schema && \
46+
(export GOPATH=$(GOPATH)/struct && \
47+
cd struct/src/example-schema && \
4848
go test --bench . -cpuprofile=cpu.out && \
4949
go tool pprof -text example-schema.test cpu.out)
5050

51-
src/struct/baseline/SbeMarshalling.go: $(DEP)
51+
struct/src/baseline/SbeMarshalling.go: $(DEP)
5252
$(GOPATH)/sbe-tool -d src -s $(EXAMPLES_SCHEMA)
53-
(export GOPATH=$(GOPATH) && \
54-
cd src/struct/baseline && \
53+
(export GOPATH=$(GOPATH)/struct && \
54+
cd struct/src/baseline && \
5555
go build && \
5656
go fmt && \
5757
go test && \
5858
go install)
5959

6060
# The first set does a make install as there is a test that uses
6161
# multiple packages and needs them in GOPATH The second set work in
62-
# src/struct/foo, and the third need a GOPATH addition as for Java and C++
62+
# struct/src/foo, and the third need a GOPATH addition as for Java and C++
6363
# they generate into the same directory but golang doesn't allow that
6464
test: $(DEP)
65-
(export GOPATH=$(GOPATH) && \
65+
(export GOPATH=$(GOPATH)/struct && \
6666
(for t in baseline extension; do \
67-
export GOPATH=$(GOPATH) && \
68-
cd $(GOPATH)/src/struct/$$t && \
67+
export GOPATH=$(GOPATH)/struct && \
68+
cd $(GOPATH)/struct/src/$$t && \
6969
go build && \
7070
go fmt && \
7171
go test && \
7272
go install \
7373
;done))
74-
(export GOPATH=$(GOPATH) && \
74+
(export GOPATH=$(GOPATH)/struct && \
7575
(for t in baseline-bigendian mktdata group_with_data group_with_data_extension composite_elements composite since-deprecated simple issue435 issue472 issue483 issue488 issue560 issue847 issue848 issue849 issue505 test973; do \
76-
cd $(GOPATH)/src/struct/$$t && \
76+
cd $(GOPATH)/struct/src/$$t && \
7777
go build && \
7878
go fmt && \
7979
go test \
8080
;done))
8181
(for t in vardata group basic; do \
82-
export GOPATH=$(GOPATH)/$$t && \
83-
cd $(GOPATH)/src/struct/$$t/'SBE tests' && \
82+
export GOPATH=$(GOPATH)/struct/$$t && \
83+
cd $(GOPATH)/struct/src/$$t/'SBE tests' && \
8484
go build && \
8585
go fmt && \
8686
go test \
8787
;done)
88-
(export GOPATH=$(GOPATH) && \
88+
(export GOPATH=$(GOPATH)/flyweight && \
8989
(for t in baseline extension; do \
90-
export GOPATH=$(GOPATH) && \
91-
cd $(GOPATH)/src/flyweight/$$t && \
90+
export GOPATH=$(GOPATH)/flyweight && \
91+
cd $(GOPATH)/flyweight/src/$$t && \
9292
go build && \
9393
go fmt && \
9494
go test && \
9595
go install \
9696
;done))
97-
(export GOPATH=$(GOPATH) && \
97+
(export GOPATH=$(GOPATH)/flyweight && \
9898
(for t in baseline-bigendian mktdata group_with_data group_with_data_extension composite_elements composite since-deprecated simple issue435 issue472 issue483 issue488 issue560 issue847 issue848 issue849; do \
99-
cd $(GOPATH)/src/flyweight/$$t && \
99+
cd $(GOPATH)/flyweight/src/$$t && \
100100
go build && \
101101
go fmt && \
102102
go test \
103103
;done))
104104
(for t in vardata group basic; do \
105-
export GOPATH=$(GOPATH)/$$t && \
106-
cd $(GOPATH)/src/flyweight/$$t/'SBE tests' && \
105+
export GOPATH=$(GOPATH)/flyweight/$$t && \
106+
cd $(GOPATH)/flyweight/src/$$t/'SBE tests' && \
107107
go build && \
108108
go fmt && \
109109
go test \

0 commit comments

Comments
 (0)