@echo off

REM =======================================
REM This is the shell script for setting up
REM the HCP-Data Migrator command line.
REM Builds the path
REM Builds the classpath
REM Passes all parameters to the JVM
REM =======================================

REM You must set HCPDM_DIR to the directory root path of the HCP-Data Migrator tool

if not defined JAVA_CMD           set JAVA_CMD=java -version:1.7+  -Xmx512M -XX:+HeapDumpOnOutOfMemoryError
if not defined JAVAW_CMD          set JAVAW_CMD=javaw -version:1.7+  -Xmx512M -XX:+HeapDumpOnOutOfMemoryError

if not defined HCPDM_DIR      set HCPDM_DIR=%~dps0..
if not defined HCPDM_BIN_DIR  set HCPDM_BIN_DIR=%HCPDM_DIR%\bin
if not defined HCPDM_LIB_DIR  set HCPDM_LIB_DIR=%HCPDM_DIR%\lib
if not defined HCPDM_CONFIG_DIR set HCPDM_CONFIG_DIR=%HCPDM_DIR%\config

set path=%PATH%;%HCPDM_BIN_DIR%;
set HCPDM_CP=%CLASSPATH%

for %%j in ("%HCPDM_LIB_DIR%\*.jar") do set HCPDM_CP=!HCPDM_CP!;%%j

set HCPDM_JVMPROPS=%HCPDM_JVMPROPS% "-Dapplication_home_dir=%HCPDM_DIR%"
set HCPDM_JVMPROPS=%HCPDM_JVMPROPS% "-Djava.util.logging.config.file=%HCPDM_CONFIG_DIR%\hcpdm.logging.properties"
set HCPDM_JVMPROPS=%HCPDM_JVMPROPS% "-Dsun.net.spi.nameservice.provider.1=dns,sun"
