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" \
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" \
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" \
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" \
# 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
$(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.
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
<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" />
<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">
$(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)" \
--- /dev/null
+# 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.
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
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
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)
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):
"$(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)" \
"\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;
}