Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Commit 8bce4eb

Browse files
committed
build: i18n: windows work, refactor
* start to refactor download module * work on the windows files
1 parent 57cccf1 commit 8bce4eb

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

configure

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ root_dir = os.path.dirname(__file__)
1515
sys.path.insert(0, os.path.join(root_dir, 'tools', 'gyp', 'pylib'))
1616
from gyp.common import GetFlavor
1717

18+
# imports in tools/configure.d
19+
sys.path.insert(0, os.path.join(root_dir, 'tools', 'configure.d'))
20+
import nodedownload
21+
1822
# parse our options
1923
parser = optparse.OptionParser()
2024

@@ -722,12 +726,11 @@ def icu_download(path):
722726
'md5': '6b89d60e2f0e140898ae4d7f72323bca',
723727
},
724728
]
725-
def fmtMb(amt):
726-
return "{:.1f}".format(amt / 1024000.)
727-
spin = "\\|/-"
728729
def reporthook(count, size, total):
729730
sys.stdout.write('%c %sMB total, %sMB downloaded \r' %
730-
(spin[count%4], fmtMb(total), fmtMb(count*size)))
731+
(nodedownload.spin(count),
732+
nodedownload.formatSize(total),
733+
nodedownload.formatSize(count*size)))
731734
for icu in icus:
732735
url = icu['url']
733736
md5 = icu['md5']

tools/configure.d/nodedownload.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Moved some utilities here from ../../configure
2+
3+
def formatSize(amt):
4+
"""Format a size as a string"""
5+
return "{:.1f}".format(amt / 1024000.)
6+
7+
def spin(c):
8+
"""print out a spinner based on 'c'"""
9+
spin = "\\|/-"
10+
return (spin[c % len(spin)])

vcbuild.bat

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ set noetw_msi_arg=
3535
set noperfctr=
3636
set noperfctr_arg=
3737
set noperfctr_msi_arg=
38-
set i18n_arg=
38+
set i18n_arg=small-icu
3939

4040
:next-arg
4141
if "%1"=="" goto args-done
@@ -65,6 +65,7 @@ if /i "%1"=="upload" set upload=1&goto arg-ok
6565
if /i "%1"=="jslint" set jslint=1&goto arg-ok
6666
if /i "%1"=="small-icu" set i18n_arg=%1&goto arg-ok
6767
if /i "%1"=="full-icu" set i18n_arg=%1&goto arg-ok
68+
if /i "%1"=="intl-none" set i18n_arg=%1&goto arg-ok
6869

6970
echo Warning: ignoring invalid command line option `%1`.
7071

@@ -85,6 +86,7 @@ if defined noperfctr set noperfctr_arg=--without-perfctr& set noperfctr_msi_arg=
8586

8687
if "%i18n_arg%"=="full-icu" set i18n_arg=--with-intl=full-icu
8788
if "%i18n_arg%"=="small-icu" set i18n_arg=--with-intl=small-icu
89+
if "%i18n_arg%"=="intl-none" set i18n_arg=--with-intl=none
8890

8991
:project-gen
9092
@rem Skip project generation if requested.
@@ -232,7 +234,7 @@ python tools/closure_linter/closure_linter/gjslint.py --unix_mode --strict --noj
232234
goto exit
233235

234236
:help
235-
echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [nobuild] [nosign] [x86/x64]
237+
echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/intl-none] [nobuild] [nosign] [x86/x64]
236238
echo Examples:
237239
echo vcbuild.bat : builds release build
238240
echo vcbuild.bat debug : builds debug build

0 commit comments

Comments
 (0)