Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate one enum per enum case for the testing.
Browse files Browse the repository at this point in the history
This is a workaround for apple#904, the underlying problem is still there, but this
makes the generated source file for testing "work" in that it doesn't hit the
compile failure. A real solution is still needed for large enums.
thomasvl committed Sep 26, 2019
1 parent ed9913b commit 42a83f2
Showing 4 changed files with 79,332 additions and 7,766 deletions.
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -461,10 +461,11 @@ Protos/generated_swift_names_enum_cases.proto: Protos/mined_words.txt
@echo '// Swift compile errors are probably bugs in protoc-gen-swift' >> $@
@echo 'syntax = "proto3";' >> $@
@echo 'package protobuf_unittest_generated;' >> $@
@echo 'enum GeneratedSwiftReservedEnum {' >> $@
@echo ' NONE = 0;' >> $@
@cat Protos/mined_words.txt | awk 'BEGIN{n = 1} {print " " $$1 " = " n ";"; n += 1 }' >> $@
@echo '}' >> $@
@#echo 'enum GeneratedSwiftReservedEnum {' >> $@
@#echo ' NONE = 0;' >> $@
@#cat Protos/mined_words.txt | awk 'BEGIN{n = 1} {print " " $$1 " = " n ";"; n += 1 }' >> $@
@#echo '}' >> $@
@cat Protos/mined_words.txt | awk 'BEGIN{n = 1} {print "enum GeneratedSwiftReservedEnum" n " { NONE_" n " = 0; " $$1 " = 1; }"; n += 1 }' >> $@

Protos/generated_swift_names_messages.proto: Protos/mined_words.txt
@echo Building $@
Loading

0 comments on commit 42a83f2

Please sign in to comment.