Skip to content

Commit 183c180

Browse files
committed
feat: remove submodule
1 parent aa34362 commit 183c180

File tree

6 files changed

+73
-63
lines changed

6 files changed

+73
-63
lines changed

.gitmodules

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,3 @@
22
path = third_party/_submodules/protobuf
33
url = https://github.com/protocolbuffers/protobuf
44
ignore = dirty
5-
[submodule "third_party/_submodules/tableau"]
6-
path = third_party/_submodules/tableau
7-
url = https://github.com/tableauio/tableau
8-
ignore = dirty

test/cpp-tableau-loader/gen.bat

Lines changed: 59 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,59 @@
1-
@echo off
2-
setlocal
3-
setlocal enabledelayedexpansion
4-
5-
for /f "delims=" %%i in ('git rev-parse --show-toplevel') do set repoRoot=%%i
6-
cd /d "%repoRoot%"
7-
8-
set "PROTOC=%repoRoot%\third_party\_submodules\protobuf\cmake\build\protoc.exe"
9-
set "PROTOBUF_PROTO=%repoRoot%\third_party\_submodules\protobuf\src"
10-
set "TABLEAU_PROTO=%repoRoot%\third_party\_submodules\tableau\proto"
11-
set "ROOTDIR=%repoRoot%\test\cpp-tableau-loader"
12-
set "PLGUIN_DIR=%repoRoot%\cmd\protoc-gen-cpp-tableau-loader"
13-
set "PROTOCONF_IN=%repoRoot%\test\proto"
14-
set "PROTOCONF_OUT=%ROOTDIR%\src\protoconf"
15-
16-
REM remove old generated files
17-
rmdir /s /q "%PROTOCONF_OUT%" 2>nul
18-
mkdir "%PROTOCONF_OUT%"
19-
20-
REM build protoc plugin of loader
21-
pushd "%PLGUIN_DIR%"
22-
go build
23-
popd
24-
25-
set "PATH=%PATH%;%PLGUIN_DIR%"
26-
27-
set protoFiles=
28-
pushd "%PROTOCONF_IN%"
29-
for /R %%f in (*.proto) do (
30-
set protoFiles=!protoFiles! "%%f"
31-
)
32-
popd
33-
"%PROTOC%" ^
34-
--cpp-tableau-loader_out="%PROTOCONF_OUT%" ^
35-
--cpp-tableau-loader_opt=paths=source_relative,shards=2 ^
36-
--cpp_out="%PROTOCONF_OUT%" ^
37-
--proto_path="%PROTOBUF_PROTO%" ^
38-
--proto_path="%TABLEAU_PROTO%" ^
39-
--proto_path="%PROTOCONF_IN%" ^
40-
!protoFiles!
41-
42-
set "TABLEAU_IN=%TABLEAU_PROTO%\tableau\protobuf"
43-
set "TABLEAU_OUT=%ROOTDIR%\src"
44-
REM remove old generated files
45-
if exist "%TABLEAU_OUT%\tableau" rmdir /s /q "%TABLEAU_OUT%\tableau"
46-
mkdir "%TABLEAU_OUT%\tableau"
47-
48-
"%PROTOC%" ^
49-
--cpp_out="%TABLEAU_OUT%" ^
50-
--proto_path="%PROTOBUF_PROTO%" ^
51-
--proto_path="%TABLEAU_PROTO%" ^
52-
"%TABLEAU_IN%\tableau.proto" "%TABLEAU_IN%\wellknown.proto"
53-
54-
endlocal
55-
endlocal
1+
@echo off
2+
setlocal
3+
setlocal enabledelayedexpansion
4+
5+
for /f "delims=" %%i in ('git rev-parse --show-toplevel') do set repoRoot=%%i
6+
cd /d "%repoRoot%"
7+
go mod tidy
8+
9+
set "PROTOC=%repoRoot%\third_party\_submodules\protobuf\cmake\build\protoc.exe"
10+
set "PROTOBUF_PROTO=%repoRoot%\third_party\_submodules\protobuf\src"
11+
set "TABLEAU_GOPATH=github.com/tableauio/tableau"
12+
for /f "delims=" %%G in ('go env GOPATH') do set "GOPATH=%%G"
13+
for /f "tokens=2" %%V in ('findstr /c:"%TABLEAU_GOPATH%" go.mod') do set "VERSION=%%V"
14+
set "TABLEAU_PROTO=%GOPATH%\pkg\mod\%TABLEAU_GOPATH%@%VERSION%\proto"
15+
set "ROOTDIR=%repoRoot%\test\cpp-tableau-loader"
16+
set "PLGUIN_DIR=%repoRoot%\cmd\protoc-gen-cpp-tableau-loader"
17+
set "PROTOCONF_IN=%repoRoot%\test\proto"
18+
set "PROTOCONF_OUT=%ROOTDIR%\src\protoconf"
19+
20+
REM remove old generated files
21+
rmdir /s /q "%PROTOCONF_OUT%" 2>nul
22+
mkdir "%PROTOCONF_OUT%"
23+
24+
REM build protoc plugin of loader
25+
pushd "%PLGUIN_DIR%"
26+
go build
27+
popd
28+
29+
set "PATH=%PATH%;%PLGUIN_DIR%"
30+
31+
set protoFiles=
32+
pushd "%PROTOCONF_IN%"
33+
for /R %%f in (*.proto) do (
34+
set protoFiles=!protoFiles! "%%f"
35+
)
36+
popd
37+
"%PROTOC%" ^
38+
--cpp-tableau-loader_out="%PROTOCONF_OUT%" ^
39+
--cpp-tableau-loader_opt=paths=source_relative,shards=2 ^
40+
--cpp_out="%PROTOCONF_OUT%" ^
41+
--proto_path="%PROTOBUF_PROTO%" ^
42+
--proto_path="%TABLEAU_PROTO%" ^
43+
--proto_path="%PROTOCONF_IN%" ^
44+
!protoFiles!
45+
46+
set "TABLEAU_IN=%TABLEAU_PROTO%\tableau\protobuf"
47+
set "TABLEAU_OUT=%ROOTDIR%\src"
48+
REM remove old generated files
49+
if exist "%TABLEAU_OUT%\tableau" rmdir /s /q "%TABLEAU_OUT%\tableau"
50+
mkdir "%TABLEAU_OUT%\tableau"
51+
52+
"%PROTOC%" ^
53+
--cpp_out="%TABLEAU_OUT%" ^
54+
--proto_path="%PROTOBUF_PROTO%" ^
55+
--proto_path="%TABLEAU_PROTO%" ^
56+
"%TABLEAU_IN%\tableau.proto" "%TABLEAU_IN%\wellknown.proto"
57+
58+
endlocal
59+
endlocal

test/cpp-tableau-loader/gen.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ set -o pipefail
77
shopt -s globstar
88

99
cd "$(git rev-parse --show-toplevel)"
10+
go mod tidy
11+
1012
PROTOC="./third_party/_submodules/protobuf/cmake/build/protoc"
1113
PROTOBUF_PROTO="./third_party/_submodules/protobuf/src"
12-
TABLEAU_PROTO="./third_party/_submodules/tableau/proto"
14+
TABLEAU_GOPATH="github.com/tableauio/tableau"
15+
TABLEAU_PROTO="$(go env GOPATH)/pkg/mod/$TABLEAU_GOPATH@$(grep $TABLEAU_GOPATH go.mod | awk '{print $2}')/proto"
1316
ROOTDIR="./test/cpp-tableau-loader"
1417
PLGUIN_DIR="./cmd/protoc-gen-cpp-tableau-loader"
1518
PROTOCONF_IN="./test/proto"

test/go-tableau-loader/gen.bat

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@ setlocal enabledelayedexpansion
44

55
for /f "delims=" %%i in ('git rev-parse --show-toplevel') do set repoRoot=%%i
66
cd /d "%repoRoot%"
7+
go mod tidy
78

89
set "PROTOC=%repoRoot%\third_party\_submodules\protobuf\cmake\build\protoc.exe"
910
set "PROTOBUF_PROTO=%repoRoot%\third_party\_submodules\protobuf\src"
10-
set "TABLEAU_PROTO=%repoRoot%\third_party\_submodules\tableau\proto"
11+
set "PROTOBUF_PROTO=%repoRoot%\third_party\_submodules\protobuf\src"
12+
set "TABLEAU_GOPATH=github.com/tableauio/tableau"
13+
for /f "delims=" %%G in ('go env GOPATH') do set "GOPATH=%%G"
14+
for /f "tokens=2" %%V in ('findstr /c:"%TABLEAU_GOPATH%" go.mod') do set "VERSION=%%V"
15+
set "TABLEAU_PROTO=%GOPATH%\pkg\mod\%TABLEAU_GOPATH%@%VERSION%\proto"
1116
set "PLGUIN_DIR=%repoRoot%\cmd\protoc-gen-go-tableau-loader"
1217
set "PROTOCONF_IN=%repoRoot%\test\proto"
1318
set "PROTOCONF_OUT=%repoRoot%\test\go-tableau-loader\protoconf"

test/go-tableau-loader/gen.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ set -o pipefail
77
shopt -s globstar
88

99
cd "$(git rev-parse --show-toplevel)"
10+
go mod tidy
11+
1012
PROTOC="./third_party/_submodules/protobuf/cmake/build/protoc"
1113
PROTOBUF_PROTO="./third_party/_submodules/protobuf/src"
12-
TABLEAU_PROTO="./third_party/_submodules/tableau/proto"
14+
TABLEAU_GOPATH="github.com/tableauio/tableau"
15+
TABLEAU_PROTO="$(go env GOPATH)/pkg/mod/$TABLEAU_GOPATH@$(grep $TABLEAU_GOPATH go.mod | awk '{print $2}')/proto"
1316
PLGUIN_DIR="./cmd/protoc-gen-go-tableau-loader"
1417
PROTOCONF_IN="./test/proto"
1518
PROTOCONF_OUT="./test/go-tableau-loader/protoconf"

third_party/_submodules/tableau

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)