@echo off
setlocal

cd /d %~dp0
for /f "delims=" %%i in ('cd') do set CURRENT=%%i

@REM SET JAVA_HOME=D:\PF\Java\jdk1.7.0_45
@REM SET ANT_HOME=D:\PF\apache-ant-1.8.3
SET ANT_HOME=..\New-GUI(SN2)_File\lib\apache-ant-1.7.1

@REM SET PATH=%JAVA_HOME%\bin;%PATH%
SET PATH=%ANT_HOME%\bin;%PATH%

mkdir out_guid
mkdir out2

@REM msg.xmlからcsvファイルを作成する
java  -Xmx256M -jar ..\New-GUI(SN2)_File\lib\MM.jar -o
if not %ERRORLEVEL%==0 (exit /b %ERRORLEVEL%)


@REM dir /B replacementDefine > _out.txt
@REM 
@REM for /f "delims=" %%i in ('findstr .original _out.txt') do (
@REM   native2ascii.exe  "%CURRENT%\replacementDefine\%%i" > "%CURRENT%\replacementDefine\%%~ni"
@REM )
@REM 
@REM del _out.txt


call ant -f replace.xml
if not %ERRORLEVEL%==0 (exit /b %ERRORLEVEL%)

copy /Y out2\* out_guid

@REM csvファイルからbinファイルを作成する

dir /B out_guid > _out.txt

for /f "delims=" %%i in ('findstr _ja.csv _out.txt') do (
  ECHO %%i
  java -jar lib\\cvs2javaobj.jar "%CURRENT%\out_guid\%%i"
)

@REM for /f "delims=" %%i in ('findstr .original _out.txt') do (
@REM   native2ascii.exe  "%CURRENT%\out\%%i" > "%CURRENT%\out\%%~ni"
@REM )

del _out.txt

endlocal

EXIT /B 0

