@echo close all application before perform this file, otherwise you will most probably have insuficient memory error during compilation
@echo 
@echo zamknij wszystkie aplikacje do kompilacji, w przeciwnym razie może wystąpić błąd braku pamięci.
@echo 
@echo store all dirs: ("beehive3", "or", "ordesigner", "openremote.init") to d:\
@echo 
@echo TESTEd ON WIN7 64B
@echo check this batch file for location and versions of Java, Tomcat, ApacheAnt, initial files for copy and developement
@echo Other version of java can generate errors during compilation, in this case please install following versions.

pause
attrib -r -s -h d:\or\output\OpenRemote-Controller-2.0.0\webapps\*.* /S /D
del D:\or\output /q /F /s
del D:\or\runtime\apache-tomcat-6.0.18\webapps\designer.war /q /F
del D:\or\runtime\apache-tomcat-6.0.18\webapps\beehive.war /q /F
del D:\or\runtime\apache-tomcat-6.0.18\webapps\designer /q /s /F
del D:\or\runtime\apache-tomcat-6.0.18\webapps\beehive /q /s /F
del D:\beehive3\output\*.* /q /F
@echo ---------------------------------------------------
@echo Compiling BeeHive ver.3
@d:
@cd\
@cd beehive3
@set JAVA_HOME=c:\Program Files\Java\jdk1.6.0_35
rem @set JAVA_HOME=c:\Program Files\Java\jdk1.7.0_03
@call d:\or\tools\apache-ant-1.8.4\bin\ant.bat war
pause

@echo Compile OpenRemote Controller
@d:
@cd\
@cd or
@set JAVA_HOME=c:\Program Files\Java\jdk1.6.0_35
rem @set JAVA_HOME=c:\Program Files\Java\jdk1.7.0_03
@call d:\or\tools\apache-ant-1.8.4\bin\ant.bat
pause

@compile OpenRemote Designer to be used locally
@cd \
@cd ordesigner
@set JAVA_HOME=c:\Program Files\Java\jdk1.6.0_35
@call d:\or\tools\apache-ant-1.8.4\bin\ant.bat deploy
pause

rem exit


rem @set JAVA_HOME=c:\Program Files\Java\jdk1.7.0_03
@rem D:\ore\ui\Designer_2_14_0_Markab_work
@echo "Copying protocol ehouse"
@echo "Copying controller configuration setup"
xcopy d:\openremote.init\start.bat D:\or\output\OpenRemote-Controller-2.0.0\bin\ /y /F
del D:\or\output\OpenRemote-Controller-2.0.0\logs\*.* /q /s

pause
xcopy D:\beehive3\output\beehive.war  d:\or\output\OpenRemote-Controller-2.0.0\webapps\ /s /c /i /y /F
del D:\beehive3\output\logs\*.* /s /q
del D:\or\runtime\apache-tomcat-6.0.18\logs\*.* /q /s
del d:\or\output\OpenRemote-Controller-2.0.0\logs\*.* /q /s
rename d:\or\output\OpenRemote-Controller-2.0.0\webapps\Designer-1.0.0-2012-09-19-InstallerPro.war designer.war
@xcopy d:\workcopy\resources\1\*.* D:\or\output\OpenRemote-Controller-2.0.0\webapps\controller\  /s /c /i /y /F

call d:\or\output\OpenRemote-Controller-2.0.0\bin\start.bat
