Files

80 lines
2.0 KiB
Makefile
Raw Permalink Normal View History

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
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:
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 \
./tests/unknown_fields.go \
./tests/type_declaration.go \
2020-05-10 14:08:06 +03:00
./tests/type_declaration_skip.go \
./tests/members_escaped.go \
./tests/members_unescaped.go \
./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 \
./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
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
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
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
2019-08-29 18:26:29 +03:00
bench-other: generate
2019-08-29 18:48:49 +03:00
cd benchmark && make
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