###########################################################################
#
# FairCom Corporation demo Makefile
#
###########################################################################
GRADLE=./gradlew
GRADLEQ=$(GRADLE) -q --console plain
ALL: 
	@echo This demo is intended to show how is it possible to interact with 
	@echo c-treeACE Replication Manager by sending simple HTTP calls through 
	@echo a Java program.
	@echo In order to make sure that this sample will work properly 
	@echo please prepare the environment as described in this API readme file.
	@echo ""
	@echo When ready run type \'make build\' to build the tutorial
	
build: 
	$(GRADLE) build
	@echo The demo is ready to run.
	@echo In order to see how this program interacts we suggest you to open
	@echo your browser and visit:
	@echo http://localhost:8080/ReplicationManager
	@echo Then type \'make run\' to run the tutorial.

run:
	@echo We will now setup a replication plan between the two servers
	@sleep 5
	@$(GRADLE) run --args=setup
	@$(GRADLEQ) run --args=status
	@echo We will now stop the replication plan
	@sleep 5
	@$(GRADLE) run --args=stop
	@$(GRADLEQ) run --args=status
	@echo We will now restart the replication plan
	@sleep 5
	@$(GRADLE) run --args=start
	@$(GRADLEQ) run --args=status
