ICU-20593 Renaming Python buildtool to icutools.databuilder.

This commit is contained in:
Shane Carr 2019-05-06 16:37:10 -07:00 committed by Shane F. Carr
parent 9704216ef7
commit 702fdb6c33
24 changed files with 36 additions and 24 deletions

View file

@ -9123,7 +9123,8 @@ else
if test -f "$srcdir/data/locales/root.txt";
then
echo "Spawning Python to generate data/rules.mk..."
PYTHONPATH="$srcdir/data" $PYTHON -m buildtool \
PYTHONPATH="$srcdir/python" \
$PYTHON -m icutools.databuilder \
--mode gnumake \
--seqmode parallel \
--src_dir "$srcdir/data" \
@ -9138,7 +9139,8 @@ else
touch data/rules.mk
fi
echo "Spawning Python to generate test/testdata/rules.mk..."
PYTHONPATH="$srcdir/test/testdata:$srcdir/data" $PYTHON -m buildtool \
PYTHONPATH="$srcdir/python" \
$PYTHON -m icutools.databuilder \
--mode gnumake \
--seqmode parallel \
--src_dir "$srcdir/test/testdata" \

View file

@ -1399,7 +1399,8 @@ else
if test -f "$srcdir/data/locales/root.txt";
then
echo "Spawning Python to generate data/rules.mk..."
PYTHONPATH="$srcdir/data" $PYTHON -m buildtool \
PYTHONPATH="$srcdir/python" \
$PYTHON -m icutools.databuilder \
--mode gnumake \
--seqmode parallel \
--src_dir "$srcdir/data" \
@ -1414,7 +1415,8 @@ else
touch data/rules.mk
fi
echo "Spawning Python to generate test/testdata/rules.mk..."
PYTHONPATH="$srcdir/test/testdata:$srcdir/data" $PYTHON -m buildtool \
PYTHONPATH="$srcdir/python" \
$PYTHON -m icutools.databuilder \
--mode gnumake \
--seqmode parallel \
--src_dir "$srcdir/test/testdata" \

View file

@ -5,10 +5,10 @@
# TODO(ICU-20301): Remove this.
from __future__ import print_function
from buildtool import *
from buildtool import locale_dependencies
from buildtool import utils
from buildtool.request_types import *
from icutools.databuilder import *
from icutools.databuilder import locale_dependencies
from icutools.databuilder import utils
from icutools.databuilder.request_types import *
import os
import sys

View file

