Commit bdeb215c authored by Paul Yang's avatar Paul Yang Committed by GitHub

Merge pull request #1737 from jcanizales/test

Merge beta-3.1 fixes into beta-3 branch
parents d4d13a43 99ae32a3
...@@ -88,16 +88,14 @@ build_msvc ...@@ -88,16 +88,14 @@ build_msvc
# packages themselves. # packages themselves.
/csharp/src/packages/*/ /csharp/src/packages/*/
# Directories created by opening the Objective C Xcode projects.
objectivec/ProtocolBuffers_OSX.xcodeproj/project.xcworkspace/xcuserdata/
objectivec/ProtocolBuffers_OSX.xcodeproj/project.xcworkspace/xcshareddata/ProtocolBuffers_OSX.xccheckout
objectivec/ProtocolBuffers_OSX.xcodeproj/xcuserdata/
objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/xcuserdata/
objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/xcshareddata/ProtocolBuffers_iOS.xccheckout
objectivec/ProtocolBuffers_iOS.xcodeproj/xcuserdata/
# OS X's Finder creates these for state about opened windows/etc. # OS X's Finder creates these for state about opened windows/etc.
**/.DS_Store **/.DS_Store
# Cocoapods artifacts
# Podfile.lock and the workspace file are tracked, to ease deleting them. That's
# needed to trigger "pod install" to rerun the preinstall commands.
Pods/
# Comformance test output # Comformance test output
conformance/.libs/ conformance/.libs/
conformance/com/ conformance/com/
......
...@@ -8,7 +8,7 @@ os: ...@@ -8,7 +8,7 @@ os:
- linux - linux
- osx - osx
# The Objective C build needs Xcode 7.0 or later. # The Objective C build needs Xcode 7.0 or later.
osx_image: xcode7.2 osx_image: xcode7.3
script: script:
- ./tests.sh $CONFIG - ./tests.sh $CONFIG
env: env:
...@@ -23,6 +23,11 @@ env: ...@@ -23,6 +23,11 @@ env:
- CONFIG=javanano_jdk7 - CONFIG=javanano_jdk7
- CONFIG=javanano_oracle7 - CONFIG=javanano_oracle7
- CONFIG=javascript - CONFIG=javascript
# iOS build log was starting to choke travis UI, so split to cover the
# Xcode Debug and Release Configurations independently.
- CONFIG=objectivec_ios_debug
- CONFIG=objectivec_ios_release
- CONFIG=objectivec_osx
- CONFIG=python - CONFIG=python
- CONFIG=python_cpp - CONFIG=python_cpp
- CONFIG=ruby19 - CONFIG=ruby19
...@@ -54,12 +59,13 @@ matrix: ...@@ -54,12 +59,13 @@ matrix:
# which doesn't work on OS X. # which doesn't work on OS X.
- os: osx - os: osx
env: CONFIG=golang env: CONFIG=golang
# Add into the matrix OS X tests of Objective C (needs Xcode, so it won't # OS X/iOS tests of Objective C (needs Xcode, so it won't work on other
# work on other platforms). These are split so it doesn't take as long to run. # platforms).
include: - os: linux
- os: osx env: CONFIG=objectivec_ios_debug
env: CONFIG=objectivec_ios - os: linux
- os: osx env: CONFIG=objectivec_ios_release
- os: linux
env: CONFIG=objectivec_osx env: CONFIG=objectivec_osx
allow_failures: allow_failures:
# These currently do not work on OS X but are being worked on by @haberman. # These currently do not work on OS X but are being worked on by @haberman.
...@@ -71,14 +77,11 @@ matrix: ...@@ -71,14 +77,11 @@ matrix:
# we moved to an OS X image that is 10.11. # we moved to an OS X image that is 10.11.
- os: osx - os: osx
env: CONFIG=python_cpp env: CONFIG=python_cpp
# xctool 0.2.8 seems to have a bug where it randomly kills tests saying # Mark the iOS test as flakey as xcodebuild some times fails to start the
# they failed. # iOS Simulator.
# https://github.com/facebook/xctool/issues/619 - os: osx
# https://github.com/google/protobuf/issues/1232 env: CONFIG=objectivec_ios_debug
# travis updated their images to include 0.2.8:
# https://blog.travis-ci.com/2016-03-23-xcode-image-updates
# Mark the iOS test as flakey so these failures don't turn things red.
- os: osx - os: osx
env: CONFIG=objectivec_ios env: CONFIG=objectivec_ios_release
notifications: notifications:
email: false email: false
...@@ -5,11 +5,12 @@ ...@@ -5,11 +5,12 @@
# dependent projects use the :git notation to refer to the library. # dependent projects use the :git notation to refer to the library.
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Protobuf' s.name = 'Protobuf'
s.version = '3.0.0-beta-2' s.version = '3.0.0-beta-3.1'
s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.' s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.'
s.homepage = 'https://github.com/google/protobuf' s.homepage = 'https://github.com/google/protobuf'
s.license = 'New BSD' s.license = 'New BSD'
s.authors = { 'The Protocol Buffers contributors' => 'protobuf@googlegroups.com' } s.authors = { 'The Protocol Buffers contributors' => 'protobuf@googlegroups.com' }
s.cocoapods_version = '>= 1.0'
s.source = { :git => 'https://github.com/google/protobuf.git', s.source = { :git => 'https://github.com/google/protobuf.git',
:tag => "v#{s.version}" } :tag => "v#{s.version}" }
...@@ -32,7 +33,10 @@ Pod::Spec.new do |s| ...@@ -32,7 +33,10 @@ Pod::Spec.new do |s|
# The following would cause duplicate symbol definitions. GPBProtocolBuffers is expected to be # The following would cause duplicate symbol definitions. GPBProtocolBuffers is expected to be
# left out, as it's an umbrella implementation file. # left out, as it's an umbrella implementation file.
s.exclude_files = 'objectivec/GPBProtocolBuffers.m' s.exclude_files = 'objectivec/GPBProtocolBuffers.m'
s.header_mappings_dir = 'objectivec'
# Set a CPP symbol so the code knows to use framework imports.
s.user_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1' }
s.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1' }
s.ios.deployment_target = '7.1' s.ios.deployment_target = '7.1'
s.osx.deployment_target = '10.9' s.osx.deployment_target = '10.9'
......
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint
## Obj-C/Swift specific
*.hmap
*.ipa
...@@ -37,6 +37,10 @@ OPTIONS: ...@@ -37,6 +37,10 @@ OPTIONS:
Skip the invoke of Xcode to test the runtime on both iOS and OS X. Skip the invoke of Xcode to test the runtime on both iOS and OS X.
--skip-xcode-ios --skip-xcode-ios
Skip the invoke of Xcode to test the runtime on iOS. Skip the invoke of Xcode to test the runtime on iOS.
--skip-xcode-debug
Skip the Xcode Debug configuration.
--skip-xcode-release
Skip the Xcode Release configuration.
--skip-xcode-osx --skip-xcode-osx
Skip the invoke of Xcode to test the runtime on OS X. Skip the invoke of Xcode to test the runtime on OS X.
--skip-objc-conformance --skip-objc-conformance
...@@ -66,8 +70,8 @@ wrapped_make() { ...@@ -66,8 +70,8 @@ wrapped_make() {
} }
NUM_MAKE_JOBS=$(/usr/sbin/sysctl -n hw.ncpu) NUM_MAKE_JOBS=$(/usr/sbin/sysctl -n hw.ncpu)
if [[ "${NUM_MAKE_JOBS}" -lt 4 ]] ; then if [[ "${NUM_MAKE_JOBS}" -lt 2 ]] ; then
NUM_MAKE_JOBS=4 NUM_MAKE_JOBS=2
fi fi
DO_AUTOGEN=no DO_AUTOGEN=no
...@@ -76,6 +80,8 @@ REGEN_DESCRIPTORS=no ...@@ -76,6 +80,8 @@ REGEN_DESCRIPTORS=no
CORE_ONLY=no CORE_ONLY=no
DO_XCODE_IOS_TESTS=yes DO_XCODE_IOS_TESTS=yes
DO_XCODE_OSX_TESTS=yes DO_XCODE_OSX_TESTS=yes
DO_XCODE_DEBUG=yes
DO_XCODE_RELEASE=yes
DO_OBJC_CONFORMANCE_TESTS=yes DO_OBJC_CONFORMANCE_TESTS=yes
while [[ $# != 0 ]]; do while [[ $# != 0 ]]; do
case "${1}" in case "${1}" in
...@@ -109,6 +115,12 @@ while [[ $# != 0 ]]; do ...@@ -109,6 +115,12 @@ while [[ $# != 0 ]]; do
--skip-xcode-osx ) --skip-xcode-osx )
DO_XCODE_OSX_TESTS=no DO_XCODE_OSX_TESTS=no
;; ;;
--skip-xcode-debug )
DO_XCODE_DEBUG=no
;;
--skip-xcode-release )
DO_XCODE_RELEASE=no
;;
--skip-objc-conformance ) --skip-objc-conformance )
DO_OBJC_CONFORMANCE_TESTS=no DO_OBJC_CONFORMANCE_TESTS=no
;; ;;
...@@ -151,18 +163,26 @@ if [[ "${DO_CLEAN}" == "yes" ]] ; then ...@@ -151,18 +163,26 @@ if [[ "${DO_CLEAN}" == "yes" ]] ; then
-project objectivec/ProtocolBuffers_iOS.xcodeproj -project objectivec/ProtocolBuffers_iOS.xcodeproj
-scheme ProtocolBuffers -scheme ProtocolBuffers
) )
if [[ "${DO_XCODE_DEBUG}" == "yes" ]] ; then
"${XCODEBUILD_CLEAN_BASE_IOS[@]}" -configuration Debug clean "${XCODEBUILD_CLEAN_BASE_IOS[@]}" -configuration Debug clean
fi
if [[ "${DO_XCODE_RELEASE}" == "yes" ]] ; then
"${XCODEBUILD_CLEAN_BASE_IOS[@]}" -configuration Release clean "${XCODEBUILD_CLEAN_BASE_IOS[@]}" -configuration Release clean
fi fi
fi
if [[ "${DO_XCODE_OSX_TESTS}" == "yes" ]] ; then if [[ "${DO_XCODE_OSX_TESTS}" == "yes" ]] ; then
XCODEBUILD_CLEAN_BASE_OSX=( XCODEBUILD_CLEAN_BASE_OSX=(
xcodebuild xcodebuild
-project objectivec/ProtocolBuffers_OSX.xcodeproj -project objectivec/ProtocolBuffers_OSX.xcodeproj
-scheme ProtocolBuffers -scheme ProtocolBuffers
) )
if [[ "${DO_XCODE_DEBUG}" == "yes" ]] ; then
"${XCODEBUILD_CLEAN_BASE_OSX[@]}" -configuration Debug clean "${XCODEBUILD_CLEAN_BASE_OSX[@]}" -configuration Debug clean
fi
if [[ "${DO_XCODE_RELEASE}" == "yes" ]] ; then
"${XCODEBUILD_CLEAN_BASE_OSX[@]}" -configuration Release clean "${XCODEBUILD_CLEAN_BASE_OSX[@]}" -configuration Release clean
fi fi
fi
fi fi
if [[ "${REGEN_DESCRIPTORS}" == "yes" ]] ; then if [[ "${REGEN_DESCRIPTORS}" == "yes" ]] ; then
...@@ -222,20 +242,20 @@ if [[ "${DO_XCODE_IOS_TESTS}" == "yes" ]] ; then ...@@ -222,20 +242,20 @@ if [[ "${DO_XCODE_IOS_TESTS}" == "yes" ]] ; then
-destination "platform=iOS Simulator,name=iPad Air,OS=9.0" # 64bit -destination "platform=iOS Simulator,name=iPad Air,OS=9.0" # 64bit
) )
;; ;;
7.3* ) 7.2* )
XCODEBUILD_TEST_BASE_IOS+=( XCODEBUILD_TEST_BASE_IOS+=(
-destination "platform=iOS Simulator,name=iPhone 4s,OS=8.1" # 32bit -destination "platform=iOS Simulator,name=iPhone 4s,OS=8.1" # 32bit
-destination "platform=iOS Simulator,name=iPhone 6,OS=9.3" # 64bit -destination "platform=iOS Simulator,name=iPhone 6,OS=9.2" # 64bit
-destination "platform=iOS Simulator,name=iPad 2,OS=8.1" # 32bit -destination "platform=iOS Simulator,name=iPad 2,OS=8.1" # 32bit
-destination "platform=iOS Simulator,name=iPad Air,OS=9.3" # 64bit -destination "platform=iOS Simulator,name=iPad Air,OS=9.2" # 64bit
) )
;; ;;
7.* ) 7.3* )
XCODEBUILD_TEST_BASE_IOS+=( XCODEBUILD_TEST_BASE_IOS+=(
-destination "platform=iOS Simulator,name=iPhone 4s,OS=8.1" # 32bit -destination "platform=iOS Simulator,name=iPhone 4s,OS=8.1" # 32bit
-destination "platform=iOS Simulator,name=iPhone 6,OS=9.2" # 64bit -destination "platform=iOS Simulator,name=iPhone 6,OS=9.3" # 64bit
-destination "platform=iOS Simulator,name=iPad 2,OS=8.1" # 32bit -destination "platform=iOS Simulator,name=iPad 2,OS=8.1" # 32bit
-destination "platform=iOS Simulator,name=iPad Air,OS=9.2" # 64bit -destination "platform=iOS Simulator,name=iPad Air,OS=9.3" # 64bit
) )
;; ;;
* ) * )
...@@ -243,10 +263,14 @@ if [[ "${DO_XCODE_IOS_TESTS}" == "yes" ]] ; then ...@@ -243,10 +263,14 @@ if [[ "${DO_XCODE_IOS_TESTS}" == "yes" ]] ; then
exit 2 exit 2
;; ;;
esac esac
if [[ "${DO_XCODE_DEBUG}" == "yes" ]] ; then
header "Doing Xcode iOS build/tests - Debug" header "Doing Xcode iOS build/tests - Debug"
"${XCODEBUILD_TEST_BASE_IOS[@]}" -configuration Debug test "${XCODEBUILD_TEST_BASE_IOS[@]}" -configuration Debug test
fi
if [[ "${DO_XCODE_RELEASE}" == "yes" ]] ; then
header "Doing Xcode iOS build/tests - Release" header "Doing Xcode iOS build/tests - Release"
"${XCODEBUILD_TEST_BASE_IOS[@]}" -configuration Release test "${XCODEBUILD_TEST_BASE_IOS[@]}" -configuration Release test
fi
# Don't leave the simulator in the developer's face. # Don't leave the simulator in the developer's face.
killall "${IOS_SIMULATOR_NAME}" killall "${IOS_SIMULATOR_NAME}"
fi fi
...@@ -258,13 +282,18 @@ if [[ "${DO_XCODE_OSX_TESTS}" == "yes" ]] ; then ...@@ -258,13 +282,18 @@ if [[ "${DO_XCODE_OSX_TESTS}" == "yes" ]] ; then
# Since the ObjC 2.0 Runtime is required, 32bit OS X isn't supported. # Since the ObjC 2.0 Runtime is required, 32bit OS X isn't supported.
-destination "platform=OS X,arch=x86_64" # 64bit -destination "platform=OS X,arch=x86_64" # 64bit
) )
if [[ "${DO_XCODE_DEBUG}" == "yes" ]] ; then
header "Doing Xcode OS X build/tests - Debug" header "Doing Xcode OS X build/tests - Debug"
"${XCODEBUILD_TEST_BASE_OSX[@]}" -configuration Debug test "${XCODEBUILD_TEST_BASE_OSX[@]}" -configuration Debug test
fi
if [[ "${DO_XCODE_RELEASE}" == "yes" ]] ; then
header "Doing Xcode OS X build/tests - Release" header "Doing Xcode OS X build/tests - Release"
"${XCODEBUILD_TEST_BASE_OSX[@]}" -configuration Release test "${XCODEBUILD_TEST_BASE_OSX[@]}" -configuration Release test
fi
fi fi
if [[ "${DO_OBJC_CONFORMANCE_TESTS}" == "yes" ]] ; then if [[ "${DO_OBJC_CONFORMANCE_TESTS}" == "yes" ]] ; then
header "Running ObjC Conformance Tests"
cd conformance cd conformance
wrapped_make -j "${NUM_MAKE_JOBS}" test_objc wrapped_make -j "${NUM_MAKE_JOBS}" test_objc
cd .. cd ..
......
...@@ -44,14 +44,33 @@ ...@@ -44,14 +44,33 @@
#import "GPBWellKnownTypes.h" #import "GPBWellKnownTypes.h"
#import "GPBWireFormat.h" #import "GPBWireFormat.h"
// This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
// Well-known proto types // Well-known proto types
#import "google/protobuf/Any.pbobjc.h" #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import "google/protobuf/Api.pbobjc.h" #import <Protobuf/Any.pbobjc.h>
#import "google/protobuf/Duration.pbobjc.h" #import <Protobuf/Api.pbobjc.h>
#import "google/protobuf/Empty.pbobjc.h" #import <Protobuf/Duration.pbobjc.h>
#import "google/protobuf/FieldMask.pbobjc.h" #import <Protobuf/Empty.pbobjc.h>
#import "google/protobuf/SourceContext.pbobjc.h" #import <Protobuf/FieldMask.pbobjc.h>
#import "google/protobuf/Struct.pbobjc.h" #import <Protobuf/SourceContext.pbobjc.h>
#import "google/protobuf/Timestamp.pbobjc.h" #import <Protobuf/Struct.pbobjc.h>
#import "google/protobuf/Type.pbobjc.h" #import <Protobuf/Timestamp.pbobjc.h>
#import "google/protobuf/Wrappers.pbobjc.h" #import <Protobuf/Type.pbobjc.h>
#import <Protobuf/Wrappers.pbobjc.h>
#else
#import "google/protobuf/Any.pbobjc.h"
#import "google/protobuf/Api.pbobjc.h"
#import "google/protobuf/Duration.pbobjc.h"
#import "google/protobuf/Empty.pbobjc.h"
#import "google/protobuf/FieldMask.pbobjc.h"
#import "google/protobuf/SourceContext.pbobjc.h"
#import "google/protobuf/Struct.pbobjc.h"
#import "google/protobuf/Timestamp.pbobjc.h"
#import "google/protobuf/Type.pbobjc.h"
#import "google/protobuf/Wrappers.pbobjc.h"
#endif
...@@ -30,8 +30,19 @@ ...@@ -30,8 +30,19 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "google/protobuf/Duration.pbobjc.h" // This CPP symbol can be defined to use imports that match up to the framework
#import "google/protobuf/Timestamp.pbobjc.h" // imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/Duration.pbobjc.h>
#import <Protobuf/Timestamp.pbobjc.h>
#else
#import "google/protobuf/Duration.pbobjc.h"
#import "google/protobuf/Timestamp.pbobjc.h"
#endif
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
......
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:OSXCocoaPodsTester.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F4D5A0A81CEE2D8F00562D79"
BuildableName = "OSXCocoaPodsTester.app"
BlueprintName = "OSXCocoaPodsTester"
ReferencedContainer = "container:OSXCocoaPodsTester.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F4D5A0A81CEE2D8F00562D79"
BuildableName = "OSXCocoaPodsTester.app"
BlueprintName = "OSXCocoaPodsTester"
ReferencedContainer = "container:OSXCocoaPodsTester.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F4D5A0A81CEE2D8F00562D79"
BuildableName = "OSXCocoaPodsTester.app"
BlueprintName = "OSXCocoaPodsTester"
ReferencedContainer = "container:OSXCocoaPodsTester.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F4D5A0A81CEE2D8F00562D79"
BuildableName = "OSXCocoaPodsTester.app"
BlueprintName = "OSXCocoaPodsTester"
ReferencedContainer = "container:OSXCocoaPodsTester.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
// Protocol Buffers - Google's data interchange format
// Copyright 2016 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <Cocoa/Cocoa.h>
@interface AppDelegate : NSObject <NSApplicationDelegate>
@end
// Protocol Buffers - Google's data interchange format
// Copyright 2016 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import "AppDelegate.h"
@interface AppDelegate ()
@property (weak) IBOutlet NSWindow *window;
@end
@implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
}
- (void)applicationWillTerminate:(NSNotification *)aNotification {
// Insert code here to tear down your application
}
@end
{
"images" : [
{
"idiom" : "mac",
"size" : "16x16",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "16x16",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "32x32",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "32x32",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "128x128",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "128x128",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "256x256",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "256x256",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "512x512",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "512x512",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2016 Google. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
// Protocol Buffers - Google's data interchange format
// Copyright 2016 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <Cocoa/Cocoa.h>
int main(int argc, const char * argv[]) {
return NSApplicationMain(argc, argv);
}
source 'https://github.com/CocoaPods/Specs.git'
platform :osx, '10.9'
install! 'cocoapods', :deterministic_uuids => false
use_frameworks!
target 'OSXCocoaPodsTester' do
pod 'Protobuf', :path => '../../../..'
end
source 'https://github.com/CocoaPods/Specs.git'
platform :osx, '10.9'
install! 'cocoapods', :deterministic_uuids => false
target 'OSXCocoaPodsTester' do
pod 'Protobuf', :path => '../../../..'
end
CocoaPods Protocol Buffers Integration Tests
============================================
The sub directories are the basic projects as created by Xcode 6.3. They are
used to then drive `pod` and `xcodebuild` to ensure things integrate/build
as expected.
`run_tests.sh` defaults to running all the tests, invoke it with `--help` to
see the arguments to control what tests are run.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
install! 'cocoapods', :deterministic_uuids => false
use_frameworks!
target 'iOSCocoaPodsTester' do
pod 'Protobuf', :path => '../../../..'
end
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
install! 'cocoapods', :deterministic_uuids => false
target 'iOSCocoaPodsTester' do
pod 'Protobuf', :path => '../../../..'
end
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:iOSCocoaPodsTester.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F4D5A0851CEE01E200562D79"
BuildableName = "iOSCocoaPodsTester.app"
BlueprintName = "iOSCocoaPodsTester"
ReferencedContainer = "container:iOSCocoaPodsTester.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F4D5A0851CEE01E200562D79"
BuildableName = "iOSCocoaPodsTester.app"
BlueprintName = "iOSCocoaPodsTester"
ReferencedContainer = "container:iOSCocoaPodsTester.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F4D5A0851CEE01E200562D79"
BuildableName = "iOSCocoaPodsTester.app"
BlueprintName = "iOSCocoaPodsTester"
ReferencedContainer = "container:iOSCocoaPodsTester.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F4D5A0851CEE01E200562D79"
BuildableName = "iOSCocoaPodsTester.app"
BlueprintName = "iOSCocoaPodsTester"
ReferencedContainer = "container:iOSCocoaPodsTester.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
// Protocol Buffers - Google's data interchange format
// Copyright 2016 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
// Protocol Buffers - Google's data interchange format
// Copyright 2016 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import "AppDelegate.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
- (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@end
{
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
// Protocol Buffers - Google's data interchange format
// Copyright 2016 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
// Protocol Buffers - Google's data interchange format
// Copyright 2016 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
//
// Protocol Buffers - Google's data interchange format
// Copyright 2016 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
#!/bin/bash
#
# Helper to run the pods tests.
set -eu
readonly ScriptDir=$(dirname "$(echo $0 | sed -e "s,^\([^/]\),$(pwd)/\1,")")
printUsage() {
NAME=$(basename "${0}")
cat << EOF
usage: ${NAME} [OPTIONS]
This script runs some test to check the CocoaPods integration.
OPTIONS:
General:
-h, --help
Show this message
--skip-static
Skip the static based pods tests.
--skip-framework
Skip the framework based pods tests.
--skip-ios
Skip the iOS pods tests.
--skip-osx
Skip the OS X pods tests.
EOF
}
TEST_MODES=( "static" "framework" )
TEST_NAMES=( "iOSCocoaPodsTester" "OSXCocoaPodsTester" )
while [[ $# != 0 ]]; do
case "${1}" in
-h | --help )
printUsage
exit 0
;;
--skip-static )
TEST_MODES=(${TEST_MODES[@]/static})
;;
--skip-framework )
TEST_MODES=(${TEST_MODES[@]/framework})
;;
--skip-ios )
TEST_NAMES=(${TEST_NAMES[@]/iOSCocoaPodsTester})
;;
--skip-osx )
TEST_NAMES=(${TEST_NAMES[@]/OSXCocoaPodsTester})
;;
-*)
echo "ERROR: Unknown option: ${1}" 1>&2
printUsage
exit 1
;;
*)
echo "ERROR: Unknown argument: ${1}" 1>&2
printUsage
exit 1
;;
esac
shift
done
# Sanity check.
if [[ "${#TEST_NAMES[@]}" == 0 ]] ; then
echo "ERROR: Need to run at least iOS or OS X tests." 1>&2
exit 2
fi
if [[ "${#TEST_MODES[@]}" == 0 ]] ; then
echo "ERROR: Need to run at least static or frameworks tests." 1>&2
exit 2
fi
header() {
echo ""
echo "========================================================================"
echo " ${@}"
echo "========================================================================"
echo ""
}
# Cleanup hook for do_test, assumes directory is correct.
cleanup() {
local TEST_NAME="$1"
echo "Cleaning up..."
# Generally don't let things fail, and eat common stdout, but let stderr show
# incase something does hiccup.
xcodebuild -workspace "${TEST_NAME}.xcworkspace" -scheme "${TEST_NAME}" clean > /dev/null || true
pod deintegrate > /dev/null || true
# Flush the cache so nothing is left behind.
pod cache clean --all || true
# Delete the files left after pod deintegrate.
rm -f Podfile.lock || true
rm -rf "${TEST_NAME}.xcworkspace" || true
git checkout -- "${TEST_NAME}.xcodeproj" || true
# Remove the Podfile that was put in place.
rm -f Podfile || true
}
do_test() {
local TEST_NAME="$1"
local TEST_MODE="$2"
header "${TEST_NAME}" - Mode: "${TEST_MODE}"
cd "${ScriptDir}/${TEST_NAME}"
# Hook in cleanup for any failures.
trap "cleanup ${TEST_NAME}" EXIT
# Ensure nothing is cached by pods to start with that could throw things off.
pod cache clean --all
# Put the right Podfile in place.
cp -f "Podfile-${TEST_MODE}" "Podfile"
# Do the work!
pod install --verbose
xcodebuild -workspace "${TEST_NAME}.xcworkspace" -scheme "${TEST_NAME}" build
# Clear the hook and manually run cleanup.
trap - EXIT
cleanup "${TEST_NAME}"
}
# Run the tests.
for TEST_NAME in "${TEST_NAMES[@]}" ; do
for TEST_MODE in "${TEST_MODES[@]}" ; do
do_test "${TEST_NAME}" "${TEST_MODE}"
done
done
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
syntax = "proto2"; syntax = "proto2";
import "google/protobuf/any.proto";
import "google/protobuf/unittest.proto"; import "google/protobuf/unittest.proto";
package protobuf_unittest; package protobuf_unittest;
...@@ -447,3 +448,11 @@ message BoolOnlyMessage { ...@@ -447,3 +448,11 @@ message BoolOnlyMessage {
optional bool bool_field_31 = 31; optional bool bool_field_31 = 31;
optional bool bool_field_32 = 32; optional bool bool_field_32 = 32;
} }
// Reference to a WKT to test (via generated code inspection), the handling
// of #imports. Within the WKTs, references to each other are just path
// based imports, but when reference from another proto file, they should be
// conditional to support the framework import style.
message WKTRefereceMessage {
optional google.protobuf.Any an_any = 1;
}
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/any.proto // source: google/protobuf/any.proto
#import "GPBProtocolBuffers.h" // This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers.h>
#else
#import "GPBProtocolBuffers.h"
#endif
#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001 #if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001
#error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources. #error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources.
......
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/any.proto // source: google/protobuf/any.proto
#import "GPBProtocolBuffers_RuntimeSupport.h" // This CPP symbol can be defined to use imports that match up to the framework
#import "google/protobuf/Any.pbobjc.h" // imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
#else
#import "GPBProtocolBuffers_RuntimeSupport.h"
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/Any.pbobjc.h>
#else
#import "google/protobuf/Any.pbobjc.h"
#endif
// @@protoc_insertion_point(imports) // @@protoc_insertion_point(imports)
#pragma clang diagnostic push #pragma clang diagnostic push
......
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/api.proto // source: google/protobuf/api.proto
#import "GPBProtocolBuffers.h" // This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers.h>
#else
#import "GPBProtocolBuffers.h"
#endif
#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001 #if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001
#error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources. #error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources.
......
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/api.proto // source: google/protobuf/api.proto
#import "GPBProtocolBuffers_RuntimeSupport.h" // This CPP symbol can be defined to use imports that match up to the framework
#import "google/protobuf/Api.pbobjc.h" // imports needed when using CocoaPods.
#import "google/protobuf/SourceContext.pbobjc.h" #if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#import "google/protobuf/Type.pbobjc.h" #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
#else
#import "GPBProtocolBuffers_RuntimeSupport.h"
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/Api.pbobjc.h>
#import <Protobuf/SourceContext.pbobjc.h>
#import <Protobuf/Type.pbobjc.h>
#else
#import "google/protobuf/Api.pbobjc.h"
#import "google/protobuf/SourceContext.pbobjc.h"
#import "google/protobuf/Type.pbobjc.h"
#endif
// @@protoc_insertion_point(imports) // @@protoc_insertion_point(imports)
#pragma clang diagnostic push #pragma clang diagnostic push
......
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/duration.proto // source: google/protobuf/duration.proto
#import "GPBProtocolBuffers.h" // This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers.h>
#else
#import "GPBProtocolBuffers.h"
#endif
#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001 #if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001
#error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources. #error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources.
......
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/duration.proto // source: google/protobuf/duration.proto
#import "GPBProtocolBuffers_RuntimeSupport.h" // This CPP symbol can be defined to use imports that match up to the framework
#import "google/protobuf/Duration.pbobjc.h" // imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
#else
#import "GPBProtocolBuffers_RuntimeSupport.h"
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/Duration.pbobjc.h>
#else
#import "google/protobuf/Duration.pbobjc.h"
#endif
// @@protoc_insertion_point(imports) // @@protoc_insertion_point(imports)
#pragma clang diagnostic push #pragma clang diagnostic push
......
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/empty.proto // source: google/protobuf/empty.proto
#import "GPBProtocolBuffers.h" // This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers.h>
#else
#import "GPBProtocolBuffers.h"
#endif
#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001 #if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001
#error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources. #error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources.
......
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/empty.proto // source: google/protobuf/empty.proto
#import "GPBProtocolBuffers_RuntimeSupport.h" // This CPP symbol can be defined to use imports that match up to the framework
#import "google/protobuf/Empty.pbobjc.h" // imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
#else
#import "GPBProtocolBuffers_RuntimeSupport.h"
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/Empty.pbobjc.h>
#else
#import "google/protobuf/Empty.pbobjc.h"
#endif
// @@protoc_insertion_point(imports) // @@protoc_insertion_point(imports)
#pragma clang diagnostic push #pragma clang diagnostic push
......
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/field_mask.proto // source: google/protobuf/field_mask.proto
#import "GPBProtocolBuffers.h" // This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers.h>
#else
#import "GPBProtocolBuffers.h"
#endif
#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001 #if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001
#error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources. #error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources.
......
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/field_mask.proto // source: google/protobuf/field_mask.proto
#import "GPBProtocolBuffers_RuntimeSupport.h" // This CPP symbol can be defined to use imports that match up to the framework
#import "google/protobuf/FieldMask.pbobjc.h" // imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
#else
#import "GPBProtocolBuffers_RuntimeSupport.h"
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/FieldMask.pbobjc.h>
#else
#import "google/protobuf/FieldMask.pbobjc.h"
#endif
// @@protoc_insertion_point(imports) // @@protoc_insertion_point(imports)
#pragma clang diagnostic push #pragma clang diagnostic push
......
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/source_context.proto // source: google/protobuf/source_context.proto
#import "GPBProtocolBuffers.h" // This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers.h>
#else
#import "GPBProtocolBuffers.h"
#endif
#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001 #if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001
#error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources. #error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources.
......
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/source_context.proto // source: google/protobuf/source_context.proto
#import "GPBProtocolBuffers_RuntimeSupport.h" // This CPP symbol can be defined to use imports that match up to the framework
#import "google/protobuf/SourceContext.pbobjc.h" // imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
#else
#import "GPBProtocolBuffers_RuntimeSupport.h"
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/SourceContext.pbobjc.h>
#else
#import "google/protobuf/SourceContext.pbobjc.h"
#endif
// @@protoc_insertion_point(imports) // @@protoc_insertion_point(imports)
#pragma clang diagnostic push #pragma clang diagnostic push
......
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/struct.proto // source: google/protobuf/struct.proto
#import "GPBProtocolBuffers.h" // This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers.h>
#else
#import "GPBProtocolBuffers.h"
#endif
#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001 #if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001
#error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources. #error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources.
......
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/struct.proto // source: google/protobuf/struct.proto
#import "GPBProtocolBuffers_RuntimeSupport.h" // This CPP symbol can be defined to use imports that match up to the framework
#import "google/protobuf/Struct.pbobjc.h" // imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
#else
#import "GPBProtocolBuffers_RuntimeSupport.h"
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/Struct.pbobjc.h>
#else
#import "google/protobuf/Struct.pbobjc.h"
#endif
// @@protoc_insertion_point(imports) // @@protoc_insertion_point(imports)
#pragma clang diagnostic push #pragma clang diagnostic push
......
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/timestamp.proto // source: google/protobuf/timestamp.proto
#import "GPBProtocolBuffers.h" // This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers.h>
#else
#import "GPBProtocolBuffers.h"
#endif
#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001 #if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001
#error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources. #error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources.
......
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/timestamp.proto // source: google/protobuf/timestamp.proto
#import "GPBProtocolBuffers_RuntimeSupport.h" // This CPP symbol can be defined to use imports that match up to the framework
#import "google/protobuf/Timestamp.pbobjc.h" // imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
#else
#import "GPBProtocolBuffers_RuntimeSupport.h"
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/Timestamp.pbobjc.h>
#else
#import "google/protobuf/Timestamp.pbobjc.h"
#endif
// @@protoc_insertion_point(imports) // @@protoc_insertion_point(imports)
#pragma clang diagnostic push #pragma clang diagnostic push
......
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/type.proto // source: google/protobuf/type.proto
#import "GPBProtocolBuffers.h" // This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers.h>
#else
#import "GPBProtocolBuffers.h"
#endif
#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001 #if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001
#error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources. #error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources.
......
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/type.proto // source: google/protobuf/type.proto
#import "GPBProtocolBuffers_RuntimeSupport.h" // This CPP symbol can be defined to use imports that match up to the framework
#import "google/protobuf/Type.pbobjc.h" // imports needed when using CocoaPods.
#import "google/protobuf/Any.pbobjc.h" #if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#import "google/protobuf/SourceContext.pbobjc.h" #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
#else
#import "GPBProtocolBuffers_RuntimeSupport.h"
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/Type.pbobjc.h>
#import <Protobuf/Any.pbobjc.h>
#import <Protobuf/SourceContext.pbobjc.h>
#else
#import "google/protobuf/Type.pbobjc.h"
#import "google/protobuf/Any.pbobjc.h"
#import "google/protobuf/SourceContext.pbobjc.h"
#endif
// @@protoc_insertion_point(imports) // @@protoc_insertion_point(imports)
#pragma clang diagnostic push #pragma clang diagnostic push
......
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/wrappers.proto // source: google/protobuf/wrappers.proto
#import "GPBProtocolBuffers.h" // This CPP symbol can be defined to use imports that match up to the framework
// imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers.h>
#else
#import "GPBProtocolBuffers.h"
#endif
#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001 #if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001
#error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources. #error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources.
......
// Generated by the protocol buffer compiler. DO NOT EDIT! // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/wrappers.proto // source: google/protobuf/wrappers.proto
#import "GPBProtocolBuffers_RuntimeSupport.h" // This CPP symbol can be defined to use imports that match up to the framework
#import "google/protobuf/Wrappers.pbobjc.h" // imports needed when using CocoaPods.
#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
#define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
#else
#import "GPBProtocolBuffers_RuntimeSupport.h"
#endif
#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
#import <Protobuf/Wrappers.pbobjc.h>
#else
#import "google/protobuf/Wrappers.pbobjc.h"
#endif
// @@protoc_insertion_point(imports) // @@protoc_insertion_point(imports)
#pragma clang diagnostic push #pragma clang diagnostic push
......
...@@ -50,6 +50,80 @@ const int32 GOOGLE_PROTOBUF_OBJC_GEN_VERSION = 30001; ...@@ -50,6 +50,80 @@ const int32 GOOGLE_PROTOBUF_OBJC_GEN_VERSION = 30001;
namespace compiler { namespace compiler {
namespace objectivec { namespace objectivec {
namespace {
class ImportWriter {
public:
ImportWriter() {}
void AddFile(const FileGenerator* file);
void Print(io::Printer *printer) const;
private:
vector<string> protobuf_framework_imports_;
vector<string> protobuf_non_framework_imports_;
vector<string> other_imports_;
};
void ImportWriter::AddFile(const FileGenerator* file) {
const FileDescriptor* file_descriptor = file->Descriptor();
const string extension(".pbobjc.h");
if (IsProtobufLibraryBundledProtoFile(file_descriptor)) {
protobuf_framework_imports_.push_back(
FilePathBasename(file_descriptor) + extension);
protobuf_non_framework_imports_.push_back(file->Path() + extension);
} else {
other_imports_.push_back(file->Path() + extension);
}
}
void ImportWriter::Print(io::Printer *printer) const {
assert(protobuf_non_framework_imports_.size() ==
protobuf_framework_imports_.size());
if (protobuf_framework_imports_.size() > 0) {
const string framework_name(ProtobufLibraryFrameworkName);
const string cpp_symbol(ProtobufFrameworkImportSymbol(framework_name));
printer->Print(
"#if $cpp_symbol$\n",
"cpp_symbol", cpp_symbol);
for (vector<string>::const_iterator iter = protobuf_framework_imports_.begin();
iter != protobuf_framework_imports_.end(); ++iter) {
printer->Print(
" #import <$framework_name$/$header$>\n",
"framework_name", framework_name,
"header", *iter);
}
printer->Print(
"#else\n");
for (vector<string>::const_iterator iter = protobuf_non_framework_imports_.begin();
iter != protobuf_non_framework_imports_.end(); ++iter) {
printer->Print(
" #import \"$header$\"\n",
"header", *iter);
}
printer->Print(
"#endif\n");
if (other_imports_.size() > 0) {
printer->Print("\n");
}
}
if (other_imports_.size() > 0) {
for (vector<string>::const_iterator iter = other_imports_.begin();
iter != other_imports_.end(); ++iter) {
printer->Print(
" #import \"$header$\"\n",
"header", *iter);
}
}
}
} // namespace
FileGenerator::FileGenerator(const FileDescriptor *file, const Options& options) FileGenerator::FileGenerator(const FileDescriptor *file, const Options& options)
: file_(file), : file_(file),
root_class_name_(FileClassName(file)), root_class_name_(FileClassName(file)),
...@@ -82,15 +156,7 @@ FileGenerator::~FileGenerator() { ...@@ -82,15 +156,7 @@ FileGenerator::~FileGenerator() {
} }
void FileGenerator::GenerateHeader(io::Printer *printer) { void FileGenerator::GenerateHeader(io::Printer *printer) {
printer->Print( PrintFilePreamble(printer, "GPBProtocolBuffers.h");
"// Generated by the protocol buffer compiler. DO NOT EDIT!\n"
"// source: $filename$\n"
"\n",
"filename", file_->name());
printer->Print(
"#import \"GPBProtocolBuffers.h\"\n"
"\n");
// Add some verification that the generated code matches the source the // Add some verification that the generated code matches the source the
// code is being compiled with. // code is being compiled with.
...@@ -102,14 +168,18 @@ void FileGenerator::GenerateHeader(io::Printer *printer) { ...@@ -102,14 +168,18 @@ void FileGenerator::GenerateHeader(io::Printer *printer) {
"protoc_gen_objc_version", "protoc_gen_objc_version",
SimpleItoa(GOOGLE_PROTOBUF_OBJC_GEN_VERSION)); SimpleItoa(GOOGLE_PROTOBUF_OBJC_GEN_VERSION));
// #import any headers for "public imports" in the proto file.
{
ImportWriter import_writer;
const vector<FileGenerator *> &dependency_generators = DependencyGenerators(); const vector<FileGenerator *> &dependency_generators = DependencyGenerators();
for (vector<FileGenerator *>::const_iterator iter = for (vector<FileGenerator *>::const_iterator iter =
dependency_generators.begin(); dependency_generators.begin();
iter != dependency_generators.end(); ++iter) { iter != dependency_generators.end(); ++iter) {
if ((*iter)->IsPublicDependency()) { if ((*iter)->IsPublicDependency()) {
printer->Print("#import \"$header$.pbobjc.h\"\n", import_writer.AddFile(*iter);
"header", (*iter)->Path()); }
} }
import_writer.Print(printer);
} }
printer->Print( printer->Print(
...@@ -198,27 +268,30 @@ void FileGenerator::GenerateHeader(io::Printer *printer) { ...@@ -198,27 +268,30 @@ void FileGenerator::GenerateHeader(io::Printer *printer) {
} }
void FileGenerator::GenerateSource(io::Printer *printer) { void FileGenerator::GenerateSource(io::Printer *printer) {
printer->Print( // #import the runtime support.
"// Generated by the protocol buffer compiler. DO NOT EDIT!\n" PrintFilePreamble(printer, "GPBProtocolBuffers_RuntimeSupport.h");
"// source: $filename$\n"
"\n",
"filename", file_->name());
string header_file = Path() + ".pbobjc.h"; {
printer->Print( ImportWriter import_writer;
"#import \"GPBProtocolBuffers_RuntimeSupport.h\"\n"
"#import \"$header_file$\"\n", // #import the header for this proto file.
"header_file", header_file); import_writer.AddFile(this);
// #import the headers for anything that a plain dependency of this proto
// file (that means they were just an include, not a "public" include).
const vector<FileGenerator *> &dependency_generators = const vector<FileGenerator *> &dependency_generators =
DependencyGenerators(); DependencyGenerators();
for (vector<FileGenerator *>::const_iterator iter = for (vector<FileGenerator *>::const_iterator iter =
dependency_generators.begin(); dependency_generators.begin();
iter != dependency_generators.end(); ++iter) { iter != dependency_generators.end(); ++iter) {
if (!(*iter)->IsPublicDependency()) { if (!(*iter)->IsPublicDependency()) {
printer->Print("#import \"$header$.pbobjc.h\"\n", import_writer.AddFile(*iter);
"header", (*iter)->Path());
} }
} }
import_writer.Print(printer);
}
printer->Print( printer->Print(
"// @@protoc_insertion_point(imports)\n" "// @@protoc_insertion_point(imports)\n"
"\n" "\n"
...@@ -356,8 +429,6 @@ void FileGenerator::GenerateSource(io::Printer *printer) { ...@@ -356,8 +429,6 @@ void FileGenerator::GenerateSource(io::Printer *printer) {
"// @@protoc_insertion_point(global_scope)\n"); "// @@protoc_insertion_point(global_scope)\n");
} }
const string FileGenerator::Path() const { return FilePath(file_); }
const vector<FileGenerator *> &FileGenerator::DependencyGenerators() { const vector<FileGenerator *> &FileGenerator::DependencyGenerators() {
if (file_->dependency_count() != dependency_generators_.size()) { if (file_->dependency_count() != dependency_generators_.size()) {
set<string> public_import_names; set<string> public_import_names;
...@@ -376,6 +447,34 @@ const vector<FileGenerator *> &FileGenerator::DependencyGenerators() { ...@@ -376,6 +447,34 @@ const vector<FileGenerator *> &FileGenerator::DependencyGenerators() {
return dependency_generators_; return dependency_generators_;
} }
void FileGenerator::PrintFilePreamble(
io::Printer* printer, const string& header_to_import) const {
printer->Print(
"// Generated by the protocol buffer compiler. DO NOT EDIT!\n"
"// source: $filename$\n"
"\n",
"filename", file_->name());
const string framework_name(ProtobufLibraryFrameworkName);
const string cpp_symbol(ProtobufFrameworkImportSymbol(framework_name));
printer->Print(
"// This CPP symbol can be defined to use imports that match up to the framework\n"
"// imports needed when using CocoaPods.\n"
"#if !defined($cpp_symbol$)\n"
" #define $cpp_symbol$ 0\n"
"#endif\n"
"\n"
"#if $cpp_symbol$\n"
" #import <$framework_name$/$header$>\n"
"#else\n"
" #import \"$header$\"\n"
"#endif\n"
"\n",
"cpp_symbol", cpp_symbol,
"header", header_to_import,
"framework_name", framework_name);
}
} // namespace objectivec } // namespace objectivec
} // namespace compiler } // namespace compiler
} // namespace protobuf } // namespace protobuf
......
...@@ -62,7 +62,8 @@ class FileGenerator { ...@@ -62,7 +62,8 @@ class FileGenerator {
void GenerateHeader(io::Printer* printer); void GenerateHeader(io::Printer* printer);
const string& RootClassName() const { return root_class_name_; } const string& RootClassName() const { return root_class_name_; }
const string Path() const; const string Path() const { return FilePath(file_); }
const FileDescriptor* Descriptor() const { return file_; }
bool IsPublicDependency() const { return is_public_dep_; } bool IsPublicDependency() const { return is_public_dep_; }
...@@ -87,6 +88,8 @@ class FileGenerator { ...@@ -87,6 +88,8 @@ class FileGenerator {
const Options options_; const Options options_;
const vector<FileGenerator*>& DependencyGenerators(); const vector<FileGenerator*>& DependencyGenerators();
void PrintFilePreamble(
io::Printer* printer, const string& header_to_import) const;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FileGenerator); GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FileGenerator);
}; };
......
...@@ -293,13 +293,6 @@ string BaseFileName(const FileDescriptor* file) { ...@@ -293,13 +293,6 @@ string BaseFileName(const FileDescriptor* file) {
return basename; return basename;
} }
string FileName(const FileDescriptor* file) {
string path = FilePath(file);
string basename;
PathSplit(path, NULL, &basename);
return basename;
}
string FilePath(const FileDescriptor* file) { string FilePath(const FileDescriptor* file) {
string output; string output;
string basename; string basename;
...@@ -317,6 +310,19 @@ string FilePath(const FileDescriptor* file) { ...@@ -317,6 +310,19 @@ string FilePath(const FileDescriptor* file) {
return output; return output;
} }
string FilePathBasename(const FileDescriptor* file) {
string output;
string basename;
string directory;
PathSplit(file->name(), &directory, &basename);
basename = StripProto(basename);
// CamelCase to be more ObjC friendly.
output = UnderscoresToCamelCase(basename, true);
return output;
}
string FileClassPrefix(const FileDescriptor* file) { string FileClassPrefix(const FileDescriptor* file) {
// Default is empty string, no need to check has_objc_class_prefix. // Default is empty string, no need to check has_objc_class_prefix.
string result = file->options().objc_class_prefix(); string result = file->options().objc_class_prefix();
...@@ -831,6 +837,40 @@ string BuildCommentsString(const SourceLocation& location) { ...@@ -831,6 +837,40 @@ string BuildCommentsString(const SourceLocation& location) {
return final_comments; return final_comments;
} }
// Making these a generator option for folks that don't use CocoaPods, but do
// want to put the library in a framework is an interesting question. The
// problem is it means changing sources shipped with the library to actually
// use a different value; so it isn't as simple as a option.
const char* const ProtobufLibraryFrameworkName = "Protobuf";
string ProtobufFrameworkImportSymbol(const string& framework_name) {
// GPB_USE_[framework_name]_FRAMEWORK_IMPORTS
string result = string("GPB_USE_");
result += ToUpper(framework_name);
result += "_FRAMEWORK_IMPORTS";
return result;
}
bool IsProtobufLibraryBundledProtoFile(const FileDescriptor* file) {
// We don't check the name prefix or proto package because some files
// (descriptor.proto), aren't shipped generated by the library, so this
// seems to be the safest way to only catch the ones shipped.
const string name = file->name();
if (name == "google/protobuf/any.proto" ||
name == "google/protobuf/api.proto" ||
name == "google/protobuf/duration.proto" ||
name == "google/protobuf/empty.proto" ||
name == "google/protobuf/field_mask.proto" ||
name == "google/protobuf/source_context.proto" ||
name == "google/protobuf/struct.proto" ||
name == "google/protobuf/timestamp.proto" ||
name == "google/protobuf/type.proto" ||
name == "google/protobuf/wrappers.proto") {
return true;
}
return false;
}
namespace { namespace {
// Internal helper class that parses the expected package to prefix mappings // Internal helper class that parses the expected package to prefix mappings
......
...@@ -62,15 +62,14 @@ bool IsRetainedName(const string& name); ...@@ -62,15 +62,14 @@ bool IsRetainedName(const string& name);
// handling under ARC. // handling under ARC.
bool IsInitName(const string& name); bool IsInitName(const string& name);
// Gets the name of the file we're going to generate (sans the .pb.h
// extension). This does not include the path to that file.
string FileName(const FileDescriptor* file);
// Gets the path of the file we're going to generate (sans the .pb.h // Gets the path of the file we're going to generate (sans the .pb.h
// extension). The path will be dependent on the objectivec package // extension). The path will be dependent on the objectivec package
// declared in the proto package. // declared in the proto package.
string FilePath(const FileDescriptor* file); string FilePath(const FileDescriptor* file);
// Just like FilePath(), but without the directory part.
string FilePathBasename(const FileDescriptor* file);
// Gets the name of the root class we'll generate in the file. This class // Gets the name of the root class we'll generate in the file. This class
// is not meant for external consumption, but instead contains helpers that // is not meant for external consumption, but instead contains helpers that
// the rest of the classes need // the rest of the classes need
...@@ -169,6 +168,16 @@ string BuildFlagsString(const vector<string>& strings); ...@@ -169,6 +168,16 @@ string BuildFlagsString(const vector<string>& strings);
// Builds a HeaderDoc style comment out of the comments in the .proto file. // Builds a HeaderDoc style comment out of the comments in the .proto file.
string BuildCommentsString(const SourceLocation& location); string BuildCommentsString(const SourceLocation& location);
// The name the commonly used by the library when built as a framework.
// This lines up to the name used in the CocoaPod.
extern const char* const ProtobufLibraryFrameworkName;
// Returns the CPP symbol name to use as the gate for framework style imports
// for the given framework name to use.
string ProtobufFrameworkImportSymbol(const string& framework_name);
// Checks if the file is one of the proto's bundled with the library.
bool IsProtobufLibraryBundledProtoFile(const FileDescriptor* file);
// Checks the prefix for a given file and outputs any warnings needed, if // Checks the prefix for a given file and outputs any warnings needed, if
// there are flat out errors, then out_error is filled in and the result is // there are flat out errors, then out_error is filled in and the result is
// false. // false.
......
...@@ -197,59 +197,30 @@ internal_install_python_deps() { ...@@ -197,59 +197,30 @@ internal_install_python_deps() {
fi fi
} }
internal_objectivec_common () { build_objectivec_ios() {
# Make sure xctool is up to date. Adapted from
# http://docs.travis-ci.com/user/osx-ci-environment/
# We don't use a before_install because we test multiple OSes.
brew update
brew outdated xctool || brew upgrade xctool
# Reused the build script that takes care of configuring and ensuring things # Reused the build script that takes care of configuring and ensuring things
# are up to date. Xcode and conformance tests will be directly invoked. # are up to date. The OS X test runs the objc conformance test, so skip it
# here.
# Note: travis has xctool installed, and we've looked at using it in the past
# but it has ended up proving unreliable (bugs), an they are removing build
# support in favor of xcbuild (or just xcodebuild).
objectivec/DevTools/full_mac_build.sh \ objectivec/DevTools/full_mac_build.sh \
--core-only --skip-xcode --skip-objc-conformance --core-only --skip-xcode-osx --skip-objc-conformance "$@"
} }
internal_xctool_debug_and_release() { build_objectivec_ios_debug() {
# Always use -reporter plain to avoid escape codes in output (makes travis build_objectivec_ios --skip-xcode-release
# logs easier to read).
xctool -reporter plain -configuration Debug "$@"
xctool -reporter plain -configuration Release "$@"
} }
build_objectivec_ios() { build_objectivec_ios_release() {
internal_objectivec_common build_objectivec_ios --skip-xcode-debug
# https://github.com/facebook/xctool/issues/509 - unlike xcodebuild, xctool
# doesn't support >1 destination, so we have to build first and then run the
# tests one destination at a time.
internal_xctool_debug_and_release \
-project objectivec/ProtocolBuffers_iOS.xcodeproj \
-scheme ProtocolBuffers \
-sdk iphonesimulator \
build-tests
IOS_DESTINATIONS=(
"platform=iOS Simulator,name=iPhone 4s,OS=8.1" # 32bit
"platform=iOS Simulator,name=iPhone 6,OS=9.2" # 64bit
"platform=iOS Simulator,name=iPad 2,OS=8.1" # 32bit
"platform=iOS Simulator,name=iPad Air,OS=9.2" # 64bit
)
for i in "${IOS_DESTINATIONS[@]}" ; do
internal_xctool_debug_and_release \
-project objectivec/ProtocolBuffers_iOS.xcodeproj \
-scheme ProtocolBuffers \
-sdk iphonesimulator \
-destination "${i}" \
run-tests
done
} }
build_objectivec_osx() { build_objectivec_osx() {
internal_objectivec_common # Reused the build script that takes care of configuring and ensuring things
internal_xctool_debug_and_release \ # are up to date.
-project objectivec/ProtocolBuffers_OSX.xcodeproj \ objectivec/DevTools/full_mac_build.sh \
-scheme ProtocolBuffers \ --core-only --skip-xcode-ios
-destination "platform=OS X,arch=x86_64" \
test
cd conformance && make test_objc && cd ..
} }
build_python() { build_python() {
...@@ -330,6 +301,8 @@ Usage: $0 { cpp | ...@@ -330,6 +301,8 @@ Usage: $0 { cpp |
javanano_jdk7 | javanano_jdk7 |
javanano_oracle7 | javanano_oracle7 |
objectivec_ios | objectivec_ios |
objectivec_ios_debug |
objectivec_ios_release |
objectivec_osx | objectivec_osx |
python | python |
python_cpp | python_cpp |
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment