Skip to content

Commit f446463

Browse files
authored
Merge pull request #70 from k-takata/reduce-time-for-config_h
Reduce time for creating Ruby's config.h
2 parents 9fa8b93 + c45901d commit f446463

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

appveyor.bat

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ set MZSCHEME_VER=%RACKET_VER%
4747
set RUBY_VER=24
4848
set RUBY_API_VER_LONG=2.4.0
4949
set RUBY_BRANCH=ruby_2_4
50+
set RUBY_URL=https://github.com/ruby/ruby/archive/%RUBY_BRANCH%.zip
5051
set RUBY32_DIR=C:\Ruby%RUBY_VER%
5152
set RUBY64_DIR=C:\Ruby%RUBY_VER%-x64
5253
set RUBY_DIR=!RUBY%BIT%_DIR!
@@ -120,11 +121,16 @@ copy %TCL_DIR%\bin\%TCL_DLL% vim\src\
120121
:: Ruby
121122
:: RubyInstaller is built by MinGW, so we cannot use header files from it.
122123
:: Download the source files and generate config.h for MSVC.
123-
git clone https://github.com/ruby/ruby.git -b %RUBY_BRANCH% --depth 1 -q ../ruby
124+
rem git clone https://github.com/ruby/ruby.git -b %RUBY_BRANCH% --depth 1 -q ../ruby
125+
call :downloadfile %RUBY_URL% downloads\ruby.zip
126+
:: Extract the files only we needed to reduce the building time.
127+
:: We need to use `^^` to escape `!` because we enable delayed expansion.
128+
7z x downloads\ruby.zip */bin */enc/Makefile.in */win32 */common.mk -ir^^!version.h -xr^^!README.* -xr^^!*/win32/*.c -xr^^!*/win32/*.h -o.. > nul || exit 1
129+
move ..\ruby-%RUBY_BRANCH% ..\ruby > nul || exit 1
124130
pushd ..\ruby
125131
call win32\configure.bat
126132
echo on
127-
nmake .config.h.time
133+
nmake .config.h.time || exit 1
128134
xcopy /s .ext\include %RUBY_DIR%\include\ruby-%RUBY_API_VER_LONG%
129135
popd
130136

@@ -134,13 +140,13 @@ start /wait downloads\racket.exe /S
134140

135141
:: Install libintl.dll and iconv.dll
136142
call :downloadfile %GETTEXT32_URL% downloads\gettext32.zip
137-
7z e -y downloads\gettext32.zip -oc:\gettext32
143+
7z e -y downloads\gettext32.zip -oc:\gettext32 > nul || exit 1
138144
call :downloadfile %GETTEXT64_URL% downloads\gettext64.zip
139-
7z e -y downloads\gettext64.zip -oc:\gettext64
145+
7z e -y downloads\gettext64.zip -oc:\gettext64 > nul || exit 1
140146

141147
:: Install winpty
142148
call :downloadfile %WINPTY_URL% downloads\winpty.zip
143-
7z x -y downloads\winpty.zip -oc:\winpty
149+
7z x -y downloads\winpty.zip -oc:\winpty > nul || exit 1
144150
if /i "%ARCH%"=="x64" (
145151
copy /Y c:\winpty\x64_xp\bin\winpty.dll vim\src\winpty64.dll
146152
copy /Y c:\winpty\x64_xp\bin\winpty-agent.exe vim\src\
@@ -309,4 +315,4 @@ goto :eof
309315
if not exist %2 (
310316
curl -f -L %1 -o %2 || exit 1
311317
)
312-
goto :eof
318+
@goto :eof

0 commit comments

Comments
 (0)