New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 608382 link

Starred by 3 users

Issue metadata

Status: WontFix
Owner:
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS , Mac
Pri: 3
Type: Bug



Sign in to add a comment

GN: bundle_data makes it hard to work with localized data bundle

Project Member Reported by sdefresne@chromium.org, May 2 2016

Issue description

Chrome on iOS uses some libraries that ship localized data as resources bundles. For example:

Library.bundle/some.png
Library.bundle/some@2x.png
Library.bundle/some@3x.png
Library.bundle/Resources/ar.lproj/Library.strings
Library.bundle/Resources/bg.lproj/Library.strings
...


Currently, to use bundle_data, this is painful, as it needs to be done like this:

_locales = [ "ar", "bg", ... ]
foreach (locale, _locales) {
  bundle_data("bundle_data_$locale") {
    visibility = [ ":bundle_data" ]
    sources = [ "Library.bundle/Resources/$locale.lproj/Library.strings" ]
    outputs = [ "{{bundle_resources_dir}}/Library.bundle/Resources/$locale.lproj/{{source_file_part}}" ]
  }
}

bundle_data("bundle_data") {
  sources = [
    "Library.bundle/some.png",
    "Library.bundle/some@2x.png",
    "Library.bundle/some@3x.png",
  ]
  outputs = [ "{{bundle_resources_dir}}/Library.bundle/{{source_file_part}}" ]

  deps = []
  foreach (locale, _locales) {
    deps += [ ":bundle_data_$locale" ]
  }
}

This is painful, and instead I'd like to have something like this:

bundle_data("bundle_data") {
  sources = [
    "Library.bundle/some.png",
    "Library.bundle/some@2x.png",
    "Library.bundle/some@3x.png",
    "Library.bundle/Resources/ar.lproj/Library.strings",
    "Library.bundle/Resources/bg.lproj/Library.strings",
    ...
  ]
  outputs = [ "{{bundle_resources_dir}}/{{some_substitution}}/{{source_file_part}}" ]
}

Where {{some_substitution}} would expand to file directory relative to current directory instead of relative to //. Looking at "gn help source_expansion" I see no expansion that could fit here.

 
Components: Build
Status: WontFix (was: Assigned)

Sign in to add a comment