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

Side by Side Diff: build/protoc_java.gypi

Issue 11146005: Add support for generating jars from protos and add cacheinvalidation_java. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated docs Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | third_party/cacheinvalidation/cacheinvalidation.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 # This file is meant to be included into a target to provide a rule
6 # to invoke protoc in a consistent manner.
7 #
8 # To use this, create a gyp target with the following form:
9 # {
10 # 'target_name': 'my_proto_lib',
11 # 'type': 'static_library',
12 # 'sources': [
13 # 'foo.proto',
14 # 'bar.proto',
15 # ],
16 # 'variables': {
17 # 'proto_in_dir': '.'
18 # 'output_java_files': [
19 # '>(java_out_dir)/org/chromium/package/Foo.java',
20 # '>(java_out_dir)/org/chromium/package/Bar.java'
21 # ],
22 # },
23 # 'includes': ['path/to/this/gypi/file'],
24 # }
25 #
26 # The 'proto_in_dir' variable must be the relative path to the
27 # directory containing the .proto files. If left out, it defaults to '.'.
28 #
29 # The 'proto_out_dir' variable specifies the path suffix that output
cjhopman 2012/10/23 15:48:25 This was changed to just use _target_name. Also at
30 # files are generated under.
31 #
32 # The 'output_java_files' variable specifies a list of output files that will
33 # be generated. It is based on the package and java_outer_classname fields in
34 # the proto. All the values must be prefixed with >(java_out_dir), since that
35 # is the root directory of all the output.
36 #
37 # Implementation notes:
38 # A 'proto_out_dir' of foo/bar and proto-specified 'package' java.package.path
39 # produces:
40 # <(PRODUCT_DIR)/javaproto/foo/bar/{java/package/path/}{Foo,Bar}.java
41 # where Foo and Bar are taken from 'java_outer_classname' of the protos.
42
43 {
44 'variables': {
45 'protoc': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)',
46 'java_out_dir': '<(PRODUCT_DIR)/javaproto/<(_target_name)/src',
47 'proto_in_dir%': '.',
48 },
49 'actions': [
50 {
51 'action_name': 'genproto_java_output_dirs',
52 'inputs' : [],
53 'outputs': [
54 '<(java_out_dir)'
55 ],
56 'action': [ 'mkdir', '-p', '<(java_out_dir)' ],
57 },
58 {
59 'action_name': 'genproto_java',
60 'inputs': [
61 '<(protoc)',
62 '<@(_sources)',
63 ],
64 'outputs': [
65 '<@(output_java_files)',
66 ],
67 'action': [
68 '<(protoc)',
69 '--proto_path','<(proto_in_dir)',
70 '<@(_sources)',
71 '--java_out', '<(java_out_dir)',
72 ],
73 'message': 'Generating Java code from <(proto_in_dir)',
74 },
75 ],
76 'dependencies': [
77 '<(DEPTH)/third_party/protobuf/protobuf.gyp:protoc#host',
78 '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite',
79 ],
80 'include_dirs': [
81 '<(SHARED_INTERMEDIATE_DIR)/protoc_out',
82 '<(DEPTH)',
83 ],
84 'direct_dependent_settings': {
85 'variables': {
86 'generated_src_dirs': ['<(java_out_dir)'],
87 'additional_input_paths': ['<@(_sources)'],
88 },
89 },
90 }
OLDNEW
« no previous file with comments | « no previous file | third_party/cacheinvalidation/cacheinvalidation.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698