4gn_in = open(
"BUILD.input.gn",
"rb")
10 cmd = [
"git",
"ls-files",
"--"]
12 cmd.append(
":!%s" % ex)
14 git_ls = subprocess.Popen(
16 stdout=subprocess.PIPE,
17 cwd=os.path.join(os.environ[
"FUCHSIA_DIR"],
"third_party",
"protobuf"))
18 sed1 = subprocess.Popen(
19 [
"sed",
"s/^/\"/"], stdin=git_ls.stdout, stdout=subprocess.PIPE)
20 return subprocess.check_output([
"sed",
"s/$/\",/"], stdin=sed1.stdout)
23gn_file = gn_file.replace(
24 b
"PROTOBUF_LITE_PUBLIC",
26 "src/google/protobuf/*.h",
27 exclude=[
"*/compiler/*",
"*/testing/*",
"*/util/*"]))
28gn_file = gn_file.replace(
29 b
"PROTOBUF_FULL_PUBLIC",
31 "src/google/protobuf/*.h", exclude=[
"*/compiler/*",
"*/testing/*"]))
32gn_file = gn_file.replace(
33 b
"PROTOC_LIB_SOURCES",
35 "src/google/protobuf/compiler/*.cc",
36 exclude=[
"*/main.cc",
"*test*",
"*mock*"]))
38gn_file = subprocess.check_output([
"gn",
"format",
"--stdin"], input=gn_file)
40gn_out = open(
"BUILD.gn",
"wb")
42 b
"# THIS FILE IS GENERATED FROM BUILD.input.gn BY gen.py\n# EDIT BUILD.input.gn FIRST AND THEN RUN gen.py\n#\n#\n"
def get_files(path, exclude=[])