Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: tools/gn/secondary/tools/grit/grit_rule.gni

Issue 340153004: Move gn secondary_source to the build/ directory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update android webview_licenses.py as well Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/secondary/third_party/trace-viewer/BUILD.gn ('k') | tools/gn/secondary/ui/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/secondary/tools/grit/grit_rule.gni
diff --git a/tools/gn/secondary/tools/grit/grit_rule.gni b/tools/gn/secondary/tools/grit/grit_rule.gni
deleted file mode 100644
index 6dc0a4b4558d0980756d6eb25ddeb1ffa45dfa9b..0000000000000000000000000000000000000000
--- a/tools/gn/secondary/tools/grit/grit_rule.gni
+++ /dev/null
@@ -1,153 +0,0 @@
-# Copyright (c) 2013 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.
-
-# Instantiate grit. This will produce a script target to run grit, and a
-# static library that compiles the .cc files.
-#
-# Parameters
-#
-# source
-# Path to .grd file.
-#
-# grit_flags (optional)
-# List of strings containing extra command-line flags to pass to Grit.
-#
-# deps (optional)
-# visibility (optional)
-# Normal meaning.
-#
-# Example
-#
-# grit("my_resources") {
-# source = "myfile.grd" # source is required.
-# grit_flags = [ "-E", "foo=bar" ] # Optional extra flags.
-# # You can also put deps here if the grit source depends on generated
-# # files.
-# }
-import ("//build/config/features.gni")
-import ("//build/config/ui.gni")
-
-grit_defines = []
-
-if (is_chromeos) {
- grit_defines += [
- "-D", "chromeos",
- "-D", "scale_factors=2x"
- ]
-}
-
-if (is_desktop_linux) {
- grit_defines += [ "-D", "desktop_linux" ]
-}
-
-if (is_android) {
- grit_defines += [
- "-t", "android",
- "-E", "ANDROID_JAVA_TAGGED_ONLY=true",
- ]
-}
-
-if (enable_extensions) {
- grit_defines += [ "-D", "enable_extensions" ]
-}
-if (enable_plugins) {
- grit_defines += [ "-D", "enable_plugins" ]
-}
-
-# TODO(GYP) the rest of the grit_defines from the gyp build.
-
-grit_resource_id_file = "//tools/gritsettings/resource_ids"
-grit_info_script = "//tools/grit/grit_info.py"
-
-template("grit") {
- assert(defined(invoker.source),
- "\"source\" must be defined for the grit template $target_name")
- assert(!defined(invoker.sources) && !defined(invoker.outputs),
- "Neither \"sources\" nor \"outputs\" can be defined for the grit " +
- "template $target_name")
-
- # These are all passed as arguments to the script so have to be relative to
- # the build directory.
- resource_ids =
- rebase_path(grit_resource_id_file, root_build_dir)
- output_dir = rebase_path(target_gen_dir, root_build_dir)
- source_path = rebase_path(invoker.source, root_build_dir)
-
- if (defined(invoker.grit_flags)) {
- grit_flags = invoker.grit_flags
- } else {
- grit_flags = [] # These are optional so default to empty list.
- }
-
- grit_inputs_build_rel = exec_script(grit_info_script,
- [ "--inputs", source_path, "-f", resource_ids] + grit_flags, "list lines")
- # The inputs are relative to the current (build) directory, rebase to
- # the current one.
- grit_inputs = rebase_path(grit_inputs_build_rel, ".", root_build_dir) + [
- grit_resource_id_file,
- ]
-
- grit_outputs_build_rel = exec_script(grit_info_script,
- [ "--outputs", "$output_dir", source_path, "-f", resource_ids ] +
- grit_flags,
- "list lines")
-
- # The inputs are relative to the current (build) directory, rebase to
- # the current one.
- grit_outputs = rebase_path(grit_outputs_build_rel, ".", root_build_dir)
-
- # The config and the action below get this visibility son only the generated
- # source set can depend on them. The variable "target_name" will get
- # overwritten inside the innter classes so we need to compute it here.
- target_visibility = ":$target_name"
-
- # The current grit setup makes an file in $target_gen_dir/grit/foo.h that
- # the source code expects to include via "grit/foo.h". It would be nice to
- # change this to including absolute paths relative to the root gen directory
- # (like "mycomponent/foo.h"). This config sets up the include path.
- grit_config = target_name + "_grit_config"
- config(grit_config) {
- include_dirs = [ target_gen_dir ]
- visibility = target_visibility
- }
-
- grit_custom_target = target_name + "_grit"
- action(grit_custom_target) {
- script = "//tools/grit/grit.py"
- source_prereqs = grit_inputs
- outputs = grit_outputs
-
- args = [
- "-i", source_path, "build",
- "-f", resource_ids,
- "-o", output_dir,
- ] + grit_defines + grit_flags
-
- visibility = target_visibility
-
- if (defined(invoker.deps)) {
- deps = invoker.deps
- }
- }
-
- # This is the thing that people actually link with, it must be named the
- # same as the argument the template was invoked with.
- source_set(target_name) {
- # Since we generate a file, we need to be run before the targets that
- # depend on us.
- sources = grit_outputs
-
- # Deps set on the template invocation will go on the grit script running
- # target rather than this library.
- deps = [ ":$grit_custom_target" ]
- direct_dependent_configs = [ ":$grit_config" ]
-
- if (defined(invoker.visibility)) {
- visibility = invoker.visibility
- }
- if (defined(invoker.output_name)) {
- output_name = invoker.output_name
- }
- }
-}
« no previous file with comments | « tools/gn/secondary/third_party/trace-viewer/BUILD.gn ('k') | tools/gn/secondary/ui/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698