BUILD.gn 5.5 KB
Newer Older
1 2 3 4
# 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.

5 6 7 8 9 10 11 12 13
common_deps = [
  "//base",
  "//base:i18n",
  "//build/config/sanitizers:deps",
  "//dart/runtime:libdart",
  "//mojo/common",
  "//mojo/edk/system",
  "//mojo/public/cpp/application",
  "//mojo/public/interfaces/application",
14
  "//mojo/services/asset_bundle/public/interfaces",
15 16
  "//mojo/services/navigation/public/interfaces",
  "//mojo/services/network/public/interfaces",
17
  "//services/asset_bundle:lib",
18 19 20
  "//skia",
  "//sky/engine",
  "//sky/engine/tonic",
21
  "//sky/engine/wtf",
A
Adam Barth 已提交
22
  "//sky/services/engine:interfaces",
23
  "//sky/shell/dart",
24 25 26
  "//ui/gfx/geometry",
  "//ui/gl",
]
27

28 29 30 31 32 33
source_set("common") {
  sources = [
    "gpu/ganesh_context.cc",
    "gpu/ganesh_context.h",
    "gpu/ganesh_surface.cc",
    "gpu/ganesh_surface.h",
34 35
    "gpu/picture_serializer.cc",
    "gpu/picture_serializer.h",
36 37 38 39 40 41
    "gpu/rasterizer.cc",
    "gpu/rasterizer.h",
    "gpu_delegate.cc",
    "gpu_delegate.h",
    "platform_view.cc",
    "platform_view.h",
A
Adam Barth 已提交
42
    "service_provider.cc",
43 44 45 46 47
    "service_provider.h",
    "shell.cc",
    "shell.h",
    "shell_view.cc",
    "shell_view.h",
48 49
    "switches.cc",
    "switches.h",
50 51 52 53 54 55 56 57
    "ui/animator.cc",
    "ui/animator.h",
    "ui/engine.cc",
    "ui/engine.h",
    "ui/input_event_converter.cc",
    "ui/input_event_converter.h",
    "ui/internals.cc",
    "ui/internals.h",
A
Adam Barth 已提交
58 59
    "ui/platform_impl.cc",
    "ui/platform_impl.h",
60 61 62 63 64 65 66
    "ui_delegate.cc",
    "ui_delegate.h",
  ]

  deps = common_deps
}

67 68 69
if (is_android) {
  import("//build/config/android/config.gni")
  import("//build/config/android/rules.gni")
70

71 72 73 74 75 76 77 78 79
  generate_jni("jni_headers") {
    sources = [
      "android/org/domokit/sky/shell/PlatformServiceProvider.java",
      "android/org/domokit/sky/shell/PlatformViewAndroid.java",
      "android/org/domokit/sky/shell/SkyMain.java",
      "android/org/domokit/sky/shell/TracingController.java",
    ]
    jni_package = "sky/shell"
  }
80

81 82 83 84 85 86 87 88 89 90 91 92
  shared_library("sky_shell") {
    sources = [
      "android/library_loader.cc",
      "android/platform_service_provider_android.cc",
      "android/platform_service_provider_android.h",
      "android/platform_view_android.cc",
      "android/platform_view_android.h",
      "android/sky_main.cc",
      "android/sky_main.h",
      "android/tracing_controller.cc",
      "android/tracing_controller.h",
    ]
93

94 95 96
    deps = common_deps + [
             "//mojo/android:libsystem_java",
             ":jni_headers",
97
             ":common",
98 99
           ]
  }
100

101 102 103 104 105
  android_library("java") {
    java_files = [
      "android/org/domokit/sky/shell/GestureProvider.java",
      "android/org/domokit/sky/shell/PlatformServiceProvider.java",
      "android/org/domokit/sky/shell/PlatformViewAndroid.java",
106
      "android/org/domokit/sky/shell/ResourceCleaner.java",
107
      "android/org/domokit/sky/shell/ResourceExtractor.java",
108 109 110 111 112 113 114
      "android/org/domokit/sky/shell/ServiceFactory.java",
      "android/org/domokit/sky/shell/ServiceRegistry.java",
      "android/org/domokit/sky/shell/SkyActivity.java",
      "android/org/domokit/sky/shell/SkyApplication.java",
      "android/org/domokit/sky/shell/SkyMain.java",
      "android/org/domokit/sky/shell/TracingController.java",
    ]
115

116 117 118 119 120 121
    deps = [
      "//base:base_java",
      "//mojo/android:system_java",
      "//mojo/public/interfaces/application:application_java",
      "//mojo/public/java:bindings",
      "//mojo/public/java:system",
122
      "//mojo/services/keyboard/public/interfaces:interfaces_java",
123 124
      "//mojo/services/network/public/interfaces:interfaces_java",
      "//services/keyboard",
125 126
      "//sky/services/activity:activity_lib",
      "//sky/services/activity:interfaces_java",
A
Adam Barth 已提交
127
      "//sky/services/engine:interfaces_java",
128 129 130 131 132 133 134 135 136 137 138
      "//sky/services/oknet",
    ]
  }

  copy_ex("assets") {
    clear_dir = true
    dest = "$root_build_dir/sky_shell/assets"
    sources = [
      "$root_build_dir/icudtl.dat",
    ]
    deps = [
139
      "//third_party/icu:icudata",
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
    ]
  }
} else if (is_ios) {
  import("//build/config/ios/rules.gni")
  import("//build/config/ios/ios_sdk.gni")

  ios_app("shell") {
    app_name = "Sky"
    info_plist = "ios/Info.plist"
    scaffolding_target = "ios_scaffolding"
    entitlements_path = "ios/Entitlements.xcent"
    code_signing_identity = ios_code_signing_identity

    resource_copy_ios("sky_resources") {
      resources = [ "//third_party/icu/android/icudtl.dat" ]
      bundle_directory = "."
    }

    source_set(scaffolding_target) {
      sources = [
        "ios/main_ios.mm",
        "ios/platform_service_provider_ios.cc",
        "ios/platform_view_ios.h",
        "ios/platform_view_ios.mm",
        "ios/sky_app_delegate.h",
        "ios/sky_app_delegate.mm",
        "ios/sky_surface.h",
        "ios/sky_surface.mm",
        "ios/sky_view_controller.h",
        "ios/sky_view_controller.mm",
      ]

172 173 174 175
      deps = common_deps + [
               ":common",
               "//sky/services/ns_net",
             ]
176
    }
177

178 179 180 181 182
    deps = [
      ":$scaffolding_target",
      ":sky_resources",
    ]
  }
A
Adam Barth 已提交
183 184 185 186 187 188 189 190
} else if (is_linux) {
  executable("shell") {
    output_name = "sky_shell"

    sources = [
      "linux/main.cc",
      "linux/platform_service_provider_linux.cc",
      "linux/platform_view_linux.cc",
191 192
      "testing/test_runner.cc",
      "testing/test_runner.h",
A
Adam Barth 已提交
193 194
    ]

195 196
    deps = common_deps + [
             ":common",
A
Adam Barth 已提交
197
             "//sky/services/testing:interfaces",
198
           ]
A
Adam Barth 已提交
199
  }
200 201
} else {
  assert(false, "Unsupported platform")
A
Adam Barth 已提交
202
}