43 lines
1008 B
Batchfile
43 lines
1008 B
Batchfile
@echo off
|
|
|
|
SET nome_azienda=vgalimenti
|
|
|
|
|
|
setlocal enabledelayedexpansion
|
|
set INTEXTFILE=build.gradle
|
|
set OUTTEXTFILE=build_out.gradle
|
|
set SEARCHTEXT=:dynamic__base
|
|
set REPLACETEXT=:dynamic_%nome_azienda%
|
|
set OUTPUTLINE=
|
|
|
|
for /f "tokens=1,* delims=¶" %%A in ( '"findstr /n ^^ %INTEXTFILE%"') do (
|
|
SET string=%%A
|
|
for /f "delims=: tokens=1,*" %%a in ("!string!") do set "string=%%b"
|
|
if "!string!" == "" (
|
|
echo.>>%OUTTEXTFILE%
|
|
) else (
|
|
SET modified=!string:%SEARCHTEXT%=%REPLACETEXT%!
|
|
echo !modified! >> %OUTTEXTFILE%
|
|
)
|
|
)
|
|
del %INTEXTFILE%
|
|
rename %OUTTEXTFILE% %INTEXTFILE%
|
|
|
|
pause
|
|
|
|
gradle build
|
|
|
|
|
|
for /f "tokens=1,* delims=¶" %%A in ( '"findstr /n ^^ %INTEXTFILE%"') do (
|
|
SET string=%%A
|
|
for /f "delims=: tokens=1,*" %%a in ("!string!") do set "string=%%b"
|
|
if "!string!" == "" (
|
|
echo.>>%OUTTEXTFILE%
|
|
) else (
|
|
SET modified=!string:%REPLACETEXT%=%SEARCHTEXT%!
|
|
echo !modified! >> %OUTTEXTFILE%
|
|
)
|
|
)
|
|
del %INTEXTFILE%
|
|
rename %OUTTEXTFILE% %INTEXTFILE%
|