CARTONEXE=carton exec

dependencies-install:
	carton install

build:
	perl Build.PL
	./Build
	./Build test
	./Build install

test-v:
	${CARTONEXE} -- prove -vl t/

test:
	${CARTONEXE} -- prove -l t/

test-agent:
	${CARTONEXE} -- prove -vl t/03_agent.t

test-manager:
	${CARTONEXE} -- prove -vl t/07_manager.t

test-entities:
	${CARTONEXE} -- prove -vl t/02_abstraction.t

test-db:
	${CARTONEXE} -- prove -vl t/20_db.t

test-introspection:
	${CARTONEXE} -- prove -vl t/30_introspection.t

test-fame:
	${CARTONEXE} -- prove -vl t/50_fame.t

bump-version:
	perl-reversion -bump

build-tiny:
	mbtiny regenerate
	mbtiny dist

upload:
	mbtiny upload

# When this doesn't work it is because the ${{NEXT}} thing hasn't been replaced by a proper version in Changes file
# Also all those should be better executed through carton
release: bump-version build-tiny upload

db-schema:
	${CARTONEXE} script/teng_schema_dumper.pl > lib/Art/World/Model/Schema.pm

# Combining db-dump and db-recreate, by editing the SQL file in between makes possible to modify the schema
db-dump:
	echo '.dump' | sqlite3 art.db > schema.sql
	rm art.db

db-recreate:
	cat schema.sql | sqlite3 art.db
