Index: build/json_features.gypi |
diff --git a/build/json_features.gypi b/build/json_features.gypi |
new file mode 100644 |
index 0000000000000000000000000000000000000000..23e79005d812d7b20ae9e22b850fd8cb245061ba |
--- /dev/null |
+++ b/build/json_features.gypi |
@@ -0,0 +1,63 @@ |
+# Copyright 2016 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. |
+ |
+{ |
+ 'variables': { |
+ # When including this gypi, the following variables must be set: |
+ # in_files: |
+ # An array of json files from which to generate the feature provider. |
+ # out_dir: |
+ # The directory to put the generated code in under gen/. |
+ # out_base_filename: |
+ # The base filename to use for the generated feature provider; .h and |
+ # .cc will be appended. |
+ # feature_class: |
+ # The name of the class to use for features, e.g. APIFeature. |
+ # provider_class: |
+ # The name of the class to use for the feature provider, e.g. |
+ # APIFeatureProvider |
+ 'compiler_dir': '<(DEPTH)/tools/json_schema_compiler', |
+ 'compiler_script': '<(compiler_dir)/feature_compiler.py', |
+ }, |
+ 'actions': [ |
+ { |
+ # GN version: json_features.gni |
+ 'action_name': 'genfeatures', |
+ 'msvs_external_rule': 1, |
+ 'extension': 'json', |
+ 'inputs': [ |
+ '<(compiler_dir)/code.py', |
+ '<(compiler_dir)/feature_compiler.py', |
Dirk Pranke
2016/07/14 23:16:36
'<(compiler_script)' ?
Devlin
2016/07/15 16:19:07
Done.
|
+ ], |
+ 'outputs': [ |
+ '<(SHARED_INTERMEDIATE_DIR)/<(out_dir)/<(out_base_filename).cc', |
+ '<(SHARED_INTERMEDIATE_DIR)/<(out_dir)/<(out_base_filename).h', |
+ ], |
+ 'action': [ |
+ 'python', |
+ '<(compiler_script)', |
+ '<(DEPTH)', |
+ '<(feature_class)', |
+ '<(provider_class)', |
+ '<(SHARED_INTERMEDIATE_DIR)/<(out_dir)', |
+ '<(out_base_filename)', |
+ '<@(in_files)', |
+ ], |
+ 'message': 'Generating C++ code for json feature files', |
+ 'process_outputs_as_sources': 1, |
+ }, |
+ ], |
+ 'include_dirs': [ |
+ '<(SHARED_INTERMEDIATE_DIR)', |
+ '<(DEPTH)', |
+ ], |
+ 'direct_dependent_settings': { |
+ 'include_dirs': [ |
+ '<(SHARED_INTERMEDIATE_DIR)', |
+ ] |
+ }, |
+ # This target exports a hard dependency because it generates header |
+ # files. |
+ 'hard_dependency': 1, |
+} |