BUILD.gn 7.6 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",
A
Adam Barth 已提交
15
  "//mojo/services/keyboard/public/interfaces",
16 17
  "//mojo/services/navigation/public/interfaces",
  "//mojo/services/network/public/interfaces",
18
  "//services/asset_bundle:lib",
19 20 21
  "//skia",
  "//sky/engine",
  "//sky/engine/tonic",
22
  "//sky/engine/wtf",
A
Adam Barth 已提交
23
  "//sky/services/engine:interfaces",
24
  "//sky/services/vsync:interfaces",
25
  "//sky/shell/dart",
26 27 28
  "//ui/gfx/geometry",
  "//ui/gl",
]
29

30 31 32 33 34 35
source_set("common") {
  sources = [
    "gpu/ganesh_context.cc",
    "gpu/ganesh_context.h",
    "gpu/ganesh_surface.cc",
    "gpu/ganesh_surface.h",
36 37
    "gpu/picture_serializer.cc",
    "gpu/picture_serializer.h",
38 39 40 41 42 43
    "gpu/rasterizer.cc",
    "gpu/rasterizer.h",
    "gpu_delegate.cc",
    "gpu_delegate.h",
    "platform_view.cc",
    "platform_view.h",
A
Adam Barth 已提交
44
    "service_provider.cc",
45 46 47 48 49
    "service_provider.h",
    "shell.cc",
    "shell.h",
    "shell_view.cc",
    "shell_view.h",
50 51
    "switches.cc",
    "switches.h",
52 53
    "tracing_controller.cc",
    "tracing_controller.h",
54 55 56 57 58 59 60 61
    "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 已提交
62 63
    "ui/platform_impl.cc",
    "ui/platform_impl.h",
64 65 66 67 68 69 70
    "ui_delegate.cc",
    "ui_delegate.h",
  ]

  deps = common_deps
}

71 72 73
if (is_android) {
  import("//build/config/android/config.gni")
  import("//build/config/android/rules.gni")
74

75 76 77 78 79 80 81 82 83
  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"
  }
84

85 86 87 88 89 90 91 92 93 94 95 96
  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",
    ]
97

98 99 100
    deps = common_deps + [
             "//mojo/android:libsystem_java",
             ":jni_headers",
101
             ":common",
102
           ]
103 104 105 106
    ldflags = [
      "-lGLESv2",
      "-lEGL",
    ]
107
  }
108

109 110 111 112 113
  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",
114
      "android/org/domokit/sky/shell/ResourceCleaner.java",
115
      "android/org/domokit/sky/shell/ResourceExtractor.java",
116 117 118 119 120 121 122
      "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",
    ]
123

124 125 126 127 128 129
    deps = [
      "//base:base_java",
      "//mojo/android:system_java",
      "//mojo/public/interfaces/application:application_java",
      "//mojo/public/java:bindings",
      "//mojo/public/java:system",
130
      "//mojo/services/keyboard/public/interfaces:interfaces_java",
131
      "//mojo/services/network/public/interfaces:interfaces_java",
A
Adam Barth 已提交
132
      "//mojo/services/sensors/public/interfaces:interfaces_java",
133
      "//services/keyboard",
A
Adam Barth 已提交
134
      "//services/sensors:sensors_lib",
135 136
      "//sky/services/activity:activity_lib",
      "//sky/services/activity:interfaces_java",
A
Adam Barth 已提交
137
      "//sky/services/engine:interfaces_java",
A
Adam Barth 已提交
138 139
      "//sky/services/media:interfaces_java",
      "//sky/services/media:media_lib",
140
      "//sky/services/oknet",
141 142
      "//sky/services/vsync:interfaces_java",
      "//sky/services/vsync:vsync_lib",
143 144 145 146 147 148 149 150 151 152
    ]
  }

  copy_ex("assets") {
    clear_dir = true
    dest = "$root_build_dir/sky_shell/assets"
    sources = [
      "$root_build_dir/icudtl.dat",
    ]
    deps = [
153
      "//third_party/icu:icudata",
154 155
    ]
  }
