summaryrefslogtreecommitdiffstats
path: root/blimp/engine/BUILD.gn
blob: bb6cddd22c1e85cff5bb9c669038f052ce324935 (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/features.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/ui.gni")
import("//tools/grit/repack.gni")
import("//tools/grit/grit_rule.gni")

repack("pak") {
  sources = [
    "$root_gen_dir/blink/public/resources/blink_image_resources_100_percent.pak",
    "$root_gen_dir/blink/public/resources/blink_resources.pak",
    "$root_gen_dir/content/app/resources/content_resources_100_percent.pak",
    "$root_gen_dir/content/app/strings/content_strings_en-US.pak",
    "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
    "$root_gen_dir/content/content_resources.pak",
    "$root_gen_dir/net/net_resources.pak",
    "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
    "$root_gen_dir/ui/resources/webui_resources.pak",
    "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
    "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
  ]

  deps = [
    "//content:resources",
    "//content/app/resources",
    "//content/app/strings",
    "//content/browser/tracing:resources",
    "//net:net_resources",
    "//third_party/WebKit/public:image_resources",
    "//third_party/WebKit/public:resources",
    "//ui/resources",
    "//ui/strings",
  ]

  if (toolkit_views) {
    deps += [ "//ui/views/resources" ]
    sources +=
        [ "$root_gen_dir/ui/views/resources/views_resources_100_percent.pak" ]
  }

  output = "$root_out_dir/blimp_engine.pak"
}

if (is_linux) {
  executable("blimp_engine_app") {
    sources = [
      "app/blimp_main.cc",
    ]

    deps = [
      ":pak",
      "//blimp/engine/app",
      "//blimp/net:blimp_net",
    ]
  }

  group("blimp_engine") {
    deps = [
      ":blimp_engine_app",
      ":pak",
      "//sandbox/linux:chrome_sandbox",
    ]

    # List dependencies as both deps and data_deps to ensure changes trigger a
    # rebuild and "gn desc ... runtime_deps" correctly prints the data_deps.
    data_deps = deps
  }

  # Builds and bundles the engine into a tarball that can be used to build a
  # Docker image.
  action("bundle_blimp_engine") {
    script = "//blimp/tools/bundle-engine.py"
    target = "//blimp/engine:blimp_engine"

    # These form the arguments to the script.
    build_dir = rebase_path(root_out_dir)
    dockerfile = rebase_path("//blimp/engine/Dockerfile")
    manifest = rebase_path("//blimp/engine/engine-manifest.txt")
    bundle = "$root_out_dir/blimp_engine_bundle.tar"

    deps = [
      target,
    ]
    inputs = [
      dockerfile,
      manifest,
    ]
    outputs = [
      bundle,
    ]
    args = [
      "--build-dir",
      build_dir,
      "--dockerfile",
      dockerfile,
      "--manifest",
      manifest,
      "--output",
      rebase_path(bundle),
    ]
  }
}