Skip to content

Commit 2fd4c45

Browse files
authored
Merge pull request apple#669 from tbkka/generated-namespacing
Move generated protos into a different package
2 parents 7a5ad5a + c21ee80 commit 2fd4c45

14 files changed

+7886
-7502
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ Protos/generated_swift_names_fields.proto: Protos/mined_words.txt
461461
@echo '// Protoc errors imply this file is being generated incorrectly' >> $@
462462
@echo '// Swift compile errors are probably bugs in protoc-gen-swift' >> $@
463463
@echo 'syntax = "proto3";' >> $@
464-
@echo 'package protobuf_unittest;' >> $@
464+
@echo 'package protobuf_unittest_generated;' >> $@
465465
@echo 'message GeneratedSwiftReservedFields {' >> $@
466466
@cat Protos/mined_words.txt | awk 'BEGIN{n = 1} {print " int32 " $$1 " = " n ";"; n += 1 }' >> $@
467467
@echo '}' >> $@
@@ -473,7 +473,7 @@ Protos/generated_swift_names_enum_cases.proto: Protos/mined_words.txt
473473
@echo '// Protoc errors imply this file is being generated incorrectly' >> $@
474474
@echo '// Swift compile errors are probably bugs in protoc-gen-swift' >> $@
475475
@echo 'syntax = "proto3";' >> $@
476-
@echo 'package protobuf_unittest;' >> $@
476+
@echo 'package protobuf_unittest_generated;' >> $@
477477
@echo 'enum GeneratedSwiftReservedEnum {' >> $@
478478
@echo ' NONE = 0;' >> $@
479479
@cat Protos/mined_words.txt | awk 'BEGIN{n = 1} {print " " $$1 " = " n ";"; n += 1 }' >> $@
@@ -486,7 +486,7 @@ Protos/generated_swift_names_messages.proto: Protos/mined_words.txt
486486
@echo '// Protoc errors imply this file is being generated incorrectly' >> $@
487487
@echo '// Swift compile errors are probably bugs in protoc-gen-swift' >> $@
488488
@echo 'syntax = "proto3";' >> $@
489-
@echo 'package protobuf_unittest;' >> $@
489+
@echo 'package protobuf_unittest_generated;' >> $@
490490
@echo 'message GeneratedSwiftReservedMessages {' >> $@
491491
@cat Protos/mined_words.txt | awk '{print " message " $$1 " { int32 " $$1 " = 1; }"}' >> $@
492492
@echo '}' >> $@
@@ -498,7 +498,7 @@ Protos/generated_swift_names_enums.proto: Protos/mined_words.txt
498498
@echo '// Protoc errors imply this file is being generated incorrectly' >> $@
499499
@echo '// Swift compile errors are probably bugs in protoc-gen-swift' >> $@
500500
@echo 'syntax = "proto3";' >> $@
501-
@echo 'package protobuf_unittest;' >> $@
501+
@echo 'package protobuf_unittest_generated;' >> $@
502502
@echo 'message GeneratedSwiftReservedEnums {' >> $@
503503
@cat Protos/mined_words.txt | awk '{print " enum " $$1 " { NONE_" $$1 " = 0; }"}' >> $@
504504
@echo '}' >> $@

Protos/generated_swift_names_enum_cases.proto

