Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into fcitx
Browse files Browse the repository at this point in the history
  • Loading branch information
Fcitx Bot committed Nov 28, 2024
2 parents 2ca4b60 + 006ed69 commit 671cec2
Show file tree
Hide file tree
Showing 29 changed files with 1,072 additions and 503 deletions.
57 changes: 30 additions & 27 deletions src/build_tools/build_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,17 +671,23 @@ def build_on_mac(args: argparse.Namespace) -> None:
exec_command(configure_cmds, cwd=qt_src_dir, env=env, dryrun=args.dryrun)
exec_command(build_cmds, cwd=qt_src_dir, env=env, dryrun=args.dryrun)

if qt_src_dir == qt_dest_dir:
# No need to run 'install' command.
return
if qt_src_dir != qt_dest_dir:
if qt_dest_dir.exists():
if args.dryrun:
print(f'dryrun: delete {qt_dest_dir}')
else:
shutil.rmtree(qt_dest_dir)

if qt_dest_dir.exists():
if args.dryrun:
print(f'dryrun: delete {qt_dest_dir}')
else:
shutil.rmtree(qt_dest_dir)
exec_command(install_cmds, cwd=qt_src_dir, env=env, dryrun=args.dryrun)

exec_command(install_cmds, cwd=qt_src_dir, env=env, dryrun=args.dryrun)
# Copy include files.
for include in ['QtCore', 'QtGui', 'QtPrintSupport', 'QtWidgets']:
src = qt_src_dir.joinpath('include').joinpath(include)
dest = qt_dest_dir.joinpath('include').joinpath(include)
if args.dryrun:
print(f'dryrun: copy {src} => {dest}')
else:
shutil.copytree(src=src, dst=dest)

for tool in ['moc', 'rcc', 'uic']:
src = qt_host_dir.joinpath('libexec').joinpath(tool)
Expand Down Expand Up @@ -839,27 +845,24 @@ def build_on_windows(args: argparse.Namespace) -> None:

exec_command(build_cmds, cwd=qt_src_dir, env=env, dryrun=args.dryrun)

if qt_src_dir == qt_dest_dir:
# No need to run 'install' command.
return

if qt_dest_dir.exists():
if args.dryrun:
print(f'dryrun: shutil.rmtree({qt_dest_dir})')
else:
shutil.rmtree(qt_dest_dir)

exec_command(install_cmds, cwd=qt_src_dir, env=env, dryrun=args.dryrun)
if qt_src_dir != qt_dest_dir:
if qt_dest_dir.exists():
if args.dryrun:
print(f'dryrun: shutil.rmtree({qt_dest_dir})')
else:
shutil.rmtree(qt_dest_dir)

# When both '--debug' and '--release' are specified for Qt6, we need to run
# the command again with '--config debug' option to install debug DLLs.
if args.debug and args.release:
install_cmds += ['--config', 'debug']
exec_command(install_cmds, cwd=qt_src_dir, env=env, dryrun=args.dryrun)

for bool in ['moc.exe', 'rcc.exe', 'uic.exe']:
src = qt_host_dir.joinpath('bin').joinpath(bool)
dest = qt_dest_dir.joinpath('bin').joinpath(bool)
# When both '--debug' and '--release' are specified for Qt6, we need to run
# the command again with '--config debug' option to install debug DLLs.
if args.debug and args.release:
install_cmds += ['--config', 'debug']
exec_command(install_cmds, cwd=qt_src_dir, env=env, dryrun=args.dryrun)

for tool in ['moc.exe', 'rcc.exe', 'uic.exe']:
src = qt_host_dir.joinpath('bin').joinpath(tool)
dest = qt_dest_dir.joinpath('bin').joinpath(tool)
if args.dryrun:
print(f'dryrun: copy {src} => {dest}')
else:
Expand Down
80 changes: 76 additions & 4 deletions src/converter/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ mozc_cc_test(

mozc_cc_library(
name = "immutable_converter_interface",
srcs = ["immutable_converter_interface.cc"],
hdrs = ["immutable_converter_interface.h"],
visibility = [
"//:__subpackages__",
Expand All @@ -324,7 +323,6 @@ mozc_cc_library(
":segments",
"//request:conversion_request",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/log",
],
)

Expand Down Expand Up @@ -424,12 +422,12 @@ mozc_cc_library(
],
deps = [
":converter_interface",
":history_reconstructor",
":immutable_converter_interface",
":reverse_converter",
":segments",
"//base:japanese_util",
"//base:util",
"//base:vlog",
"//base/strings:assign",
"//composer",
"//dictionary:pos_matcher",
"//dictionary:suppression_dictionary",
Expand Down Expand Up @@ -523,6 +521,80 @@ mozc_cc_test(
],
)

mozc_cc_library(
name = "history_reconstructor",
srcs = ["history_reconstructor.cc"],
hdrs = ["history_reconstructor.h"],
deps = [
":segments",
"//base:japanese_util",
"//base:util",
"//dictionary:pos_matcher",
"//protocol:commands_cc_proto",
"//testing:friend_test",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/strings:string_view",
],
)

mozc_cc_test(
name = "history_reconstructor_test",
srcs = ["history_reconstructor_test.cc"],
deps = [
":history_reconstructor",
":segments",
"//data_manager/testing:mock_data_manager",
"//dictionary:pos_matcher",
"//prediction:dictionary_predictor",
"//prediction:predictor",
"//prediction:user_history_predictor",
"//protocol:commands_cc_proto",
"//protocol:config_cc_proto",
"//protocol:user_dictionary_storage_cc_proto",
"//testing:gunit_main",
],
)

mozc_cc_library(
name = "reverse_converter",
srcs = ["reverse_converter.cc"],
hdrs = ["reverse_converter.h"],
deps = [
":immutable_converter_interface",
":segments",
"//base:util",
"//base/strings:assign",
"//protocol:commands_cc_proto",
"//request:conversion_request",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/strings:string_view",
],
)

mozc_cc_test(
name = "reverse_converter_test",
srcs = ["reverse_converter_test.cc"],
deps = [
":immutable_converter_no_factory",
":reverse_converter",
":segments",
"//data_manager/testing:mock_data_manager",
"//engine:modules",
"//prediction:dictionary_predictor",
"//prediction:predictor",
"//prediction:user_history_predictor",
"//protocol:commands_cc_proto",
"//protocol:config_cc_proto",
"//protocol:user_dictionary_storage_cc_proto",
"//rewriter",
"//testing:gunit_main",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:string_view",
],
)

mozc_cc_library(
name = "pos_id_printer",
srcs = ["pos_id_printer.cc"],
Expand Down
Loading

0 comments on commit 671cec2

Please sign in to comment.