2025-09-15 11:14:50 +03:00
|
|
|
VERSION := $(shell git describe --tags --always --dirty)
|
|
|
|
|
COMMIT := $(shell git rev-parse --short HEAD)
|
|
|
|
|
|
2016-02-28 03:16:29 +03:00
|
|
|
all: test
|
|
|
|
|
|
|
|
|
|
clean:
|
2019-08-29 18:53:33 +03:00
|
|
|
rm -rf bin
|
2017-10-19 19:18:13 -07:00
|
|
|
rm -rf tests/*_easyjson.go
|
2019-08-29 18:26:29 +03:00
|
|
|
rm -rf benchmark/*_easyjson.go
|
2016-02-28 03:16:29 +03:00
|
|
|
|
|
|
|
|
build:
|
2025-09-15 11:14:50 +03:00
|
|
|
go build -ldflags="-s -w -X 'main.Version=$(VERSION)' -X 'main.Commit=$(COMMIT)'" -o ./bin/easyjson ./easyjson
|
|
|
|
|
|
2016-02-28 03:16:29 +03:00
|
|
|
|
2019-08-29 18:26:29 +03:00
|
|
|
generate: build
|
2019-08-29 18:53:33 +03:00
|
|
|
bin/easyjson -stubs \
|
2019-08-29 18:26:29 +03:00
|
|
|
./tests/snake.go \
|
|
|
|
|
./tests/data.go \
|
|
|
|
|
./tests/omitempty.go \
|
2026-03-14 07:51:56 -07:00
|
|
|
./tests/omitzero.go \
|
2019-08-29 18:26:29 +03:00
|
|
|
./tests/nothing.go \
|
|
|
|
|
./tests/named_type.go \
|
|
|
|
|
./tests/custom_map_key_type.go \
|
|
|
|
|
./tests/embedded_type.go \
|
|
|
|
|
./tests/reference_to_pointer.go \
|
2019-10-09 11:59:07 +03:00
|
|
|
./tests/html.go \
|
2020-02-17 15:02:51 +03:00
|
|
|
./tests/unknown_fields.go \
|
2020-04-11 19:04:13 +03:00
|
|
|
./tests/type_declaration.go \
|
2020-05-10 14:08:06 +03:00
|
|
|
./tests/type_declaration_skip.go \
|
2020-04-11 19:04:13 +03:00
|
|
|
./tests/members_escaped.go \
|
|
|
|
|
./tests/members_unescaped.go \
|
2020-04-11 20:48:34 +03:00
|
|
|
./tests/intern.go \
|
|
|
|
|
./tests/nocopy.go \
|
2020-07-14 17:27:06 +03:00
|
|
|
./tests/escaping.go
|
|
|
|
|
bin/easyjson -all \
|
|
|
|
|
./tests/data.go \
|
|
|
|
|
./tests/nothing.go \
|
|
|
|
|
./tests/errors.go \
|
|
|
|
|
./tests/html.go \
|
|
|
|
|
./tests/type_declaration_skip.go
|
|
|
|
|
bin/easyjson \
|
|
|
|
|
./tests/nested_easy.go \
|
|
|
|
|
./tests/named_type.go \
|
|
|
|
|
./tests/custom_map_key_type.go \
|
|
|
|
|
./tests/embedded_type.go \
|
|
|
|
|
./tests/reference_to_pointer.go \
|
|
|
|
|
./tests/key_marshaler_map.go \
|
|
|
|
|
./tests/unknown_fields.go \
|
|
|
|
|
./tests/type_declaration.go \
|
|
|
|
|
./tests/members_escaped.go \
|
|
|
|
|
./tests/intern.go \
|
|
|
|
|
./tests/nocopy.go \
|
2020-04-24 20:26:02 +03:00
|
|
|
./tests/escaping.go \
|
2025-06-06 10:19:01 +03:00
|
|
|
./tests/nested_marshaler.go \
|
|
|
|
|
./tests/text_marshaler.go
|
2019-08-29 18:53:33 +03:00
|
|
|
bin/easyjson -snake_case ./tests/snake.go
|
|
|
|
|
bin/easyjson -omit_empty ./tests/omitempty.go
|
2026-03-14 07:51:56 -07:00
|
|
|
bin/easyjson -omit_zero ./tests/omitzero.go
|
2020-02-04 18:16:09 +03:00
|
|
|
bin/easyjson -build_tags=use_easyjson -disable_members_unescape ./benchmark/data.go
|
2019-08-29 18:53:33 +03:00
|
|
|
bin/easyjson -disallow_unknown_fields ./tests/disallow_unknown.go
|
2020-04-11 19:04:13 +03:00
|
|
|
bin/easyjson -disable_members_unescape ./tests/members_unescaped.go
|
2016-02-28 03:16:29 +03:00
|
|
|
|
2019-08-29 18:26:29 +03:00
|
|
|
test: generate
|
2016-04-01 23:28:21 +03:00
|
|
|
go test \
|
2019-08-29 18:26:29 +03:00
|
|
|
./tests \
|
|
|
|
|
./jlexer \
|
|
|
|
|
./gen \
|
|
|
|
|
./buffer
|
|
|
|
|
cd benchmark && go test -benchmem -tags use_easyjson -bench .
|
|
|
|
|
golint -set_exit_status ./tests/*_easyjson.go
|
2016-04-01 23:22:08 +03:00
|
|
|
|
2019-08-29 18:26:29 +03:00
|
|
|
bench-other: generate
|
2019-08-29 18:48:49 +03:00
|
|
|
cd benchmark && make
|
2016-04-01 23:22:08 +03:00
|
|
|
|
|
|
|
|
bench-python:
|
2016-02-28 03:16:29 +03:00
|
|
|
benchmark/ujson.sh
|
|
|
|
|
|
|
|
|
|
|
2019-08-29 18:26:29 +03:00
|
|
|
.PHONY: clean generate test build
|