A
Adam Barth 已提交
156 157 158 159 160 161 162 163

  android_apk("shell") {
    apk_name = "SkyShell"
    android_manifest = "android/AndroidManifest.xml"

    native_libs = [ "libsky_shell.so" ]
    asset_location = "$root_build_dir/sky_shell/assets"

A
Adam Barth 已提交
164 165
    extensions_to_not_compress = ".skyx"

A
Adam Barth 已提交
166 167 168 169 170 171 172 173
    deps = [
      ":assets",
      ":assets",
      ":java",
      ":sky_shell",
      "//base:base_java",
    ]
  }
174 175 176 177
} else if (is_ios) {
  import("//build/config/ios/rules.gni")
  import("//build/config/ios/ios_sdk.gni")

178 179
  source_set("ios_scaffolding") {
    sources = [
180
      "ios/document_watcher.m",
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
      "ios/main_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",
    ]

    set_sources_assignment_filter([])
    sources += [
      "mac/platform_mac.h",
      "mac/platform_mac.mm",
      "mac/platform_service_provider_mac.cc",
      "mac/platform_view_mac.h",
      "mac/platform_view_mac.mm",
    ]
    set_sources_assignment_filter(sources_assignment_filter)

    deps = common_deps + [
             ":common",
             "//sky/services/ns_net",
203
             "//sky/services/keyboard",
204 205 206
           ]
  }

207
  ios_app("shell") {
E
Eric Seidel 已提交
208
    app_name = "SkyShell"
209 210 211 212 213 214 215 216 217 218
    info_plist = "ios/Info.plist"
    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 = "."
    }

    deps = [
219
      ":ios_scaffolding",
220 221 222
      ":sky_resources",
    ]
  }
A
Adam Barth 已提交
223 224 225 226 227 228 229 230
} 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",
231 232
      "testing/test_runner.cc",
      "testing/test_runner.h",
A
Adam Barth 已提交
233 234
    ]

235
    deps = common_deps + [
236 237 238
             ":common",
             "//sky/services/testing:interfaces",
           ]
239 240 241 242
  }
} else if (is_mac) {
  import("//build/config/mac/rules.gni")

243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267
  source_set("mac_scaffolding") {
    sources = [
      "mac/main_mac.mm",
      "mac/platform_mac.h",
      "mac/platform_mac.mm",
      "mac/platform_service_provider_mac.cc",
      "mac/platform_view_mac.h",
      "mac/platform_view_mac.mm",
      "mac/sky_app_delegate.h",
      "mac/sky_app_delegate.m",
      "mac/sky_application.h",
      "mac/sky_application.mm",
      "mac/sky_window.h",
      "mac/sky_window.mm",
      "testing/test_runner.cc",
      "testing/test_runner.h",
    ]

    deps = common_deps + [
             ":common",
             "//sky/services/ns_net",
             "//sky/services/testing:interfaces",
           ]
  }

268
  mac_app("shell") {
E
Eric Seidel 已提交
269
    app_name = "SkyShell"
270 271 272 273 274
    info_plist = "mac/Info.plist"

    # entitlements_path = ""
    # code_signing_identity = ""

275
    xibs = [ "mac/sky_mac.xib" ]
276 277

    resource_copy_mac("sky_resources") {
278 279 280 281
      resources = [
        "//third_party/icu/android/icudtl.dat",
        "ios/LaunchScreen.storyboardc"
      ]
282 283 284 285
      bundle_directory = "."
    }

    deps = [
286
      ":mac_scaffolding",
287 288
      ":sky_resources",
    ]
A
Adam Barth 已提交
289
  }
290 291
} else {
  assert(false, "Unsupported platform")
A
Adam Barth 已提交
292
}