@ -136,7 +136,7 @@ cleanpackage:
$(RMV) $(LIBDIR)/*$(LIB_ICUDATA_NAME)*.$(SO)* $(LIBDIR)/$(LIB_STATIC_ICUDATA_NAME).$(A)
check-local:
PYTHONPATH=$(srcdir) @PYTHON@ -m buildtool.test
PYTHONPATH=$(top_srcdir)/python @PYTHON@ -m icutools.databuilder.test
# Find out if we have a source archive.
# If we have that, then use that instead of building everything from scratch.
@ -266,7 +266,7 @@ ifeq ($(TZDATA),)
TZDATA = $(firstword $(wildcard $(top_builddir)/tools/tzcode/tzdata*.tar.gz) $(wildcard $(top_srcdir)/tools/tzcode/tzdata*.tar.gz))
endif
# TODO(ICU-20466): Make the TZDATA override part of Python buildtool
# TODO(ICU-20466): Make the TZDATA override part of Python icutools.databuilder
ifneq ($(TZDATA),)
TZCODE_DIR=$(top_builddir)/tools/tzcode

View file

@ -111,7 +111,7 @@
<arg name="--specialsdir" value="${env.ICU4C_DIR}/source/data/xml/main"/>
<arg name="--supplementaldir" value="${env.CLDR_DIR}/common/supplemental" />
<arg name="--type" value="locales"/>
<arg name="--depgraphfile" value="../buildtool/locale_dependencies.py"/>
<arg name="--depgraphfile" value="../../python/icutools/databuilder/locale_dependencies.py"/>
</args>
<remapper>
<remap sourcePath="/Keys" targetDir="lang" />
@ -374,7 +374,7 @@
<fileset id="resfiles" dir="${env.ICU4C_DIR}/source/data/locales">
<include name="resfiles.mk" />
</fileset>
<fileset id="dependencies_py" dir="${env.ICU4C_DIR}/source/data/buildtool">
<fileset id="dependencies_py" dir="${env.ICU4C_DIR}/source/python/icutools/databuilder">
<include name="locale_dependencies.py" />
</fileset>
<fileset id="locales_split" dir="${env.ICU4C_DIR}/source/data">

View file

@ -233,7 +233,8 @@ $(TOOLS_TS): "$(ICUTOOLS)\genrb\$(CFGTOOLS)\genrb.exe" "$(ICUTOOLS)\gencnval\$(C
$(COREDATA_TS):
@cd "$(ICUSRCDATA)"
py -3 -B -m buildtool \
set PYTHONPATH=$(ICUP)\source\python;%PYTHONPATH%
py -3 -B -m icutools.databuilder \
--mode windows-exec \
--src_dir "$(ICUSRCDATA)" \
--tool_dir "$(ICUTOOLS)" \

View file

@ -0,0 +1,4 @@
# Copyright (C) 2018 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
# This is the root ICU namespace for build tools.

View file

@ -16,7 +16,6 @@ from .comment_stripper import CommentStripper
from .request_types import CopyRequest
from .renderers import makefile, common_exec
from . import filtration, utils
import BUILDRULES
flag_parser = argparse.ArgumentParser(
description = """Generates rules for building ICU binary data files from text
@ -37,11 +36,11 @@ with a lot of intermediate files.
Set LD_LIBRARY_PATH to include the lib directory. e.g., from icu4c/source:
$ LD_LIBRARY_PATH=lib PYTHONPATH=data python3 -m buildtool ...
$ LD_LIBRARY_PATH=lib PYTHONPATH=python python3 -m icutools.databuilder ...
Once buildtool finishes, you have compiled the data, but you have not packaged
it into a .dat or .so file. This is done by the separate pkgdata tool in bin.
Read the docs of pkgdata:
Once icutools.databuilder finishes, you have compiled the data, but you have
not packaged it into a .dat or .so file. This is done by the separate pkgdata
tool in bin. Read the docs of pkgdata:
$ LD_LIBRARY_PATH=lib ./bin/pkgdata --help
@ -264,9 +263,13 @@ def main(argv):
GLOB_DIR = args.src_dir,
PATTERN = pattern
))
# For the purposes of buildtool, force Unix-style directory separators.
# For the purposes of icutools.databuilder, force Unix-style directory separators.
return [v.replace("\\", "/")[len(args.src_dir)+1:] for v in sorted(result_paths)]
# Automatically load BUILDRULES from the src_dir
sys.path.append(args.src_dir)
import BUILDRULES
requests = BUILDRULES.generate(config, glob, common)
requests = filtration.apply_filters(requests, config)
requests = utils.flatten_requests(requests, config, common)

View file

@ -3,8 +3,8 @@
from distutils.sysconfig import parse_makefile
from buildtool import *
from buildtool.request_types import *
from icutools.databuilder import *
from icutools.databuilder.request_types import *
def generate(config, glob, common_vars):

View file

@ -34,8 +34,8 @@ CREATE_DIRS :
"$(TESTDATAOUT)\testdata.dat" :
@echo Building test data
set PYTHONPATH=$(ICUSRCDATA);%PYTHONPATH%
py -3 -B -m buildtool \
set PYTHONPATH=$(ICUP)\source\python;%PYTHONPATH%
py -3 -B -m icutools.databuilder \
--mode windows-exec \
--tool_dir "$(ICUTOOLS)" \
--tool_cfg "$(CFG)" \

View file

@ -240,7 +240,7 @@ main(int argc,
"\t (--writePoolBundle and --usePoolBundle cannot be combined)\n");
fprintf(stderr,
"\t --filterDir Input directory where filter files are available.\n"
"\t For more on filter files, see Python buildtool.\n");
"\t For more on filter files, see ICU Data Build Tool.\n");
return illegalArg ? U_ILLEGAL_ARGUMENT_ERROR : U_ZERO_ERROR;
}