From d96bcffbbbc10ab3617efef6b45701bdea641bcf Mon Sep 17 00:00:00 2001 From: Eloy Duran Date: Wed, 16 Nov 2011 23:40:56 +0100 Subject: [PATCH] Add an example which builds against a second target and references code. This is more a CI test than an example, though. --- examples/TargetTest/Podfile | 5 + examples/TargetTest/Podfile.lock | 5 + .../TargetTest.xcodeproj/project.pbxproj | 298 ++++++++++++++++++ .../contents.xcworkspacedata | 1 + examples/TargetTest/TargetTest/AppDelegate.h | 15 + examples/TargetTest/TargetTest/AppDelegate.m | 73 +++++ .../TargetTest/TargetTest-Info.plist | 47 +++ .../TargetTest/TargetTest-Prefix.pch | 14 + .../TargetTest/en.lproj/InfoPlist.strings | 2 + examples/TargetTest/TargetTest/main.m | 18 ++ 10 files changed, 478 insertions(+) create mode 100644 examples/TargetTest/Podfile create mode 100644 examples/TargetTest/Podfile.lock create mode 100644 examples/TargetTest/TargetTest.xcodeproj/project.pbxproj create mode 100644 examples/TargetTest/TargetTest.xcworkspace/contents.xcworkspacedata create mode 100644 examples/TargetTest/TargetTest/AppDelegate.h create mode 100644 examples/TargetTest/TargetTest/AppDelegate.m create mode 100644 examples/TargetTest/TargetTest/TargetTest-Info.plist create mode 100644 examples/TargetTest/TargetTest/TargetTest-Prefix.pch create mode 100644 examples/TargetTest/TargetTest/en.lproj/InfoPlist.strings create mode 100644 examples/TargetTest/TargetTest/main.m diff --git a/examples/TargetTest/Podfile b/examples/TargetTest/Podfile new file mode 100644 index 0000000..b5f7764 --- /dev/null +++ b/examples/TargetTest/Podfile @@ -0,0 +1,5 @@ +platform :ios + +target :test, :exclusive => true do + dependency 'JSONKit' +end diff --git a/examples/TargetTest/Podfile.lock b/examples/TargetTest/Podfile.lock new file mode 100644 index 0000000..17f5850 --- /dev/null +++ b/examples/TargetTest/Podfile.lock @@ -0,0 +1,5 @@ +PODS: + - JSONKit (1.4) + +DEPENDENCIES: + - JSONKit diff --git a/examples/TargetTest/TargetTest.xcodeproj/project.pbxproj b/examples/TargetTest/TargetTest.xcodeproj/project.pbxproj new file mode 100644 index 0000000..3979530 --- /dev/null +++ b/examples/TargetTest/TargetTest.xcodeproj/project.pbxproj @@ -0,0 +1,298 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 51887BBB147465E00005EA71 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51887BBA147465E00005EA71 /* UIKit.framework */; }; + 51887BBD147465E00005EA71 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51887BBC147465E00005EA71 /* Foundation.framework */; }; + 51887BBF147465E00005EA71 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51887BBE147465E00005EA71 /* CoreGraphics.framework */; }; + 51887BC5147465E00005EA71 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 51887BC3147465E00005EA71 /* InfoPlist.strings */; }; + 51887BC7147465E00005EA71 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 51887BC6147465E00005EA71 /* main.m */; }; + 51887BCB147465E00005EA71 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 51887BCA147465E00005EA71 /* AppDelegate.m */; }; + 51887BDA1474663A0005EA71 /* libPods-test.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 51887BD91474663A0005EA71 /* libPods-test.a */; }; + 51887BDC1474664E0005EA71 /* Pods-test.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 51887BDB1474664E0005EA71 /* Pods-test.xcconfig */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 51887BB6147465E00005EA71 /* TargetTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TargetTest.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 51887BBA147465E00005EA71 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 51887BBC147465E00005EA71 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 51887BBE147465E00005EA71 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 51887BC2147465E00005EA71 /* TargetTest-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TargetTest-Info.plist"; sourceTree = ""; }; + 51887BC4147465E00005EA71 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 51887BC6147465E00005EA71 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 51887BC8147465E00005EA71 /* TargetTest-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TargetTest-Prefix.pch"; sourceTree = ""; }; + 51887BC9147465E00005EA71 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 51887BCA147465E00005EA71 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 51887BD91474663A0005EA71 /* libPods-test.a */ = {isa = PBXFileReference; lastKnownFileType = file; name = "libPods-test.a"; path = "Pods/build/Release-iphoneos/libPods-test.a"; sourceTree = ""; }; + 51887BDB1474664E0005EA71 /* Pods-test.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "Pods-test.xcconfig"; path = "Pods/Pods-test.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 51887BB3147465E00005EA71 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 51887BDA1474663A0005EA71 /* libPods-test.a in Frameworks */, + 51887BBB147465E00005EA71 /* UIKit.framework in Frameworks */, + 51887BBD147465E00005EA71 /* Foundation.framework in Frameworks */, + 51887BBF147465E00005EA71 /* CoreGraphics.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 51887BAB147465E00005EA71 = { + isa = PBXGroup; + children = ( + 51887BC0147465E00005EA71 /* TargetTest */, + 51887BB9147465E00005EA71 /* Frameworks */, + 51887BB7147465E00005EA71 /* Products */, + 51887BDB1474664E0005EA71 /* Pods-test.xcconfig */, + ); + sourceTree = ""; + }; + 51887BB7147465E00005EA71 /* Products */ = { + isa = PBXGroup; + children = ( + 51887BB6147465E00005EA71 /* TargetTest.app */, + ); + name = Products; + sourceTree = ""; + }; + 51887BB9147465E00005EA71 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 51887BD91474663A0005EA71 /* libPods-test.a */, + 51887BBA147465E00005EA71 /* UIKit.framework */, + 51887BBC147465E00005EA71 /* Foundation.framework */, + 51887BBE147465E00005EA71 /* CoreGraphics.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 51887BC0147465E00005EA71 /* TargetTest */ = { + isa = PBXGroup; + children = ( + 51887BC9147465E00005EA71 /* AppDelegate.h */, + 51887BCA147465E00005EA71 /* AppDelegate.m */, + 51887BC1147465E00005EA71 /* Supporting Files */, + ); + path = TargetTest; + sourceTree = ""; + }; + 51887BC1147465E00005EA71 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 51887BC2147465E00005EA71 /* TargetTest-Info.plist */, + 51887BC3147465E00005EA71 /* InfoPlist.strings */, + 51887BC6147465E00005EA71 /* main.m */, + 51887BC8147465E00005EA71 /* TargetTest-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 51887BB5147465E00005EA71 /* TargetTest */ = { + isa = PBXNativeTarget; + buildConfigurationList = 51887BCE147465E00005EA71 /* Build configuration list for PBXNativeTarget "TargetTest" */; + buildPhases = ( + 51887BB2147465E00005EA71 /* Sources */, + 51887BB3147465E00005EA71 /* Frameworks */, + 51887BB4147465E00005EA71 /* Resources */, + C3CAEFD2AF1E4C6D9240991C /* Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TargetTest; + productName = TargetTest; + productReference = 51887BB6147465E00005EA71 /* TargetTest.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 51887BAD147465E00005EA71 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = 51887BB0147465E00005EA71 /* Build configuration list for PBXProject "TargetTest" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 51887BAB147465E00005EA71; + productRefGroup = 51887BB7147465E00005EA71 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 51887BB5147465E00005EA71 /* TargetTest */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 51887BB4147465E00005EA71 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 51887BC5147465E00005EA71 /* InfoPlist.strings in Resources */, + 51887BDC1474664E0005EA71 /* Pods-test.xcconfig in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + C3CAEFD2AF1E4C6D9240991C /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Pods-resources.sh\"\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 51887BB2147465E00005EA71 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 51887BC7147465E00005EA71 /* main.m in Sources */, + 51887BCB147465E00005EA71 /* AppDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 51887BC3147465E00005EA71 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 51887BC4147465E00005EA71 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 51887BCC147465E00005EA71 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 51887BCD147465E00005EA71 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 51887BCF147465E00005EA71 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 51887BDB1474664E0005EA71 /* Pods-test.xcconfig */; + buildSettings = { + DSTROOT = /tmp/xcodeproj.dst; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "TargetTest/TargetTest-Prefix.pch"; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + INFOPLIST_FILE = "TargetTest/TargetTest-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 51887BD0147465E00005EA71 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 51887BDB1474664E0005EA71 /* Pods-test.xcconfig */; + buildSettings = { + DSTROOT = /tmp/xcodeproj.dst; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "TargetTest/TargetTest-Prefix.pch"; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + INFOPLIST_FILE = "TargetTest/TargetTest-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 51887BB0147465E00005EA71 /* Build configuration list for PBXProject "TargetTest" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 51887BCC147465E00005EA71 /* Debug */, + 51887BCD147465E00005EA71 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 51887BCE147465E00005EA71 /* Build configuration list for PBXNativeTarget "TargetTest" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 51887BCF147465E00005EA71 /* Debug */, + 51887BD0147465E00005EA71 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 51887BAD147465E00005EA71 /* Project object */; +} diff --git a/examples/TargetTest/TargetTest.xcworkspace/contents.xcworkspacedata b/examples/TargetTest/TargetTest.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..13a6131 --- /dev/null +++ b/examples/TargetTest/TargetTest.xcworkspace/contents.xcworkspacedata @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/TargetTest/TargetTest/AppDelegate.h b/examples/TargetTest/TargetTest/AppDelegate.h new file mode 100644 index 0000000..9fed068 --- /dev/null +++ b/examples/TargetTest/TargetTest/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// TargetTest +// +// Created by Eloy Duran on 16-11-11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/examples/TargetTest/TargetTest/AppDelegate.m b/examples/TargetTest/TargetTest/AppDelegate.m new file mode 100644 index 0000000..4c7d45e --- /dev/null +++ b/examples/TargetTest/TargetTest/AppDelegate.m @@ -0,0 +1,73 @@ +// +// AppDelegate.m +// TargetTest +// +// Created by Eloy Duran on 16-11-11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "AppDelegate.h" +#import "JSONKit.h" + +@implementation AppDelegate + +@synthesize window = _window; + +- (void)dealloc +{ + [_window release]; + [super dealloc]; +} + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; + // Override point for customization after application launch. + self.window.backgroundColor = [UIColor whiteColor]; + [self.window makeKeyAndVisible]; + + [JSONDecoder class]; + + 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 diff --git a/examples/TargetTest/TargetTest/TargetTest-Info.plist b/examples/TargetTest/TargetTest/TargetTest-Info.plist new file mode 100644 index 0000000..e7e4f5b --- /dev/null +++ b/examples/TargetTest/TargetTest/TargetTest-Info.plist @@ -0,0 +1,47 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFiles + + CFBundleIdentifier + org.cocoapods.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/examples/TargetTest/TargetTest/TargetTest-Prefix.pch b/examples/TargetTest/TargetTest/TargetTest-Prefix.pch new file mode 100644 index 0000000..dea0d72 --- /dev/null +++ b/examples/TargetTest/TargetTest/TargetTest-Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'TargetTest' target in the 'TargetTest' project +// + +#import + +#ifndef __IPHONE_3_0 +#warning "This project uses features only available in iOS SDK 3.0 and later." +#endif + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/examples/TargetTest/TargetTest/en.lproj/InfoPlist.strings b/examples/TargetTest/TargetTest/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/examples/TargetTest/TargetTest/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/examples/TargetTest/TargetTest/main.m b/examples/TargetTest/TargetTest/main.m new file mode 100644 index 0000000..7d4ee1a --- /dev/null +++ b/examples/TargetTest/TargetTest/main.m @@ -0,0 +1,18 @@ +// +// main.m +// TargetTest +// +// Created by Eloy Duran on 16-11-11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import + +#import "AppDelegate.h" + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +}