-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
83 lines (61 loc) · 2.53 KB
/
Makefile
File metadata and controls
83 lines (61 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
SHELL := /bin/bash
PWD := $(shell pwd)
dotnet-build:
dotnet build
.PHONY: unit-tests
unit-tests:
cd unit-tests && \
dotnet test RepositoryTests && \
SQLCCACHE=./; sqlc generate && \
dotnet test CodegenTests
generate-end2end-tests:
./end2end/scripts/generate_tests.sh
# process type plugin
dotnet-publish-process:
dotnet publish LocalRunner -c release --output dist/
sync-sqlc-options:
./scripts/sync_sqlc_options.sh
sqlc-generate-requests: dotnet-publish-process
SQLCCACHE=./; sqlc -f sqlc.request.generated.yaml generate
sqlc-generate: sync-sqlc-options dotnet-publish-process sqlc-generate-requests
SQLCCACHE=./; sqlc -f sqlc.local.generated.yaml generate
test-plugin: unit-tests sqlc-generate generate-end2end-tests dotnet-build run-end2end-tests
# WASM type plugin
# Source files that should trigger a rebuild
WASM_SOURCES := $(shell find WasmRunner -name '*.cs' -o -name '*.csproj' 2>/dev/null | grep -v '/bin/' | grep -v '/obj/') \
$(shell find SqlcGenCsharp -name '*.cs' -o -name '*.csproj' 2>/dev/null | grep -v '/bin/' | grep -v '/obj/' || true)
# Final output file - this is what we check for caching
WASM_PLUGIN_OUTPUT := dist/plugin.wasm
# Make setup-wasm-plugin depend on the actual output file (not phony)
setup-wasm-plugin: $(WASM_PLUGIN_OUTPUT)
@echo "WASM plugin is up to date"
# Build and copy plugin if output doesn't exist or sources are newer
$(WASM_PLUGIN_OUTPUT): $(WASM_SOURCES)
dotnet publish WasmRunner -c release --output dist/
./scripts/wasm/copy_plugin_to.sh dist
./scripts/wasm/update_sha.sh sqlc.ci.yaml
run-end2end-tests:
./end2end/scripts/run_tests.sh
# Benchmarks
sqlc-generate-benchmark:
SQLCCACHE=./; sqlc -f benchmark/sqlc.yaml generate
run-benchmark-sqlite-reads: sqlc-generate-benchmark
./benchmark/scripts/run_single_benchmark.sh sqlite reads
run-benchmark-sqlite-writes: sqlc-generate-benchmark
./benchmark/scripts/run_single_benchmark.sh sqlite writes
run-benchmark-postgresql-reads: sqlc-generate-benchmark
./benchmark/scripts/run_single_benchmark.sh postgresql reads
run-benchmark-postgresql-writes: sqlc-generate-benchmark
./benchmark/scripts/run_single_benchmark.sh postgresql writes
run-benchmark-mysql-reads: sqlc-generate-benchmark
./benchmark/scripts/run_single_benchmark.sh mysql reads
run-benchmark-mysql-writes: sqlc-generate-benchmark
./benchmark/scripts/run_single_benchmark.sh mysql writes
# Manual
generate-protobuf:
./scripts/generate_protobuf.sh
dotnet-format:
dotnet format \
--exclude GeneratedProtobuf \
--exclude examples \
--exclude benchmark/*SqlcImpl