Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 17 additions & 5 deletions build_proto.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ def generate_protos_cmd(path_to_protos, out_dir)
result
end


def fix_namespaces(out_dir)
Dir.glob("#{out_dir}/**/*") do |file_name|
if(!File.directory?(file_name))
file_contents = File.read(file_name);
new_contents = file_contents.gsub("GPBMetadata", "Io\\Token\\GPBMetadata")
File.open(file_name, "w") {|file| file.puts new_contents }
end
end
end

# Fetch the protos.
fetch_protos();

Expand All @@ -81,9 +92,10 @@ def generate_protos_cmd(path_to_protos, out_dir)
system("rm -rf #{dir}/Io");
system("mkdir #{dir}");

gencommand = generate_protos_cmd("common", dir) +
generate_protos_cmd("common/google/api", dir) +
generate_protos_cmd("extensions", dir) +
generate_protos_cmd("external/gateway", dir);
gencommand = generate_protos_cmd("common", dir)+
generate_protos_cmd("common/google/api", dir) +
generate_protos_cmd("extensions", dir) +
generate_protos_cmd("external/gateway", dir);

system(gencommand);
system(gencommand);
fix_namespaces(dir);
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"autoload": {
"psr-4": {
"Test\\": "tests/",
"Tokenio\\": "lib/",
"Io\\Token\\": "lib/",
"Google\\": "lib/Proto/Google",
"GPBMetadata\\": "lib/Proto/GPBMetadata",
"Io\\Token\\GPBMetadata\\": "lib/Proto/GPBMetadata",
"Io\\": "lib/Proto/Io/"
}
},
Expand Down
Loading