Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
287a095c
Commit
287a095c
authored
Feb 02, 2016
by
Jisi Liu
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1165 from damienmg/master
Make protobuf Skylark extension appends the workspace root
parents
7727e260
76547e51
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
protobuf.bzl
protobuf.bzl
+10
-6
No files found.
protobuf.bzl
View file @
287a095c
# -*- mode: python; -*- PYTHON-PREPROCESSING-REQUIRED
def
_GetPath
(
ctx
,
path
):
if
ctx
.
label
.
workspace_root
:
return
ctx
.
label
.
workspace_root
+
'/'
+
path
else
:
return
path
def
_GenDir
(
ctx
):
if
not
ctx
.
attr
.
includes
:
return
""
return
ctx
.
label
.
workspace_root
if
not
ctx
.
attr
.
includes
[
0
]:
return
ctx
.
label
.
package
return
_GetPath
(
ctx
,
ctx
.
label
.
package
)
if
not
ctx
.
label
.
package
:
return
ctx
.
attr
.
includes
[
0
]
return
ctx
.
label
.
package
+
'/'
+
ctx
.
attr
.
includes
[
0
]
return
_GetPath
(
ctx
,
ctx
.
attr
.
includes
[
0
])
return
_GetPath
(
ctx
,
ctx
.
label
.
package
+
'/'
+
ctx
.
attr
.
includes
[
0
])
def
_CcOuts
(
srcs
):
return
[
s
[:
-
len
(
".proto"
)]
+
".pb.h"
for
s
in
srcs
]
+
\
...
...
@@ -36,8 +42,6 @@ def _RelativeOutputPath(path, include):
return
path
[
len
(
PACKAGE_NAME
)
+
1
:]
def
_proto_gen_impl
(
ctx
):
"""General implementation for generating protos"""
srcs
=
ctx
.
files
.
srcs
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment