<commit_before>REPO		        ?= oneprovider

PKG_REVISION    ?= $(shell git describe --tags --always)
PKG_VERSION	    ?= $(shell git describe --tags --always | tr - .)
PKG_ID           = oneprovider-$(PKG_VERSION)
PKG_BUILD        = 1
BASE_DIR         = $(shell pwd)
ERLANG_BIN       = $(shell dirname $(shell which erl))
REBAR           ?= $(BASE_DIR)/rebar
PKG_VARS_CONFIG  = pkg.vars.config
OVERLAY_VARS    ?=

.PHONY: deps test package

all: rel

##
## Rebar targets
##

compile:
	./rebar compile

deps:
	./rebar get-deps

generate: deps compile
	./rebar generate $(OVERLAY_VARS)

clean:
	./rebar clean

distclean:
	./rebar delete-deps

##
## Release targets
##

rel: generate
	make -C appmock/ rel
	make -C op_ccm/ rel

relclean:
	rm -rf rel/test_cluster
	rm -rf rel/oneprovider_node
	rm -rf appmock/rel/appmock
	rm -rf op_ccm/rel/op_ccm

##
## Testing targets
##

eunit:
	./rebar eunit skip_deps=true suites=${SUITES}
## Rename all tests in order to remove duplicated names (add _(++i) suffix to each test)
	@for tout in `find test -name "TEST-*.xml"`; do awk '/testcase/{gsub("_[0-9]+\"", "_" ++i "\"")}1' $$tout > $$tout.tmp; mv $$tout.tmp $$tout; done

##<commit_msg>VFS-1053 do not overlay vars in dependent modules<commit_after>REPO		        ?= oneprovider

PKG_REVISION    ?= $(shell git describe --tags --always)
PKG_VERSION	    ?= $(shell git describe --tags --always | tr - .)
PKG_ID           = oneprovider-$(PKG_VERSION)
PKG_BUILD        = 1
BASE_DIR         = $(shell pwd)
ERLANG_BIN       = $(shell dirname $(shell which erl))
REBAR           ?= $(BASE_DIR)/rebar
PKG_VARS_CONFIG  = pkg.vars.config
OVERLAY_VARS    ?=

.PHONY: deps test package

all: rel

##
## Rebar targets
##

compile:
	./rebar compile

deps:
	./rebar get-deps

generate: deps compile
	./rebar generate $(OVERLAY_VARS)

clean:
	./rebar clean

distclean:
	./rebar delete-deps

##
## Release targets
##

rel: generate
	OVERLAY_VARS="" make -C appmock/ rel
	OVERLAY_VARS="" make -C op_ccm/ rel

relclean:
	rm -rf rel/test_cluster
	rm -rf rel/oneprovider_node
	rm -rf appmock/rel/appmock
	rm -rf op_ccm/rel/op_ccm

##
## Testing targets
##

eunit:
	./rebar eunit skip_deps=true suites=${SUITES}
## Rename all tests in order to remove duplicated names (add _(++i) suffix to each test)
	@for tout in `find test -name "TEST-*.xml"`; do awk '/testcase/{gsub("_[0-9]+\"", "_" ++i "\"")}1' $$tout > $$tout.tmp; mv $$tout.tmp $$tout; done

##
{'fraction_non_alphanumeric': 0.14917355371900826, 'fraction_numerical': 0.0049586776859504135, 'mean_word_length': 3.082630691399663, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2569953', 'n_tokens_mistral': 965, 'n_tokens_neox': 941, 'n_words': 257}