aboutsummaryrefslogtreecommitdiff
path: root/objectivec
Commit message (Collapse)AuthorAgeFilesLines
* Fix some failing travis tests.Feng Xiao2016-07-013-4/+66
| | | | | | | 1. Add missing header file to Makefile.am. 2. Re-generate objectivec generated code for well-known types. Change-Id: If28217c701cf8bd739ea0db240e9eee600f23ee7
* Xcode project cleanup/setup.Thomas Van Lenten2016-06-296-43/+11
| | | | | | | | - Correct some cases sources were compiled into the static lib and the tests. - Enable Xcodes code coverage support on the unittests. We aren't complete on coverage, but having the data always there should make it easier to chip away at this going forward. - Drop method in tests that isn't used, wire up a validator in another test.
* Validate the tag numbers when parsing. (#1725)Thomas Van Lenten2016-06-295-4/+21
| | | | | | | | | | | | | | | There was a twist code path (that some times showed up due to what happened to be in memory in failure cases), that would cast a bogus wire type into the enum, and then fall through switch statements. Resolve this by validating all wire types when parsing tags and throwing the error at that point so it can't enter the system. As added safety, stick in a few asserts for apis that get passed tags to ensure they also are only seeing valid data. Bonus: Tweak the parsing loop to skip some work when we get the end marker (zero tag) instead of still looping through all the fields.
* Merge pull request #1720 from thomasvl/issue_1716Thomas Van Lenten2016-06-283-22/+72
|\ | | | | Fix GPBGetMessage{Repeated,Map}Field()
| * Fix GPBGetMessage{Repeated,Map}Field()Thomas Van Lenten2016-06-273-22/+72
| | | | | | | | | | | | | | - Correct impl by using helpers the message wiring does. - Add unittests. Fixes https://github.com/google/protobuf/issues/1716
* | Fix Objective-C generator option typoNathan Wong2016-06-271-1/+1
|/ | | Looks like this was changed during #1683, but missed in the README :)
* Merge pull request #1714 from dnkoutso/masterThomas Van Lenten2016-06-263-0/+26
|\ | | | | Get value from text format name in GPBEnumDescriptor
| * Get value from text format name in GPBEnumDescriptorDimitris Koutsogiorgas2016-06-263-0/+26
| |
* | Rename methods to avoid ObjC KVC collisions. (#1699)Thomas Van Lenten2016-06-2114-7325/+7448
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note: Breaking API change on the Dictionary classes. The numeric value classes were using "Value" in the naming, but this silently collided with the KVC category on NSObject; meaning KVC code could break up a keypath and call these selectors with the wrong types leading to crashes (even though the code all would compile cleanly). - Rename the methods to use the "type" instead of literal "Value". - Update all the impls and tests. - Enable the warning that will catch issues like this in the future. Fixes https://github.com/google/protobuf/issues/1616
* | Adds destination flag to xcodebuild to avoid possible flake errors (#1697)Sergio Campamá2016-06-201-1/+6
| | | | | | | | Adds destination flag to xcodebuild to avoid possible flake errors
* | Add new generation option for using proto sources from other frameworks.Thomas Van Lenten2016-06-171-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Better docs in the generator for the different options that can be passed during an invoke of protoc. - Add named_framework_to_proto_path_mappings_path to pass the path to a file containing mappings of frameworks for different proto files. - Update the generation to use the mapping to change the #import directives it creates. Note: the changes in helpers is mostly moving code within the fine, and then a small change to expose the parsing so a passed on class can consume the line. Fixes https://github.com/google/protobuf/issues/1457
* | Merge pull request #1683 from thomasvl/third_party_frameworkThomas Van Lenten2016-06-151-2/+15
|\ \ | | | | | | Add support for generation sources into a framework.
| * | Add support for generation sources into a framework.Thomas Van Lenten2016-06-151-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add a protoc objc option (generate_for_named_framework) to set the name of the framework all generated sources will be in. - Tweak some comments/naming to make it clear what is the Protobuf framework vs. the framework for generated code. - Update the objc README to document the new generation option to protoc. This is working towards https://github.com/google/protobuf/issues/1457.
* | | Add the CocoaPods integration tests to Travis.Sergio Campamá2016-06-141-1/+10
|/ / | | | | | | | | | | Also hotwires updating ruby as CocoaPods was crashing within a support library. Fixes #1619
* | Fixes Xcode 8 analyzer warning saying that it was missing a release in ↵Sergio Campamá2016-06-141-0/+5
| | | | | | | | dealloc (#1678)
* | Improving the granularity parsing errors (#1623)Sergio Campamá2016-06-025-42/+223
| | | | | | | | | | | | | | | | | | Add more context to GPBCodedInputStream failures. Have GPBMessage parsing apis extract out the GPBCodedInputStream information and expose it. Update HeaderDocs with pointers to all error domains/codes. Expand the unittests to cover the full set of errors reported. Fixes https://github.com/google/protobuf/issues/1618
* | Merge pull request #1620 from sergiocampama/cleanup1Thomas Van Lenten2016-05-302-12/+0
|\ \ | | | | | | Removing unused GPBExceptionMessageKey
| * | Removing unused GPBExceptionMessageKeySergio Campama2016-05-272-12/+0
| | | | | | | | | | | | https://github.com/google/protobuf/issues/1618
* | | Merge pull request #1617 from thomasvl/more_warningsThomas Van Lenten2016-05-276-172/+249
|\ \ \ | |/ / |/| | Add -Woverriding-method-mismatch.
| * | Add -Woverriding-method-mismatch.Thomas Van Lenten2016-05-276-172/+249
| | | | | | | | | | | | | | | | | | | | | Fixes up the code to avoid some issues with isEqual: methods. Opened https://github.com/google/protobuf/issues/1616 to track the KVC collision.
* | | fix expected class checking in GPBSetMessageRepeatedFieldJon Wall2016-05-262-2/+29
|/ / | | | | | | | | This is currently checking for the wrong class for enums and NSMutableArray fields.
* | Add more warnings to for the ObjC runtime buildThomas Van Lenten2016-05-2520-30/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Working on https://github.com/google/protobuf/issues/1599, specifically: - Turn on more warnings that the Xcode UI calls out with individual controls. - Manually add: -Wundef -Wswitch-enum - Manually add and then diable in the unittests because of XCTest's headers: -Wreserved-id-macro -Wdocumentation-unknown-command - Manually add -Wdirect-ivar-access, but disable it for the unittests and in the library code (via #pragmas to suppress it). This is done so proto users can enable the warning.
* | Merge pull request #1595 from thomasvl/objc_travis_tweaksThomas Van Lenten2016-05-251-20/+49
|\ \ | | | | | | Automated testing tweaks for ObjC
| * | Automated testing tweaks for ObjCThomas Van Lenten2016-05-241-20/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move the ObjC tests into the list and exclude them on linux, this will change where in the order they start, since they are longer, it will have other things run in parallel instead of them ending up last and taking the longest. - Switch to the Xcode 7.3 image. - Drop the use of xctool and stream line things through the full_mac_build.sh script. This means we end up with only one build script instead of two. - Tweaks to the mac build script: - Make iOS Xcode version support explicit - Support Debug/Release only building - Change the OS X min parallel count to 2 to better deal with VMs. - Split the travis ios tests into the two Xcode Configurations as the logs are choking travis.
* | | Better support for using the proto library from a framework.Thomas Van Lenten2016-05-2423-46/+339
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | - Add generator constant for the default framework name. - Add generator api for making the CPP symbol from the name. - Add generator api to see if it is a bundled proto file. - Output a CPP conditional and two imports for the core library headers. - Add helper for generating the #import for file headers to deal with the framework imports. - Add a reference from the unittests to a WKT to use that to inspect how imports generate. - Update the podspec to define the CPP symbol and require pods 1.0 (or later). Fixes https://github.com/google/protobuf/issues/1457
* | Make the CocoaPods integration tests more robustThomas Van Lenten2016-05-205-14/+36
| | | | | | | | | | | | | | - Env solution doesn't seem to always work, use template pod files and copy them in place instead. - Flush the pods cache before and after runs. - Make pod install verbose to have the info incase something goes wrong.
* | Add shared schemes for the CocoaPods integration testsThomas Van Lenten2016-05-192-0/+182
| | | | | | | | | | Otherwise the projects have to be opened once to create user schemes for the command line builds to work.
* | CocoaPod Integration TestsThomas Van Lenten2016-05-1923-0/+2063
| | | | | | | | | | | | | | | | - Add an Xcode 6.3 created default iOS Project. - Add an Xcode 6.3 created default OS X Project. - Add Podfiles to for both that use Protobufs from within the tree. - Add a script to run the tests (and cleanup) to help confirm the state of the Protobuf.podspec and sources.
* | Expand the OS X/Xcode gitignoresThomas Van Lenten2016-05-191-0/+23
|/ | | | | - Add the folder CocoaPods will add to the root folder. - Move and expand the entries in the objectivec directory.
* Declare an init and avoid passing NULL to initWithValue:count:Thomas Van Lenten2016-05-102-65/+90
| | | | Fixes https://github.com/google/protobuf/issues/1189
* Update descritpor protos for objcJisi Liu2016-04-2922-3863/+3
|
* Merge the script fix.Jisi Liu2016-04-291-1/+1
|\
| * Fix cp -r usage to be portable.Jisi Liu2016-04-291-1/+1
| | | | | | | | | | | | | | | | cp -r foo/ bar/ in linux will create a bar/foo directoy. In the objectivec generate descritpor case, well known types will be created in objectivec/google/google/protobuf/.. if the command is run under linux. Adding the trailing period fixes the behavior inconsistency.
* | Merge branch 'master' of github.com:google/protobufJisi Liu2016-04-283-5/+131
|\|
| * Fix up -hash/-isEqual: for bool storage.Thomas Van Lenten2016-04-273-5/+114
| | | | | | | | | | | | | | Both methods weren't checking the has_bits (where the bools are stored), so it resulted in invalid results. Add a test that should shake out something like this in the future also.
| * Proper checking of enum with non zero defaultThomas Van Lenten2016-04-262-0/+17
| | | | | | | | | | | | | | | | | | proto2 syntax allows the first enum to have a non zero value. This means any field using that default has a non zero default without having an explicit default being set. So when deciding what runtime info is needed, don't rely on an explicit default, always check that the values aren't zero. Fixes https://github.com/google/protobuf/issues/1453
* | Down integrate from Google internal.Jisi Liu2016-04-2820-0/+3862
|/
* ObjC support for failing the build in the generated WKTs are out of dateThomas Van Lenten2016-04-202-31/+38
| | | | | | | | - Always generated into a temp directory so we can see if things changed. - Add a flag to control exiting with error when stale vs updating. This should let the continuous builds error out when ObjC needs to have the checked in sources updated.
* Regenerate the WKT to pick up current changes to the proto files.Thomas Van Lenten2016-04-1920-5/+160
|
* Fix comment typoThomas Van Lenten2016-04-191-15/+15
|
* Merge pull request #1391 from thomasvl/string_tweaksThomas Van Lenten2016-04-062-9/+47
|\ | | | | ObjC String followups: one test case only addition, behavior change for invalid UTF-8
| * Error during parsing for invalid UTF-8 instead of dropping dropping data.Thomas Van Lenten2016-04-052-9/+9
| | | | | | | | | | | | | | This seems to be some code evolution side effects. Back when there was a custom string class, we couldn't really error when we finally saw the string was bad so we had to return the empty string, but now that full validation is done up front, it can error out.
| * Add tests to ensure we read strings with BOMs so we don't forget about ↵Thomas Van Lenten2016-04-051-0/+38
| | | | | | | | lessons of the past.
* | Updating Xcode Settings to use iOS 9.3Geoffrey Wiseman2016-04-061-0/+8
|/ | | | Update the simulators used for some tests under Xcode 7.3 to be iOS 9.3.
* Add -position and -isAtEnd for use when manually parsing input streams.Thomas Van Lenten2016-04-012-0/+17
|
* The message was autoreleased, the -releases are an over release.Thomas Van Lenten2016-03-241-2/+0
|
* Only create the readonlySemaphore on demand.Thomas Van Lenten2016-03-213-3/+19
| | | | | | This will lower the amount of dispatch_semaphores created per Message when the full object tree isn't walked in a way that would require them to be created. Uses a dispatch_once_t for one time init of the dispatch_semaphore.
* Shrink ObjC overhead (generated size and some runtime sizes)Thomas Van Lenten2016-03-1739-4878/+655
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NOTE: This is a binary breaking change as structure sizes have changed size and/or order. - Drop capturing field options, no other options were captured and other mobile targeted languages don't try to capture this sort information (saved 8 bytes for every field defined (in static data and again in field descriptor instance size data). - No longer generate/compile in the messages/enums in descriptor.proto. If developers need it, they should generate it and compile it in. Reduced the overhead of the core library. - Compute the number of has_bits actually needs to avoid over reserving. - Let the boolean single fields store via a has_bit to avoid storage, makes the common cases of the instance size smaller. - Reorder some flags and down size the enums to contain the bits needed. - Reorder the items in the structures to manually ensure they are are packed better (especially when generating 64bit code - 8 bytes for every field, 16 bytes for every extension, instance sizes 8 bytes also). - Split off the structure initialization so when the default is zero, the generated static storage doesn't need to reserve the space. This is batched at the message level, so all the fields for the message have to have zero defaults to get the saves. By definition all proto3 syntax files fall into this case but it also saves space for the proto2 that use the standard defaults. (saves 8 bytes of static data for every field that had a zero default) - Don't track the enums defined by a message. Nothing in the runtime needs it and it was just generation and runtime overhead. (saves 8 bytes per enum) - Ensure EnumDescriptors are started up threadsafe in all cases. - Split some of the Descriptor initialization into multiple methods so the generated code isn't padded with lots of zero/nil args. - Change how oneof info is feed to the runtime enabling us to generate less static data (8 bytes saved per oneof for 64bit). - Change how enum value informat is capture to pack the data and only decode it if it ends up being needed. Avoids padding issues causing bloat of 64bit, and removes the needs for extra pointers in addition to the data (just the data and one pointer now).
* Fix up handing of fields with leading names that should be all caps.Thomas Van Lenten2016-03-082-0/+30
| | | | Add a compile test to confirm things are working as expected.
* HeaderDoc support in the library and generated sourcesThomas Van Lenten2016-03-0728-1343/+1952
| | | | | | | - Convert most of the core library headers over to HeaderDoc format. - Switch the generated comments over to HeaderDoc. - Create GPBCodedOutputStream_PackagePrivate and move some things into there that should be more internal.