summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/ntp4/BUILD.gn
blob: a7d587771a76c5c80f06ed3c96fd6e60bbdac754 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Copyright 2018 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//chrome/common/features.gni")
import("//tools/grit/grit_rule.gni")
import("//tools/typescript/ts_library.gni")
import("//ui/webui/resources/tools/generate_grd.gni")

assert(is_fuchsia || is_linux || is_mac || is_win)

grit("apps_resources") {
  defines = chrome_grit_defines

  # These arguments are needed since the grd is generated at build time.
  enable_input_discovery_for_gn_analyze = false
  source = "$target_gen_dir/apps_resources.grd"
  deps = [ ":build_apps_grd" ]

  outputs = [
    "grit/apps_resources.h",
    "grit/apps_resources_map.cc",
    "grit/apps_resources_map.h",
    "apps_resources.pak",
  ]
  output_dir = "$root_gen_dir/chrome"
}

# Note: There are no plans to migrate this page to TypeScript, as it is a fairly
# old page with an undecided future, and would be a lot of work. Passing JS file
# through TS compiler to get some basic static checks (mostly validating syntax
# but not types).
ts_library("build_ts") {
  root_dir = "."
  out_dir = "$target_gen_dir/tsc"
  tsconfig_base = "tsconfig_base.json"
  in_files = [
    "app_info.js",
    "apps_page.js",
    "card_slider.js",
    "command.js",
    "context_menu_handler.js",
    "dot_list.js",
    "menu.js",
    "menu_button.js",
    "menu_item.js",
    "nav_dot.js",
    "new_tab.js",
    "page_list_view.js",
    "page_switcher.js",
    "position_util.js",
    "tile_page.js",
    "touch_handler.js",
    "trash.js",
    "util.js",
  ]
  definitions = [ "//tools/typescript/definitions/chrome_send.d.ts" ]
  deps = [ "//ui/webui/resources:library" ]
}

generate_grd("build_apps_grd") {
  grd_prefix = "apps"
  out_grd = "$target_gen_dir/${grd_prefix}_resources.grd"
  input_files = [
    "apps_page.css",
    "images/error_yellow900.svg",
    "images/trash.png",
    "nav_dot.css",
    "new_tab.css",
    "new_tab.html",
    "tile_page.css",
    "trash.css",
  ]
  input_files_base_dir = rebase_path(".", "//")

  deps = [ ":build_ts" ]
  manifest_files =
      filter_include(get_target_outputs(":build_ts"), [ "*.manifest" ])
}