Avi Drissman | 3e1a26c | 2022-09-15 20:26:03 | [diff] [blame] | 1 | # Copyright 2020 The Chromium Authors |
Luciano Pacheco | d4a89607 | 2020-01-14 11:07:50 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
Luciano Pacheco | 23364a2 | 2023-10-17 01:24:34 | [diff] [blame] | 5 | import("//tools/typescript/ts_library.gni") |
Luciano Pacheco | d4a89607 | 2020-01-14 11:07:50 | [diff] [blame] | 6 | |
Luciano Pacheco | a2319c0 | 2023-10-17 00:59:52 | [diff] [blame] | 7 | preprocess_folder = "$target_gen_dir/preprocessed" |
Luciano Pacheco | 23364a2 | 2023-10-17 01:24:34 | [diff] [blame] | 8 | tsc_folder = "$target_gen_dir/tsc" |
Luciano Pacheco | a2319c0 | 2023-10-17 00:59:52 | [diff] [blame] | 9 | |
Luciano Pacheco | a2319c0 | 2023-10-17 00:59:52 | [diff] [blame] | 10 | js_files = [ |
Luciano Pacheco | 41a4947 | 2024-02-14 22:41:33 | [diff] [blame] | 11 | "test_util.ts", |
Luciano Pacheco | a2319c0 | 2023-10-17 00:59:52 | [diff] [blame] | 12 | |
| 13 | # File Manager. |
Luciano Pacheco | a2319c0 | 2023-10-17 00:59:52 | [diff] [blame] | 14 | "file_manager/transfer.js", |
Luciano Pacheco | a2319c0 | 2023-10-17 00:59:52 | [diff] [blame] | 15 | ] |
| 16 | |
Luciano Pacheco | 23364a2 | 2023-10-17 01:24:34 | [diff] [blame] | 17 | ts_files = [ |
Luciano Pacheco | 2aa6687 | 2024-02-14 00:00:35 | [diff] [blame] | 18 | "remote_call.ts", |
Luciano Pacheco | b1272ad | 2024-01-22 02:22:14 | [diff] [blame] | 19 | "testcase.ts", |
| 20 | |
Luciano Pacheco | 3c2de2ff | 2024-02-05 09:26:25 | [diff] [blame] | 21 | # "test_util.ts", |
| 22 | |
| 23 | # File Manager. |
| 24 | "file_manager/android_photos.ts", |
| 25 | |
Luciano Pacheco | a56523a | 2024-02-14 23:05:44 | [diff] [blame] | 26 | "file_manager/background.ts", |
Luciano Pacheco | 3c2de2ff | 2024-02-05 09:26:25 | [diff] [blame] | 27 | |
Ben Reich | 3be51caa | 2024-02-13 00:59:39 | [diff] [blame] | 28 | "file_manager/breadcrumbs.ts", |
Luciano Pacheco | 23364a2 | 2023-10-17 01:24:34 | [diff] [blame] | 29 | "file_manager/choose_entry.ts", |
| 30 | "file_manager/choose_entry_const.ts", |
Luciano Pacheco | 3c2de2ff | 2024-02-05 09:26:25 | [diff] [blame] | 31 | |
Ben Reich | 282c52e | 2024-02-14 05:14:21 | [diff] [blame] | 32 | "file_manager/context_menu.ts", |
Luciano Pacheco | 3c2de2ff | 2024-02-05 09:26:25 | [diff] [blame] | 33 | |
Ben Reich | 02c27f63 | 2024-02-13 06:56:39 | [diff] [blame] | 34 | "file_manager/copy_between_windows.ts", |
Ben Reich | bea72ee | 2024-02-14 01:26:42 | [diff] [blame] | 35 | "file_manager/create_new_folder.ts", |
François Degros | ce09bdf | 2024-02-14 02:35:16 | [diff] [blame] | 36 | "file_manager/crostini.ts", |
Wenbo Jie | 462ac7f | 2024-02-07 03:12:55 | [diff] [blame] | 37 | "file_manager/directory_tree.ts", |
Luciano Pacheco | 3c2de2ff | 2024-02-05 09:26:25 | [diff] [blame] | 38 | |
Luciano Pacheco | 16d23d6 | 2024-02-15 02:53:05 | [diff] [blame] | 39 | "file_manager/directory_tree_context_menu.ts", |
Luciano Pacheco | 3c2de2ff | 2024-02-05 09:26:25 | [diff] [blame] | 40 | |
Luciano Pacheco | a65c279 | 2024-02-15 04:09:20 | [diff] [blame] | 41 | "file_manager/dlp.ts", |
Luciano Pacheco | 3c2de2ff | 2024-02-05 09:26:25 | [diff] [blame] | 42 | |
Luciano Pacheco | cf67cc027 | 2024-02-15 11:23:27 | [diff] [blame] | 43 | "file_manager/dlp_enterprise_connectors.ts", |
Luciano Pacheco | 3c2de2ff | 2024-02-05 09:26:25 | [diff] [blame] | 44 | |
Luciano Pacheco | 432700e | 2024-02-15 01:23:09 | [diff] [blame] | 45 | "file_manager/drive_specific.ts", |
François Degros | 39c1f29 | 2024-02-15 05:18:33 | [diff] [blame] | 46 | "file_manager/file_dialog.ts", |
François Degros | f7ea6bb | 2024-02-13 05:48:30 | [diff] [blame] | 47 | "file_manager/file_display.ts", |
Ben Reich | 5dd1070 | 2024-02-13 04:53:59 | [diff] [blame] | 48 | "file_manager/file_list.ts", |
Luciano Pacheco | 8f01a35 | 2024-02-15 03:33:13 | [diff] [blame] | 49 | "file_manager/file_transfer_connector.ts", |
Luciano Pacheco | 3c2de2ff | 2024-02-05 09:26:25 | [diff] [blame] | 50 | "file_manager/files_tooltip.ts", |
François Degros | 29c4db2d | 2024-02-14 03:47:15 | [diff] [blame] | 51 | "file_manager/folder_shortcuts.ts", |
Ben Reich | 00a488b | 2024-02-13 01:00:57 | [diff] [blame] | 52 | "file_manager/format_dialog.ts", |
François Degros | c609006 | 2024-02-15 02:54:49 | [diff] [blame] | 53 | "file_manager/gear_menu.ts", |
Ben Reich | eb1b49d | 2024-02-13 07:26:20 | [diff] [blame] | 54 | "file_manager/grid_view.ts", |
Ben Reich | b6f29e3 | 2024-02-13 06:46:44 | [diff] [blame] | 55 | "file_manager/guest_os.ts", |
François Degros | 1fdd44c525 | 2024-02-15 05:36:03 | [diff] [blame] | 56 | "file_manager/holding_space.ts", |
François Degros | 7f74c2c | 2024-02-14 01:29:36 | [diff] [blame] | 57 | "file_manager/install_linux_package_dialog.ts", |
Ben Reich | a2e1531 | 2024-02-13 04:06:09 | [diff] [blame] | 58 | "file_manager/keyboard_operations.ts", |
Ben Reich | fde92789 | 2024-02-12 03:18:27 | [diff] [blame] | 59 | "file_manager/manage_dialog.ts", |
Ben Reich | d6282c88 | 2024-02-13 06:33:49 | [diff] [blame] | 60 | "file_manager/metadata.ts", |
Ben Reich | 71eeaa2 | 2024-02-14 00:35:31 | [diff] [blame] | 61 | "file_manager/metrics.ts", |
Ben Reich | 77b351b | 2024-02-13 00:58:43 | [diff] [blame] | 62 | "file_manager/my_files.ts", |
François Degros | 319b9c5 | 2024-02-09 05:23:48 | [diff] [blame] | 63 | "file_manager/navigation.ts", |
Ben Reich | 00d3401 | 2024-02-13 04:54:53 | [diff] [blame] | 64 | "file_manager/office.ts", |
Austin Tankiang | fdbe7218 | 2024-02-07 03:01:40 | [diff] [blame] | 65 | "file_manager/open_audio_media_app.ts", |
Austin Tankiang | 4a39f671 | 2024-02-07 07:39:24 | [diff] [blame] | 66 | "file_manager/open_files_in_web_drive.ts", |
Austin Tankiang | fdbe7218 | 2024-02-07 03:01:40 | [diff] [blame] | 67 | "file_manager/open_image_media_app.ts", |
| 68 | "file_manager/open_media_app.ts", |
Austin Tankiang | ed3497ed | 2024-02-07 03:34:36 | [diff] [blame] | 69 | "file_manager/open_sniffed_files.ts", |
Austin Tankiang | fdbe7218 | 2024-02-07 03:01:40 | [diff] [blame] | 70 | "file_manager/open_video_media_app.ts", |
Ben Reich | a47f3e9 | 2024-02-13 05:41:29 | [diff] [blame] | 71 | "file_manager/providers.ts", |
François Degros | 441cb81 | 2024-02-13 00:42:17 | [diff] [blame] | 72 | "file_manager/quick_view.ts", |
Luciano Pacheco | 3c2de2ff | 2024-02-05 09:26:25 | [diff] [blame] | 73 | |
Luciano Pacheco | 9112711 | 2024-02-15 04:47:02 | [diff] [blame] | 74 | "file_manager/recents.ts", |
Luciano Pacheco | 3c2de2ff | 2024-02-05 09:26:25 | [diff] [blame] | 75 | |
François Degros | 29b9252 | 2024-02-14 01:11:11 | [diff] [blame] | 76 | "file_manager/restore_prefs.ts", |
Luciano Pacheco | 3c2de2ff | 2024-02-05 09:26:25 | [diff] [blame] | 77 | |
Bo Majewski | 8f76eab | 2024-02-15 23:10:13 | [diff] [blame^] | 78 | "file_manager/search.ts", |
Luciano Pacheco | 3c2de2ff | 2024-02-05 09:26:25 | [diff] [blame] | 79 | |
François Degros | 9f40f47 | 2024-02-11 23:49:45 | [diff] [blame] | 80 | "file_manager/share.ts", |
Ben Reich | 646c875 | 2024-02-13 05:30:33 | [diff] [blame] | 81 | "file_manager/sort_columns.ts", |
François Degros | 61a5cc85 | 2024-02-14 03:59:48 | [diff] [blame] | 82 | "file_manager/tab_index.ts", |
Ben Reich | c19b6bd | 2024-02-13 07:27:59 | [diff] [blame] | 83 | "file_manager/tasks.ts", |
François Degros | c7e8fa67 | 2024-02-14 04:36:39 | [diff] [blame] | 84 | "file_manager/test_data.ts", |
Ben Reich | 994c80b | 2024-02-13 04:44:58 | [diff] [blame] | 85 | "file_manager/toolbar.ts", |
Luciano Pacheco | 3c2de2ff | 2024-02-05 09:26:25 | [diff] [blame] | 86 | |
| 87 | # "file_manager/transfer.ts", |
| 88 | |
Wenbo Jie | daf2674 | 2024-02-07 05:01:10 | [diff] [blame] | 89 | "file_manager/trash.ts", |
François Degros | cad34e2 | 2024-02-12 00:37:41 | [diff] [blame] | 90 | "file_manager/traverse.ts", |
Luciano Pacheco | 3c2de2ff | 2024-02-05 09:26:25 | [diff] [blame] | 91 | |
François Degros | 8858797 | 2024-02-13 04:07:32 | [diff] [blame] | 92 | "file_manager/zip_files.ts", |
Luciano Pacheco | 3c2de2ff | 2024-02-05 09:26:25 | [diff] [blame] | 93 | |
| 94 | # Page Objects. |
François Degros | d264276 | 2024-02-15 01:35:29 | [diff] [blame] | 95 | "file_manager/page_objects/directory_tree.ts", |
Luciano Pacheco | 23364a2 | 2023-10-17 01:24:34 | [diff] [blame] | 96 | ] |
| 97 | |
Luciano Pacheco | a2319c0 | 2023-10-17 00:59:52 | [diff] [blame] | 98 | # TS/JS files. |
| 99 | copy("copy_src") { |
Luciano Pacheco | 23364a2 | 2023-10-17 01:24:34 | [diff] [blame] | 100 | sources = js_files + ts_files |
Luciano Pacheco | a2319c0 | 2023-10-17 00:59:52 | [diff] [blame] | 101 | outputs = [ "$preprocess_folder/{{source_target_relative}}" ] |
| 102 | } |
| 103 | |
Luciano Pacheco | 63be2c4 | 2024-02-01 06:50:30 | [diff] [blame] | 104 | copy("from_files_app") { |
| 105 | sources = [ "../file_manager/common/js/shared_types.ts" ] |
| 106 | outputs = [ "$preprocess_folder/prod/file_manager/{{source_file_part}}" ] |
| 107 | deps = [ "//ui/file_manager:generate_definitions" ] |
| 108 | } |
| 109 | |
Luciano Pacheco | a2319c0 | 2023-10-17 00:59:52 | [diff] [blame] | 110 | # All non JS/TS files. |
| 111 | copy("copy_app") { |
| 112 | sources = [ |
| 113 | "file_manager/background.html", |
| 114 | "file_manager/choose_entry.html", |
| 115 | "file_manager_test_manifest.json", |
| 116 | ] |
Luciano Pacheco | 23364a2 | 2023-10-17 01:24:34 | [diff] [blame] | 117 | outputs = [ "$tsc_folder/{{source_target_relative}}" ] |
| 118 | } |
| 119 | |
| 120 | ts_library("build_ts") { |
| 121 | root_dir = preprocess_folder |
| 122 | out_dir = tsc_folder |
| 123 | tsconfig_base = "tsconfig_base.json" |
| 124 | composite = true |
| 125 | |
| 126 | definitions = [ |
Luciano Pacheco | b1272ad | 2024-01-22 02:22:14 | [diff] [blame] | 127 | "//tools/typescript/definitions/chrome_test.d.ts", |
Luciano Pacheco | 23364a2 | 2023-10-17 01:24:34 | [diff] [blame] | 128 | "//tools/typescript/definitions/runtime.d.ts", |
| 129 | "//tools/typescript/definitions/file_system.d.ts", |
Luciano Pacheco | b1272ad | 2024-01-22 02:22:14 | [diff] [blame] | 130 | "//tools/typescript/definitions/windows.d.ts", |
Luciano Pacheco | 432700e | 2024-02-15 01:23:09 | [diff] [blame] | 131 | "//ui/file_manager/file_manager/definitions/file_manager_private.d.ts", |
| 132 | "//ui/file_manager/file_manager/definitions/navigator_connection.d.ts", |
Luciano Pacheco | 23364a2 | 2023-10-17 01:24:34 | [diff] [blame] | 133 | "definitions.d.ts", |
Luciano Pacheco | 23364a2 | 2023-10-17 01:24:34 | [diff] [blame] | 134 | ] |
| 135 | |
Luciano Pacheco | 63be2c4 | 2024-02-01 06:50:30 | [diff] [blame] | 136 | extra_deps = [ |
| 137 | ":copy_src", |
| 138 | ":from_files_app", |
| 139 | ] |
Luciano Pacheco | 23364a2 | 2023-10-17 01:24:34 | [diff] [blame] | 140 | |
Luciano Pacheco | 63be2c4 | 2024-02-01 06:50:30 | [diff] [blame] | 141 | in_files = js_files + ts_files + [ |
| 142 | # Copied from the Files app production to avoid duplication. |
| 143 | "prod/file_manager/shared_types.ts", |
| 144 | ] |
Luciano Pacheco | a2319c0 | 2023-10-17 00:59:52 | [diff] [blame] | 145 | } |
| 146 | |
| 147 | group("build") { |
| 148 | deps = [ |
Luciano Pacheco | 23364a2 | 2023-10-17 01:24:34 | [diff] [blame] | 149 | ":build_ts", |
Luciano Pacheco | a2319c0 | 2023-10-17 00:59:52 | [diff] [blame] | 150 | ":copy_app", |
Luciano Pacheco | a2319c0 | 2023-10-17 00:59:52 | [diff] [blame] | 151 | ] |
| 152 | |
| 153 | # Also as data_deps to make the files available at runtime to the |
| 154 | # browser_tests binary, see `gn help runtime_deps` for more info. |
| 155 | data_deps = [ |
Luciano Pacheco | 23364a2 | 2023-10-17 01:24:34 | [diff] [blame] | 156 | ":build_ts", |
Luciano Pacheco | a2319c0 | 2023-10-17 00:59:52 | [diff] [blame] | 157 | ":copy_app", |
Luciano Pacheco | a2319c0 | 2023-10-17 00:59:52 | [diff] [blame] | 158 | ] |
| 159 | } |