Lines changed: 165 additions & 163 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Protoc errors imply this file is being generated incorrectly
33
// Swift compile errors are probably bugs in protoc-gen-swift
44
syntax = "proto3";
5-
package protobuf_unittest;
5+
package protobuf_unittest_generated;
66
enum GeneratedSwiftReservedEnum {
77
NONE = 0;
88
adjusted = 1;
@@ -452,166 +452,168 @@ enum GeneratedSwiftReservedEnum {
452452
root = 445;
453453
s = 446;
454454
sawBackslash = 447;
455-
scanner = 448;
456-
seconds = 449;
457-
self = 450;
458-
separator = 451;
459-
serialize = 452;
460-
serializedData = 453;
461-
serializedSize = 454;
462-
set = 455;
463-
setExtensionValue = 456;
464-
shift = 457;
465-
SimpleExtensionMap = 458;
466-
sizer = 459;
467-
source = 460;
468-
sourceContext = 461;
469-
sourceEncoding = 462;
470-
split = 463;
471-
start = 464;
472-
startArray = 465;
473-
startField = 466;
474-
startIndex = 467;
475-
startMessageField = 468;
476-
startObject = 469;
477-
startRegularField = 470;
478-
state = 471;
479-
static = 472;
480-
StaticString = 473;
481-
storage = 474;
482-
String = 475;
483-
stringLiteral = 476;
484-
StringLiteralType = 477;
485-
stringResult = 478;
486-
stringValue = 479;
487-
struct = 480;
488-
structValue = 481;
489-
subDecoder = 482;
490-
subscript = 483;
491-
subVisitor = 484;
492-
Swift = 485;
493-
SwiftProtobuf = 486;
494-
syntax = 487;
495-
T = 488;
496-
tag = 489;
497-
terminator = 490;
498-
testDecoder = 491;
499-
text = 492;
500-
textDecoder = 493;
501-
TextFormatDecoder = 494;
502-
TextFormatDecodingError = 495;
503-
TextFormatEncodingVisitor = 496;
504-
textFormatString = 497;
505-
throws = 498;
506-
timeInterval = 499;
507-
timeIntervalSince1970 = 500;
508-
timeIntervalSinceReferenceDate = 501;
509-
Timestamp = 502;
510-
total = 503;
511-
totalSize = 504;
512-
traverse = 505;
513-
true = 506;
514-
try = 507;
515-
type = 508;
516-
typealias = 509;
517-
typePrefix = 510;
518-
typeStart = 511;
519-
typeUnknown = 512;
520-
typeURL = 513;
521-
UInt32 = 514;
522-
UInt32Value = 515;
523-
UInt64 = 516;
524-
UInt64Value = 517;
525-
UInt8 = 518;
526-
unicodeScalarLiteral = 519;
527-
UnicodeScalarLiteralType = 520;
528-
unicodeScalars = 521;
529-
UnicodeScalarView = 522;
530-
union = 523;
531-
unknown = 524;
532-
unknownFields = 525;
533-
UnknownStorage = 526;
534-
unpackTo = 527;
535-
UnsafeBufferPointer = 528;
536-
UnsafeMutablePointer = 529;
537-
UnsafePointer = 530;
538-
updatedOptions = 531;
539-
url = 532;
540-
utf8 = 533;
541-
utf8Codec = 534;
542-
utf8ToDouble = 535;
543-
UTF8View = 536;
544-
v = 537;
545-
value = 538;
546-
valueField = 539;
547-
values = 540;
548-
ValueType = 541;
549-
var = 542;
550-
Version = 543;
551-
versionString = 544;
552-
visitExtensionFields = 545;
553-
visitExtensionFieldsAsMessageSet = 546;
554-
visitMapField = 547;
555-
visitor = 548;
556-
visitPacked = 549;
557-
visitPackedBoolField = 550;
558-
visitPackedDoubleField = 551;
559-
visitPackedEnumField = 552;
560-
visitPackedFixed32Field = 553;
561-
visitPackedFixed64Field = 554;
562-
visitPackedFloatField = 555;
563-
visitPackedInt32Field = 556;
564-
visitPackedInt64Field = 557;
565-
visitPackedSFixed32Field = 558;
566-
visitPackedSFixed64Field = 559;
567-
visitPackedSInt32Field = 560;
568-
visitPackedSInt64Field = 561;
569-
visitPackedUInt32Field = 562;
570-
visitPackedUInt64Field = 563;
571-
visitRepeated = 564;
572-
visitRepeatedBoolField = 565;
573-
visitRepeatedBytesField = 566;
574-
visitRepeatedDoubleField = 567;
575-
visitRepeatedEnumField = 568;
576-
visitRepeatedFixed32Field = 569;
577-
visitRepeatedFixed64Field = 570;
578-
visitRepeatedFloatField = 571;
579-
visitRepeatedGroupField = 572;
580-
visitRepeatedInt32Field = 573;
581-
visitRepeatedInt64Field = 574;
582-
visitRepeatedMessageField = 575;
583-
visitRepeatedSFixed32Field = 576;
584-
visitRepeatedSFixed64Field = 577;
585-
visitRepeatedSInt32Field = 578;
586-
visitRepeatedSInt64Field = 579;
587-
visitRepeatedStringField = 580;
588-
visitRepeatedUInt32Field = 581;
589-
visitRepeatedUInt64Field = 582;
590-
visitSingular = 583;
591-
visitSingularBoolField = 584;
592-
visitSingularBytesField = 585;
593-
visitSingularDoubleField = 586;
594-
visitSingularEnumField = 587;
595-
visitSingularFixed32Field = 588;
596-
visitSingularFixed64Field = 589;
597-
visitSingularFloatField = 590;
598-
visitSingularGroupField = 591;
599-
visitSingularInt32Field = 592;
600-
visitSingularInt64Field = 593;
601-
visitSingularMessageField = 594;
602-
visitSingularSFixed32Field = 595;
603-
visitSingularSFixed64Field = 596;
604-
visitSingularSInt32Field = 597;
605-
visitSingularSInt64Field = 598;
606-
visitSingularStringField = 599;
607-
visitSingularUInt32Field = 600;
608-
visitSingularUInt64Field = 601;
609-
visitUnknown = 602;
610-
wasDecoded = 603;
611-
where = 604;
612-
wireFormat = 605;
613-
with = 606;
614-
WrappedType = 607;
615-
written = 608;
616-
yday = 609;
455+
sawSection4Characters = 448;
456+
sawSection5Characters = 449;
457+
scanner = 450;
458+
seconds = 451;
459+
self = 452;
460+
separator = 453;
461+
serialize = 454;
462+
serializedData = 455;
463+
serializedSize = 456;
464+
set = 457;
465+
setExtensionValue = 458;
466+
shift = 459;
467+
SimpleExtensionMap = 460;
468+
sizer = 461;
469+
source = 462;
470+
sourceContext = 463;
471+
sourceEncoding = 464;
472+
split = 465;
473+
start = 466;
474+
startArray = 467;
475+
startField = 468;
476+
startIndex = 469;
477+
startMessageField = 470;
478+
startObject = 471;
479+
startRegularField = 472;
480+
state = 473;
481+
static = 474;
482+
StaticString = 475;
483+
storage = 476;
484+
String = 477;
485+
stringLiteral = 478;
486+
StringLiteralType = 479;
487+
stringResult = 480;
488+
stringValue = 481;
489+
struct = 482;
490+
structValue = 483;
491+
subDecoder = 484;
492+
subscript = 485;
493+
subVisitor = 486;
494+
Swift = 487;
495+
SwiftProtobuf = 488;
496+
syntax = 489;
497+
T = 490;
498+
tag = 491;
499+
terminator = 492;
500+
testDecoder = 493;
501+
text = 494;
502+
textDecoder = 495;
503+
TextFormatDecoder = 496;
504+
TextFormatDecodingError = 497;
505+
TextFormatEncodingVisitor = 498;
506+
textFormatString = 499;
507+
throws = 500;
508+
timeInterval = 501;
509+
timeIntervalSince1970 = 502;
510+
timeIntervalSinceReferenceDate = 503;
511+
Timestamp = 504;
512+
total = 505;
513+
totalSize = 506;
514+
traverse = 507;
515+
true = 508;
516+
try = 509;
517+
type = 510;
518+
typealias = 511;
519+
typePrefix = 512;
520+
typeStart = 513;
521+
typeUnknown = 514;
522+
typeURL = 515;
523+
UInt32 = 516;
524+
UInt32Value = 517;
525+
UInt64 = 518;
526+
UInt64Value = 519;
527+
UInt8 = 520;
528+
unicodeScalarLiteral = 521;
529+
UnicodeScalarLiteralType = 522;
530+
unicodeScalars = 523;
531+
UnicodeScalarView = 524;
532+
union = 525;
533+
unknown = 526;
534+
unknownFields = 527;
535+
UnknownStorage = 528;
536+
unpackTo = 529;
537+
UnsafeBufferPointer = 530;
538+
UnsafeMutablePointer = 531;
539+
UnsafePointer = 532;
540+
updatedOptions = 533;
541+
url = 534;
542+
utf8 = 535;
543+
utf8Codec = 536;
544+
utf8ToDouble = 537;
545+
UTF8View = 538;
546+
v = 539;
547+
value = 540;
548+
valueField = 541;
549+
values = 542;
550+
ValueType = 543;
551+
var = 544;
552+
Version = 545;
553+
versionString = 546;
554+
visitExtensionFields = 547;
555+
visitExtensionFieldsAsMessageSet = 548;
556+
visitMapField = 549;
557+
visitor = 550;
558+
visitPacked = 551;
559+
visitPackedBoolField = 552;
560+
visitPackedDoubleField = 553;
561+
visitPackedEnumField = 554;
562+
visitPackedFixed32Field = 555;
563+
visitPackedFixed64Field = 556;
564+
visitPackedFloatField = 557;
565+
visitPackedInt32Field = 558;
566+
visitPackedInt64Field = 559;
567+
visitPackedSFixed32Field = 560;
568+
visitPackedSFixed64Field = 561;
569+
visitPackedSInt32Field = 562;
570+
visitPackedSInt64Field = 563;
571+
visitPackedUInt32Field = 564;
572+
visitPackedUInt64Field = 565;
573+
visitRepeated = 566;
574+
visitRepeatedBoolField = 567;
575+
visitRepeatedBytesField = 568;
576+
visitRepeatedDoubleField = 569;
577+
visitRepeatedEnumField = 570;
578+
visitRepeatedFixed32Field = 571;
579+
visitRepeatedFixed64Field = 572;
580+
visitRepeatedFloatField = 573;
581+
visitRepeatedGroupField = 574;
582+
visitRepeatedInt32Field = 575;
583+
visitRepeatedInt64Field = 576;
584+
visitRepeatedMessageField = 577;
585+
visitRepeatedSFixed32Field = 578;
586+
visitRepeatedSFixed64Field = 579;
587+
visitRepeatedSInt32Field = 580;
588+
visitRepeatedSInt64Field = 581;
589+
visitRepeatedStringField = 582;
590+
visitRepeatedUInt32Field = 583;
591+
visitRepeatedUInt64Field = 584;
592+
visitSingular = 585;
593+
visitSingularBoolField = 586;
594+
visitSingularBytesField = 587;
595+
visitSingularDoubleField = 588;
596+
visitSingularEnumField = 589;
597+
visitSingularFixed32Field = 590;
598+
visitSingularFixed64Field = 591;
599+
visitSingularFloatField = 592;
600+
visitSingularGroupField = 593;
601+
visitSingularInt32Field = 594;
602+
visitSingularInt64Field = 595;
603+
visitSingularMessageField = 596;
604+
visitSingularSFixed32Field = 597;
605+
visitSingularSFixed64Field = 598;
606+
visitSingularSInt32Field = 599;
607+
visitSingularSInt64Field = 600;
608+
visitSingularStringField = 601;
609+
visitSingularUInt32Field = 602;
610+
visitSingularUInt64Field = 603;
611+
visitUnknown = 604;
612+
wasDecoded = 605;
613+
where = 606;
614+
wireFormat = 607;
615+
with = 608;
616+
WrappedType = 609;
617+
written = 610;
618+
yday = 611;
617619
}

Protos/generated_swift_names_enums.proto

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Protoc errors imply this file is being generated incorrectly
33
// Swift compile errors are probably bugs in protoc-gen-swift
44
syntax = "proto3";
5-
package protobuf_unittest;
5+
package protobuf_unittest_generated;
66
message GeneratedSwiftReservedEnums {
77
enum adjusted { NONE_adjusted = 0; }
88
enum allocate { NONE_allocate = 0; }
@@ -451,6 +451,8 @@ message GeneratedSwiftReservedEnums {
451451
enum root { NONE_root = 0; }
452452
enum s { NONE_s = 0; }
453453
enum sawBackslash { NONE_sawBackslash = 0; }
454+
enum sawSection4Characters { NONE_sawSection4Characters = 0; }
455+
enum sawSection5Characters { NONE_sawSection5Characters = 0; }
454456
enum scanner { NONE_scanner = 0; }
455457
enum seconds { NONE_seconds = 0; }
456458
enum self { NONE_self = 0; }

0 commit comments

Comments
 (0)