chromium/remoting/ios/app/resources/BUILD.gn

# Copyright 2017 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/chrome_build.gni")
import("//build/config/ios/rules.gni")
import("//remoting/build/config/remoting_build.gni")
import("//remoting/remoting_locales.gni")

group("assets") {
  public_deps = [
    ":Background",
    "//third_party/material_design_icons:ic_arrow_forward_white",
    "//third_party/material_design_icons:ic_check_box_outline_blank_white",
    "//third_party/material_design_icons:ic_check_box_white",
    "//third_party/material_design_icons:ic_chevron_left_white_36pt",
    "//third_party/material_design_icons:ic_close_white",
    "//third_party/material_design_icons:ic_desktop_windows_white",
    "//third_party/material_design_icons:ic_feedback",
    "//third_party/material_design_icons:ic_help",
    "//third_party/material_design_icons:ic_menu_white",
    "//third_party/material_design_icons:ic_radio_button_checked_white",
    "//third_party/material_design_icons:ic_radio_button_unchecked_white",
    "//third_party/material_design_icons:ic_refresh_white",
    "//third_party/material_design_icons:ic_settings_white",

    # Note: those assets seems to be unreferenced by the code, according to
    # grep. Maybe they are in downstream repository, so leaving them for now.
    "//third_party/material_design_icons:ic_desktop_windows",
    "//third_party/material_design_icons:ic_fullscreen",
    "//third_party/material_design_icons:ic_fullscreen_exit",
    "//third_party/material_design_icons:ic_mouse",
    "//third_party/material_design_icons:ic_touch_app",
  ]
}

bundle_data_xcassets("Background") {
  catalog = "Assets.xcassets"
  sources = [
    "Assets.xcassets/Background.imageset/Contents.json",
    "Assets.xcassets/Background.imageset/bkg1.jpg",
    "Assets.xcassets/Background.imageset/bkg1_2x.jpg",
  ]
}

bundle_data_xcassets("launchscreen_assets") {
  catalog = "launchscreen_images.xcassets"
  sources = [
    "launchscreen_images.xcassets/launchscreen_app_logo.imageset/Contents.json",
    "launchscreen_images.xcassets/launchscreen_app_logo.imageset/launchscreen_app_logo.png",
    "launchscreen_images.xcassets/launchscreen_app_logo.imageset/[email protected]",
    "launchscreen_images.xcassets/launchscreen_app_logo.imageset/[email protected]",
    "launchscreen_images.xcassets/launchscreen_brand_name.imageset/Contents.json",
    "launchscreen_images.xcassets/launchscreen_brand_name.imageset/launchscreen_brand_name.png",
    "launchscreen_images.xcassets/launchscreen_brand_name.imageset/[email protected]",
    "launchscreen_images.xcassets/launchscreen_brand_name.imageset/[email protected]",
  ]
}

bundle_data_xcassets("remoting_icons") {
  catalog = "ChromiumIcons.xcassets"
  sources = [
    "ChromiumIcons.xcassets/AppIcon.appiconset/Contents.json",
    "ChromiumIcons.xcassets/AppIcon.appiconset/Icon-1024.png",
    "ChromiumIcons.xcassets/AppIcon.appiconset/Icon-120.png",
    "ChromiumIcons.xcassets/AppIcon.appiconset/Icon-152.png",
    "ChromiumIcons.xcassets/AppIcon.appiconset/Icon-167.png",
    "ChromiumIcons.xcassets/AppIcon.appiconset/Icon-180.png",
    "ChromiumIcons.xcassets/AppIcon.appiconset/Icon-29.png",
    "ChromiumIcons.xcassets/AppIcon.appiconset/Icon-40.png",
    "ChromiumIcons.xcassets/AppIcon.appiconset/Icon-58.png",
    "ChromiumIcons.xcassets/AppIcon.appiconset/Icon-80.png",
    "ChromiumIcons.xcassets/AppIcon.appiconset/Icon-87.png",
  ]
}

# i18n

action("infoplist_strings") {
  _source = "InfoPlist.strings.jinja2"
  sources = [ _source ]

  script = "//remoting/tools/build/remoting_localize.py"
  args = [
           "--locale_dir",
           rebase_path(resources_locale_dir, root_build_dir),
           "--variables",
           rebase_path(branding_path, root_build_dir),
           "--template",
           rebase_path(_source, root_build_dir),
           "--locale_output",
           rebase_path(
               "$root_gen_dir/remoting/ios/app/InfoPlist_Strings/@{json_suffix}.lproj/InfoPlist.strings",
               root_build_dir),
         ] + remoting_locales_with_underscores

  outputs = []
  foreach(locale, remoting_locales_with_underscores) {
    outputs += [ "$root_gen_dir/remoting/ios/app/InfoPlist_Strings/$locale.lproj/InfoPlist.strings" ]
  }

  deps = [
    "//remoting/resources",
    "//remoting/resources:strings",
  ]
}

foreach(locale, remoting_locales_with_underscores) {
  bundle_data("locale_${locale}_bundle_data") {
    sources = [
      "$root_gen_dir/remoting/ios/app/InfoPlist_Strings/$locale.lproj/InfoPlist.strings",
      "$root_out_dir/remoting/resources/$locale.lproj/locale.pak",
    ]
    outputs = [ "{{bundle_resources_dir}}/$locale.lproj/{{source_file_part}}" ]
    public_deps = [
      ":infoplist_strings",
      "//remoting/resources:copy_locales",
    ]
  }
}