├── .gitignore ├── README.mdown ├── gfx ├── addbundle.png ├── addtarget.png ├── aggregatetarget.png ├── buildphase1.png ├── bundlecopy.png ├── bundledependency.png ├── bundledependency2.png ├── bundlesettings.png ├── delete_combine_hidpi.png ├── dependentapp.png ├── linker.png ├── newbundleresource.png ├── newbundletarget.png ├── newbundletarget2.png ├── newstaticlib.png ├── prepareframework.png ├── publicheaders.png ├── publicheadersconfig.png ├── serenityproductname.png ├── skip_install.png ├── swift-error.png ├── targetdependencies.png ├── thirdparty.png └── utilitiesbutton.png ├── sample ├── DependentApp │ ├── DependentApp.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ └── DependentApp │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── DependentApp-Info.plist │ │ ├── DependentApp-Prefix.pch │ │ ├── en.lproj │ │ └── InfoPlist.strings │ │ └── main.m ├── LICENSE ├── NOTICE ├── Serenity │ ├── Serenity.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ ├── Serenity │ │ ├── Serenity-Prefix.pch │ │ ├── Serenity.h │ │ ├── Widget.h │ │ └── Widget.m │ └── SerenityResources │ │ ├── SerenityResources-Info.plist │ │ ├── SimpleView.xib │ │ └── en.lproj │ │ └── InfoPlist.strings └── ThirdParty │ ├── Serenity.bundle │ └── Contents │ │ ├── Info.plist │ │ └── Resources │ │ ├── SimpleView.nib │ │ ├── en.lproj │ │ └── InfoPlist.strings │ │ └── linker.png │ ├── Serenity.framework │ ├── Headers │ ├── Serenity │ └── Versions │ │ ├── A │ │ ├── Headers │ │ │ ├── Serenity.h │ │ │ └── Widget.h │ │ └── Serenity │ │ └── Current │ ├── ThirdParty.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── ThirdParty │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── ThirdParty-Info.plist │ ├── ThirdParty-Prefix.pch │ ├── en.lproj │ └── InfoPlist.strings │ └── main.m └── scripts ├── build_framework.sh └── prepare_framework.sh /.gitignore: -------------------------------------------------------------------------------- 1 | *.xcuserstate 2 | *.xcuserdatad 3 | .DS_Store 4 | -------------------------------------------------------------------------------- /README.mdown: -------------------------------------------------------------------------------- 1 | Building a static iOS framework is a pain. There are a variety of existing solutions 2 | already and each one has its own disadvantages. Presented here is a solution that meets all of the 3 | following constraints while having no deal-breaking disadvantages. 4 | 5 | - Fast iterative compilation times (up to 3x faster than some solutions!). 6 | - Easy distribution and packaging. 7 | - No modifications to Xcode. 8 | - No trickery with fake bundle targets and the likes. 9 | - Simple set-up for third-parties. 10 | - Support for building the framework as a dependent target (i.e. modifying source in the framework 11 | and building an app will automatically rebuild the framework and relink as expected). 12 | - Works with the latest version of Xcode 13 | 14 | Shameless plug: if you appreciate high-speed iOS development, check out 15 | [Nimbus](http://nimbuskit.info/), the iOS framework whose growth is bounded by its 16 | documentation. 17 | 18 | Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License. 19 | 20 | ## Important notice regarding Swift code 21 | 22 | The Swift language, as of Nov 2015, is still in flux. By including Swift code in your 23 | distributed binary .framework, you are forcing the users of your framework to have the 24 | same version of Swift as when you built your framework. **This is bad** because it will 25 | eventually result in your clients encountering the following error: 26 | 27 | ![](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/swift-error.png) 28 | 29 | While Swift the language is still changing, we **highly recommend** that you **do not** 30 | build Swift code into your .frameworks. This applies to both *static* and *dynamic* 31 | frameworks. 32 | 33 | With that out of the way, let's learn how to make a static iOS framework...built only 34 | with Objective-C. 35 | 36 | Table of Contents 37 | ================= 38 | 39 | - [Existing Solutions](#existing_solutions) 40 | - [How to Create a Static Framework for iOS](#walkthrough) 41 | - [Overview](#overview) 42 | - [Create the Static Library Target](#static_library_target) 43 | - [Create the Framework Distribution Target](#framework_distribution_target) 44 | - [Resources and Bundles](#resources) 45 | - [Adding the Framework to a Third-Party Application](#third_parties) 46 | - [Developing the Framework as a Dependent Project](#first_parties) 47 | - [FAQ](#faq) 48 | - [License](#license) 49 | 50 | 51 | 52 | Existing Solutions 53 | ================== 54 | 55 | Presented below are a few of the most popular solutions for building static iOS frameworks and the 56 | reasons why they should be avoided. 57 | 58 | > Note: Though the tone below is largely critical, credit is owed to those who pioneered these 59 | > solutions. Much of the proposed solution is based off the work that these amazingly generous 60 | > people have donated to the ether. Thanks! 61 | 62 | iOS-Universal-Framework 63 | ----------------------- 64 | 65 | Source: [https://github.com/kstenerud/iOS-Universal-Framework](https://github.com/kstenerud/iOS-Universal-Framework) 66 | 67 | ### Major problems 68 | 69 | - Slow iterative build times 70 | - Has to modify Xcode for "Real" frameworks 71 | - Can't properly add framework as a dependent target for "Fake" frameworks 72 | - No adequate solution for resource loading 73 | 74 | ### Overview 75 | 76 | This project provides two solutions: "fake" frameworks and "real" frameworks. 77 | 78 | A **fake** framework is a bundle target with a .framework extension and some post-build scripts to 79 | generate the fat library for the .framework. 80 | 81 | A **real** framework modifies the Xcode installation and generates a true .framework target. Real 82 | frameworks also use post-build scripts to generate the fat library. 83 | 84 | ### Problems with Fake Frameworks 85 | 86 | The problem with a fake framework is that you can't link to the framework as a dependent target. You 87 | can "trick" Xcode into linking to the framework by using the `-framework` flag in your `LD_FLAGS`, 88 | but changes to the framework will not be reflected in iterative builds. This requires that you clean 89 | build every time you modify the framework, or make a trivial modification to the application itself 90 | in order for it to forcefully relink to the new .framework. This bug is discussed 91 | [here](https://github.com/kstenerud/iOS-Universal-Framework/issues/32). 92 | 93 | *Example warning when you attempt to link to the .framework target:* 94 | 95 | warning: skipping file 96 | '/Users/featherless/Library/Developer/Xcode/DerivedData/SimpleApp-cshmhxdgzacibsgaiiryutjzobcb/Build/Products/Debug-iphonesimulator/fakeframework.framework' 97 | (unexpected file type 'wrapper.cfbundle' in Frameworks & Libraries build phase) 98 | 99 | ### Problems with Real Frameworks 100 | 101 | To use real frameworks you need to modify your Xcode installation. This is simply not scalable when 102 | you want to work with a team of people. If you use a build farm this problem becomes even worse 103 | because it may not be possible to modify the Xcode installations on the build servers. 104 | 105 | ### Problems with Both Fake and Real Frameworks 106 | 107 | In both frameworks there is a post-build step that builds the "inverse" platform. For example, if 108 | you're building the framework for i386, the post-build step will build the framework for armv6/armv7/armv7s 109 | and then smush the libraries together into one fat binary within the framework. The problem with 110 | this is that it **triples** the build time of the framework. Make one change to a .m file and 111 | suddenly you're rebuilding it for three platforms. Change a PCH and your project will effectively 112 | perform three clean builds. This is simply not ok from a productivity standpoint. 113 | 114 | There is also the problem of distributing resources with the .framework. Both the fake and real 115 | frameworks include an "embeddedframework" which is meant to be copied into the application. This 116 | results in the .framework binary being distributed with the application! Alternatively we could ask 117 | developers to only copy what's in the resources folder to their app, but this is complicated and 118 | requires we namespace our resource file names to avoid naming conflicts. 119 | 120 | db-in's solution ("Fake" frameworks) 121 | ---------------- 122 | 123 | Source: http://db-in.com/blog/2011/07/universal-framework-iphone-ios-2-0/ 124 | 125 | ### Major problems 126 | 127 | - Slow iterative build times 128 | - Can't properly add framework as a dependent target 129 | - No adequate solution for resource loading (recommends a remarkably *bad* solution) 130 | 131 | ### Overview 132 | 133 | db-in's solution is roughly identical to kstenerud's solution of using a bundle target to generate a 134 | fake framework. This has the same disadvantages as outlined above so I won't repeat myself. 135 | 136 | There is, however, a specific deal-breaker with the recommendations in this blog post: resources. 137 | Db-in recommends copying the .framework into your application as a resource bundle; this is NOT 138 | OK. This will end up copying not just the resources from your framework, but also the fat binary 139 | of the framework! Doing this will inflate the size of your application by several megabytes more 140 | than it should be because you're shipping off a fat binary with your application. 141 | 142 | And so without further ado... 143 | 144 | 145 | 146 | How to Create a Static Framework for iOS 147 | ======================================== 148 | 149 | There are a few constraints that we want to satisfy when building a .framework: 150 | 151 | - Fast iterative builds when developing the framework. We may have a simple application that has the 152 | .framework as a dependency and we want to quickly iterate on development of the .framework. 153 | - Infrequent distribution builds of the .framework. 154 | - Resource distribution should be intuitive and not bloat the application. 155 | - Setup for third-party developers using the .framework should be *easy*. 156 | 157 | I believe that the solution I will outline below satisfies each of these constraints. I will outline 158 | how to build a .framework project from scratch so that you can apply these steps to an existing 159 | project if you so desire. I will also include project templates for easily creating a 160 | .framework. 161 | 162 | 163 | 164 | Overview 165 | -------- 166 | 167 | > View a sample project that shows the result of following these steps in the `sample/Serenity` 168 | > directory. 169 | 170 | Within the project we are going to have three targets: a static library, a bundle, and an aggregate. 171 | 172 | The static library target will build the source into a static library (.a) and specify which headers 173 | will be "public", meaning they will be accessible from the .framework when we distribute it. 174 | 175 | The bundle target will contain all of our resources and will be loadable from the framework. 176 | 177 | The aggregate target will build the static library for i386/armv6/armv7/armv7s, generate the fat framework 178 | binary, and also build the bundle. You will run this target when you plan to distribute the 179 | .framework. 180 | 181 | When you are working on the framework you will likely have an internal application that links to the 182 | framework. This application will link to the static library target as you normally would and copy 183 | the .bundle in the copy resources phase. This has the benefit of only building the framework code 184 | for the platform you're actively working on, significantly improving your build times. We'll do a 185 | little bit of work in the framework project to ensure that you can use your framework in your app 186 | the same way a third party developer would (i.e. importing should work 187 | as expected). Jump to the dependent project walkthrough. 188 | 189 | 190 | 191 | Create the Static Library Target 192 | -------------------------------- 193 | 194 | ### Step 1: Create a New "Cocoa Touch Static Library" Project 195 | 196 | ![](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/newstaticlib.png) 197 | 198 | The product name will be the name of your framework. For example, `Serenity` will generate 199 | `Serenity.framework` once we've set up the project. 200 | 201 | ### Step 2: Create the Primary Framework Header 202 | 203 | Developers expect to be able to import your framework by importing the `` 204 | header. Ensure that your project has such a header (if you created a new static library then there 205 | should already be a Serenity.h and Serenity.m file; you can delete the .m). 206 | 207 | Within this header you are going to import all of the public headers for your framework. For 208 | example, let's assume that we have some `Widget` with a .h and .m. Our Serenity.h file would look 209 | like this: 210 | 211 | ``` 212 | #import 213 | 214 | #import 215 | ``` 216 | 217 | Once you've created your framework header file, you need to make it a "public" header. Public 218 | headers are headers that will be copied to the .framework and can be imported by those using your 219 | framework. This differs from "project" headers which will *not* be distributed with the framework. 220 | This distinction is what allows you to have a concept of public and private APIs. 221 | 222 | To change a file's [target membership visibility in XCode 4.4+] 223 | (http://stackoverflow.com/questions/13571080/cant-change-target-membership-visibility-in-xcode-4-5), 224 | you'll need to select the Static Library target you created (Serenity), open the Build Phases tab: 225 | 226 | **Xcode 4.X:** 227 | Click on Add Build Phase > Add Copy Headers. 228 | 229 | **Xcode 5:** 230 | Add Build Phases from the menu. Click on Editor > Add Build Phase -> Add Copy Headers Build Phase. Note: If the menu options are grayed out, you'll need to click on the whitespace below the Build Phases to regain focus and retry. 231 | 232 | **Xcode 6:** 233 | Add Build Phases from the menu. Click on Editor > Add Build Phase -> Add Headers Build Phase. Note: If the menu options are grayed out, you'll need to click on the whitespace below the Build Phases to regain focus and retry. 234 | 235 | 236 | You'll see 3 sections for Public, Private, and Project headers. To modify the scope of any header, drag and drop the header files between the sections. Alternatively you can open the Project Navigator and select the header. Next expand the Utilities pane for the File Inspector. 237 | ![](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/utilitiesbutton.png) 238 | (Cmd+Option+0). 239 | 240 | Look at the "Target Membership" group and ensure that the checkbox next to the .h file is checked. 241 | Change the scope of the header from "Project" to "Public". You might have to uncheck and check the box to get the dropdown list. This will ensure that the header gets 242 | copied to the correct location in the copy headers phase. 243 | 244 | ![](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/publicheaders.png) 245 | 246 | ### Step 3: Update the Public Headers Location 247 | 248 | By default the static library project will copy private and public headers to the same folder: 249 | `/usr/local/include`. To avoid mistakenly copying private headers to our framework we want to ensure 250 | that our public headers are copied to a separate directory, e.g. `$(PROJECT_NAME)Headers`. To change this setting, 251 | select the project in the Project Navigator and then click the "Build Settings" tab. Search for "public 252 | headers" and then set the "Public Headers Folder Path" to "$(PROJECT_NAME)Headers" for all configurations. 253 | If you are working with multiple Frameworks make sure that this folder is unique. 254 | 255 | ![](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/publicheadersconfig.png) 256 | 257 | ### Ongoing Step: Adding New Sources to the Framework 258 | 259 | Whenever you add new source to the framework you must decide whether to expose the .h publicly or 260 | not. To modify a header's scope you will follow the same process as Step 2. By default a header's 261 | scope will be "Project", meaning it will not be copied to the framework's public headers. 262 | 263 | #### An Important Note on Categories 264 | 265 | Using a category should be a **necessity**, not a convenience, when distributing a framework. 266 | 267 | Frameworks, by their very nature, obscure most implementation details, very likely leading to severe run-time tomfoolery as symbols get overwritten and your client's app starts performing in wonderfully novel ways (much to their users' chagrin). 268 | 269 | If you **absolutely** ***must*** use categories, please check out the [FAQ](#faq) in order to avoid having your clients encounter linker problems when attempting to use them. 270 | 271 | ### Step 4: Disable Code Stripping 272 | 273 | We do not want to strip any code from the library; we leave this up to the application that is 274 | linking to the framework. To disable code stripping we must modify the following configuration 275 | settings: 276 | 277 | "Dead Code Stripping" => No (for all settings) 278 | "Strip Debug Symbols During Copy" => No (for all settings) 279 | "Strip Style" => Non-Global Symbols (for all settings) 280 | 281 | ### Step 5: Enable all architecture support 282 | 283 | We want our framework able to work with all device architectures. To do so, change this in your project file (not your target files !): 284 | "Build Active Architecture Only" => No (for all settings) 285 | 286 | ### Step 6: Prepare the Framework for use as a Dependent Target 287 | 288 | In order to use the static library as though it were a framework we're going to generate the basic 289 | skeleton of the framework in the static library target. To do this we'll include a simple post-build 290 | script. Add a post-build script by selecting your project in the Project Navigator, selecting the target, and then the 291 | "Build Phases" tab. 292 | 293 | **Xcode 4.X:** Click Add Build Phase > Add Run Script 294 | 295 | **Xcode 5:** Select Editor menu > Add Build Phase > Add Run Script Build Phase 296 | 297 | Paste the following script in the source portion of the run script build phase. You can rename the phase by clicking 298 | the title of the phase (I've named it "Prepare Framework", for example). 299 | 300 | #### prepare_framework.sh 301 | 302 | ```bash 303 | set -e 304 | 305 | mkdir -p "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/A/Headers" 306 | 307 | # Link the "Current" version to "A" 308 | /bin/ln -sfh A "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/Current" 309 | /bin/ln -sfh Versions/Current/Headers "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Headers" 310 | /bin/ln -sfh "Versions/Current/${PRODUCT_NAME}" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/${PRODUCT_NAME}" 311 | 312 | # The -a ensures that the headers maintain the source modification date so that we don't constantly 313 | # cause propagating rebuilds of files that import these headers. 314 | /bin/cp -a "${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/A/Headers" 315 | 316 | ``` 317 | 318 | ![](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/prepareframework.png) 319 | 320 | This will generate the following folder structure: 321 | 322 | ``` 323 | -- Note: "->" denotes a symbolic link -- 324 | 325 | Serenity.framework/ 326 | Headers/ -> Versions/Current/Headers 327 | Serenity -> Versions/Current/Serenity 328 | Versions/ 329 | A/ 330 | Headers/ 331 | Serenity.h 332 | Widget.h 333 | Current -> A 334 | ``` 335 | 336 | Try building your project now and look at the build products directory (usually 337 | `~/Library/Developer/Xcode/DerivedData/-/Build/Products/...`). You should 338 | see a `libSerenity.a` static library, a `Headers` folder, and a `Serenity.framework` folder that 339 | contains the basic skeleton of your framework. 340 | 341 | ![](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/buildphase1.png) 342 | 343 | ### Step 7: Enable bitcode (Optional) 344 | 345 | **Xcode 7.x** is required for bitcode support. 346 | 347 | To include bitcode in your framework, just add **-fembed-bitcode** flag to the static 348 | library C flags. 349 | 350 | 351 | 352 | Create the Framework Distribution Target 353 | ---------------------------------------- 354 | 355 | When actively developing the framework we only care to build the platform that we're testing on. For 356 | example, if we're testing on the iPhone simulator then we only need to build the i386 platform. 357 | 358 | This changes when we want to distribute the framework to third party developers. The third-party 359 | developers don't have the option of rebuilding the framework for each platform, so we must provide 360 | what is called a "fat binary" version of the static library that is comprised of the possible 361 | platforms. These platforms include: i386, armv6, armv7, and armv7s. 362 | 363 | To generate this fat binary we're going to build the static library target for each platform. 364 | 365 | ### Step 1: Create an Aggregate Target 366 | 367 | Click File > New Target > iOS > Other and create a new Aggregate target. Title it something like "Framework". 368 | 369 | ![](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/aggregatetarget.png) 370 | 371 | ### Step 2: Add the Static Library as a Dependent Target 372 | 373 | Add the static library target to the "Target Dependencies". 374 | 375 | ![](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/targetdependencies.png) 376 | 377 | ### Step 3: Build the Other Platform 378 | 379 | To build the other platform we're going to use a "Run Script" phase to execute some basic commands. 380 | Add a new "Run Script" build phase to your aggregate target and paste the following code into it. 381 | 382 | #### build_framework.sh 383 | 384 | ```bash 385 | set -e 386 | set +u 387 | # Avoid recursively calling this script. 388 | if [[ $SF_MASTER_SCRIPT_RUNNING ]] 389 | then 390 | exit 0 391 | fi 392 | set -u 393 | export SF_MASTER_SCRIPT_RUNNING=1 394 | 395 | SF_TARGET_NAME=${PROJECT_NAME} 396 | SF_EXECUTABLE_PATH="lib${SF_TARGET_NAME}.a" 397 | SF_WRAPPER_NAME="${SF_TARGET_NAME}.framework" 398 | 399 | # The following conditionals come from 400 | # https://github.com/kstenerud/iOS-Universal-Framework 401 | 402 | if [[ "$SDK_NAME" =~ ([A-Za-z]+) ]] 403 | then 404 | SF_SDK_PLATFORM=${BASH_REMATCH[1]} 405 | else 406 | echo "Could not find platform name from SDK_NAME: $SDK_NAME" 407 | exit 1 408 | fi 409 | 410 | if [[ "$SDK_NAME" =~ ([0-9]+.*$) ]] 411 | then 412 | SF_SDK_VERSION=${BASH_REMATCH[1]} 413 | else 414 | echo "Could not find sdk version from SDK_NAME: $SDK_NAME" 415 | exit 1 416 | fi 417 | 418 | if [[ "$SF_SDK_PLATFORM" = "iphoneos" ]] 419 | then 420 | SF_OTHER_PLATFORM=iphonesimulator 421 | else 422 | SF_OTHER_PLATFORM=iphoneos 423 | fi 424 | 425 | if [[ "$BUILT_PRODUCTS_DIR" =~ (.*)$SF_SDK_PLATFORM$ ]] 426 | then 427 | SF_OTHER_BUILT_PRODUCTS_DIR="${BASH_REMATCH[1]}${SF_OTHER_PLATFORM}" 428 | else 429 | echo "Could not find platform name from build products directory: $BUILT_PRODUCTS_DIR" 430 | exit 1 431 | fi 432 | 433 | # Build the other platform. 434 | xcrun xcodebuild -project "${PROJECT_FILE_PATH}" -target "${TARGET_NAME}" -configuration "${CONFIGURATION}" -sdk ${SF_OTHER_PLATFORM}${SF_SDK_VERSION} BUILD_DIR="${BUILD_DIR}" OBJROOT="${OBJROOT}" BUILD_ROOT="${BUILD_ROOT}" SYMROOT="${SYMROOT}" $ACTION 435 | 436 | # Smash the two static libraries into one fat binary and store it in the .framework 437 | xcrun lipo -create "${BUILT_PRODUCTS_DIR}/${SF_EXECUTABLE_PATH}" "${SF_OTHER_BUILT_PRODUCTS_DIR}/${SF_EXECUTABLE_PATH}" -output "${BUILT_PRODUCTS_DIR}/${SF_WRAPPER_NAME}/Versions/A/${SF_TARGET_NAME}" 438 | 439 | # Copy the binary to the other architecture folder to have a complete framework in both. 440 | cp -a "${BUILT_PRODUCTS_DIR}/${SF_WRAPPER_NAME}/Versions/A/${SF_TARGET_NAME}" "${SF_OTHER_BUILT_PRODUCTS_DIR}/${SF_WRAPPER_NAME}/Versions/A/${SF_TARGET_NAME}" 441 | 442 | ``` 443 | 444 | #### Important Notes 445 | 446 | The above script assumes that your library name matches your project name in the following line: 447 | 448 | ```bash 449 | SF_TARGET_NAME=${PROJECT_NAME} 450 | ``` 451 | 452 | If this is not the case (e.g. your xcode project is named SerenityFramework and the target name is 453 | Serenity) then you need to explicitly set the target name on that line. For example: 454 | 455 | ```bash 456 | SF_TARGET_NAME=Serenity 457 | ``` 458 | 459 | If you are using Cocoapods, you need to build the workspace instead of the project. Assuming your 460 | Scheme matches your aggregate target name, change the `xcrun xcodebuild` line to: 461 | 462 | ```bash 463 | xcrun xcodebuild ONLY_ACTIVE_ARCH=NO -workspace "${PROJECT_DIR}/${PROJECT_NAME}.xcworkspace" -scheme "${TARGET_NAME}" -configuration "${CONFIGURATION}" -sdk ${SF_OTHER_PLATFORM}${SF_SDK_VERSION} BUILD_DIR="${BUILD_DIR}" OBJROOT="${OBJROOT}" BUILD_ROOT="${BUILD_ROOT}" SYMROOT="${SYMROOT}" $ACTION 464 | ``` 465 | 466 | ### Step 4: Build and Verify 467 | 468 | You now have everything set up to build a distributable .framework to third-party developers. Try 469 | building the aggregate target. Once it's done, expand the Products folder in Xcode, right click the 470 | static library and click "Show in Finder". If this doesn't open Finder to where the static library 471 | exists then try opening 472 | `~/Library/Developer/Xcode/DerivedData//Build/Products/Debug-iphonesimulator/`. 473 | 474 | Within this folder you will see your .framework folder. 475 | 476 | Verify that your framework includes all of the architectures that are available by running the 477 | `file` command on your framework's static library: 478 | 479 | ```bash 480 | lipo -info Serenity.framework/Serenity 481 | ``` 482 | 483 | You should see output resembling: 484 | 485 | ```bash 486 | Architectures in the fat file: Serenity.framework/Serenity are: i386 x86_64 armv7 armv7s arm64 487 | ``` 488 | 489 | If you don't see all of the architectures listed, make sure that you're looking at the right 490 | framework output. If you're building with the Simulator as your target, the correct framework 491 | will be in the -iphonesimulator folder. Sometimes it can help to delete the Debug- and Release- 492 | folders to ensure that you're getting a truly clean build. 493 | 494 | Once you've verified that the framework includes all of the architectures, you can now move 495 | the .framework elsewhere, zip it up, upload it, and distribute it to your third-party developers. 496 | 497 | 498 | 499 | Resources and Bundles 500 | ===================== 501 | 502 | To distribute resources with a framework, we are going to provide the developer with a separate 503 | .bundle that contains all of the strings and resources. This distribution method provides a number 504 | of advantages over including the resources in the .framework itself. 505 | 506 | - Encapsulation of resources. We can scope resource loading to our framework's bundle. 507 | - Easy to add bundles to projects. 508 | - The developer doesn't have to copy the entire .framework into their application. 509 | 510 | The hard part about bundles is creating the target. Xcode's bundle target doesn't actually create a 511 | loadable bundle object, so we have to do some post-build massaging of the bundle. It's important 512 | that we create a bundle target because we need to create the bundle using the Copy Bundle Resources 513 | phase that will correctly compile .xib files (a Copy Files phase does not accomplish this!). 514 | 515 | ### Step 1: Create the Bundle Target 516 | 517 | In the framework project, create a new bundle target. Click on File > New > Target > OS X > Bundle. You will need to name the bundle something 518 | different from your framework name or Xcode will not let you create the target. I've named the target SerenityResources. We will rename the output of the target to Serenity.bundle in a following 519 | step. 520 | 521 | ![](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/newbundletarget.png) 522 | 523 | Ensure that the Framework setting is set to "Core Foundation". 524 | 525 | ![](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/newbundletarget2.png) 526 | 527 | ### Step 2: Clean up the Bundle Target Settings 528 | 529 | By default the bundle will only show build settings for Mac OS X. It doesn't really matter what it 530 | builds for because the bundle isn't actually going to have any code in it, but I prefer to have 531 | things nice and consistent. Open the bundle target settings and delete the settings for 532 | Architectures, Base SDK, and Build Active Architecture Only. 533 | 534 | **Xcode 5:** Deleting a build setting will reset it to the Project's build setting. It should switch from OS X to iOS. 535 | 536 | ![](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/bundlesettings.png) 537 | 538 | This is also when you should change your bundle target's product name to the name of your framework 539 | rather than the target name. Click on your project in the Project Navigator and then select 540 | the bundle target. Click Build Settings, search for "Product Name", and then replace 541 | the value of Product Name with the name of your framework (e.g. $(TARGET_NAME) replaced by Serenity) 542 | 543 | ![](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/serenityproductname.png) 544 | 545 | ### Step 3: Remove HIDPI Mac OS X Build Setting 546 | We created a OS X Bundle and it includes and option to merge HIDPI (retina and non-retina) art assets into a .tiff file. You don't want this behavior and need to disable it, or you will be unable to load your image assets from the bundle. 547 | 548 | In the Bundle target go to Build Settings and search for `COMBINE_HIDPI_IMAGES` and delete the user defined setting. When you build, verify that your @2x.png and .png images are all in the bundle. 549 | 550 | ![Delete the COMBINE_HIDPI_IMAGES setting](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/delete_combine_hidpi.png) 551 | 552 | ### Ongoing Step: Add Resources to the Bundle Target Copy Files Phase 553 | 554 | Whenever you add new resources that you want to include with your framework you need to add it to 555 | the bundle target that you created. 556 | 557 | ![](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/newbundleresource.png) 558 | 559 | ### Step 4: Add the Bundle Target to your Aggregate Target 560 | 561 | Whenever we build the framework for distribution we likely also want to build the bundle. Add the 562 | bundle target to your aggregate target's dependencies. 563 | 564 | ![](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/bundledependency.png) 565 | 566 | ### Step 5: Loading Bundle Resources 567 | 568 | In order to load bundle resources, we must first ask the third-party developer to add the .bundle to 569 | their application. To do so they will simply drag the .bundle that you distributed with the 570 | .framework to their project and ensure that it is copied in the copy files phase of their app 571 | target. 572 | 573 | ![](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/addbundle.png) 574 | 575 | To load resources from the bundle we will use the following code: 576 | 577 | ```obj-c 578 | // Load the framework bundle. 579 | + (NSBundle *)frameworkBundle { 580 | static NSBundle* frameworkBundle = nil; 581 | static dispatch_once_t predicate; 582 | dispatch_once(&predicate, ^{ 583 | NSString* mainBundlePath = [[NSBundle mainBundle] resourcePath]; 584 | NSString* frameworkBundlePath = [mainBundlePath stringByAppendingPathComponent:@"Serenity.bundle"]; 585 | frameworkBundle = [[NSBundle bundleWithPath:frameworkBundlePath] retain]; 586 | }); 587 | return frameworkBundle; 588 | } 589 | 590 | [UIImage imageWithContentsOfFile:[[[self class] frameworkBundle] pathForResource:@"image" ofType:@"png"]]; 591 | ``` 592 | 593 | You can see an example of loading a resource from within the framework in the Widget object in the 594 | included Serenity framework. 595 | 596 | **Xcode 5:** Do not use the Asset Catalog for any resources within a bundle. On an iOS 7.0 only project, a bug causes the pathForResource method to return nil. 597 | 598 | 599 | 600 | Adding the Framework to a Third-Party Application 601 | ================================================= 602 | 603 | > View a sample project that shows the result of following these steps in the `sample/ThirdParty` 604 | > directory. 605 | 606 | This is the easy part (and what your third-party developers will have to do). Simply drag the 607 | .framework to your application's project, ensuring that it's being added to the necessary targets. 608 | 609 | ![](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/thirdparty.png) 610 | 611 | Import your framework header and you're kickin' ass. 612 | 613 | ```obj-c 614 | #import 615 | ``` 616 | 617 | ### Resources 618 | 619 | If you're distributing resources with your framework then you will also send the .bundle file to the 620 | developers. The developer will then drag the .bundle file into their application and ensure that 621 | it's added to the application target. 622 | 623 | 624 | 625 | Developing the Framework as a Dependent Project 626 | =============================================== 627 | 628 | > View a sample project that shows the result of following these steps in the `sample/DependentApp` 629 | > directory. 630 | 631 | When developing the framework you want to minimize build times while ensuring that your experience 632 | roughly matches that of your third-party developers. We achieve this balance by only building the 633 | static library but treating the static library as though it were a framework. 634 | 635 | ### Step 1: Add the Framework Project to your Application Project 636 | 637 | To add the framework as a dependent target in your application, from Finder drag the framework's .xcodeproj to 638 | Xcode and drop it in your application's frameworks folder. This will add a reference to the 639 | framework's xcodeproj folder. 640 | 641 | ![](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/dependentapp.png) 642 | 643 | ### Step 2: Make the Framework Static Library Target a Dependency 644 | 645 | Once you've added the framework project to your app you can add the static library product as a 646 | dependency. Select your project in the Project Navigator and open the "Build Phases" tab. Expand 647 | the "Target Dependencies" group and click the + button. Select the static library target and click 648 | "Add". 649 | 650 | **Note:** Close your Static Library Project or the dependencies will not appear in the list. You can only have one instance of an Xcode project open. 651 | 652 | ![](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/addtarget.png) 653 | 654 | ### Step 3: Link your Application with the Framework Static Library 655 | 656 | In order to use the framework's static library we must link it into the application. Expand the 657 | "Link Binary With Libraries" phase and click the + button. Select the `.a` file that's exposed by 658 | your framework's project and then click add. 659 | 660 | ![](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/linker.png) 661 | 662 | ### Step 4: Import the Framework Header 663 | 664 | You now simply need to import the framework header somewhere in your project. I generally prefer 665 | the pch so that I don't have to clutter up my application's source with framework headers, but you 666 | can obviously choose whatever practice suits your needs. 667 | 668 | ```obj-c 669 | #import 670 | ``` 671 | 672 | ### Step 4-b: Adding Resources 673 | 674 | If you are developing resources for your framework you can also add the bundle target as a 675 | dependency. 676 | 677 | ![](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/bundledependency2.png) 678 | 679 | You must then add the bundle to the Copy Bundle Resources phase of your application by expanding 680 | the products folder of your framework product and dragging the .bundle into that section. 681 | 682 | ![](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/bundlecopy.png) 683 | 684 | ### Step 5: Check Dependent Target Build Settings 685 | 686 | Set the setting `Skip Install` to `Yes` for any static library or bundle target that you create. Check all the targets that are dependencies of your application project. If the option is `No` then you will be unable to build an archive of the project containing the target dependencies. Xcode will create a Generic Xcode Archive, which cannot be shared adhoc, validated, or submitted. 687 | 688 | ![](https://github.com/jverkoey/iOS-Framework/raw/master/gfx/skip_install.png) 689 | 690 | ### Step 6: Build and Test 691 | 692 | Build your application and verify a couple things: 693 | 694 | - Your framework should be built before your application. 695 | - Your framework should be linked into the application. 696 | - You shouldn't get any compiler or linker errors. 697 | 698 | 699 | 700 | FAQ 701 | === 702 | 703 | How do I resolve 'unrecognized selector sent to instance' linker errors? 704 | ------------------------------------------------------------------------ 705 | 706 | - **The recommended solution** is to use [NimbusKitBasics' NI_FIX_CATEGORY_BUG](https://github.com/NimbusKit/basics#avoid-requiring-the--all_load-and--force_load-flags) whenever possible. This solution minimizes the amount of your framework that will need to be linked into the client's app binary. 707 | - [Breakdown of solutions](http://stackoverflow.com/a/22264650/65455) from [Mecki](http://stackoverflow.com/users/15809/mecki) on stackoverflow. 708 | 709 | How do I include Third-Party Libraries in my Framework? 710 | ------------------------------------------------------- 711 | 712 | Don't. 713 | 714 | Ok, you can, but it's touch to do correctly - and it's really important that you do it correctly. 715 | 716 | The scenario you want to avoid is the following: 717 | 718 | - You've linked some third-party library in your code (e.g. [NimbusKit's Markdown](https://github.com/nimbuskit/markdown)). 719 | - A client using your framework also wants to use NimbusKit's Markdown. 720 | - Their app fails to build due to duplicate symbol linker errors. 721 | - Client gets incredibly frustrated with your framework and uses something else. 722 | 723 | Solutions, in order of easiest-to-most-difficult: 724 | 725 | ### Pure framework build (no third-party libraries included) + library source distribution 726 | 727 | Bundle any libraries that your framework uses alongside your framework when you distribute it (e.g. distribute a zip file with your built .framework and a third-party folder containing the source for all libraries used). Make it clear in your setup guide that the additional libraries will also need to be compiled into the client's app. 728 | 729 | This: 730 | 731 | - gives the client the flexibility to use their own version of the library; 732 | - encourages proper attribution and license redistribution of any open source code you're using; 733 | - and, most importantly, ensures that the client will not encounter duplicate symbol linker errors. 734 | 735 | ### Symbol Prefixing 736 | 737 | This is hard to do correctly and requires meticulous ongoing care to ensure that no symbols ever slip through the build process. 738 | 739 | This solution allows you to completely guarantee that a given version of a third-party library will be used by your framework. It also allows you to distribute a single .framework, easing the setup and versioning process. 740 | 741 | Some approaches to symbol prefixing: 742 | 743 | - High level overview by [featherless](http://twitter.com/featherless) on StackOverflow: [http://stackoverflow.com/questions/11512291/prefix-static-library-ios/19341366#19341366](http://stackoverflow.com/questions/11512291/prefix-static-library-ios/19341366#19341366). 744 | - [Avoiding Dependency Collisions in an iOS Library](http://pdx.esri.com/blog/2013/12/13/namespacing-dependencies/) on esri.com. 745 | 746 | 747 | 748 | License 749 | ======= 750 | 751 | Except as otherwise noted, the content of this page is licensed under the Creative Commons 752 | Attribution 3.0 Unported License, and code samples are licensed under the Apache 2.0 License. 753 | 754 | To view a copy of this license, visit httip://creativecommons.org/licenses/by/3.0/ or send a letter 755 | to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA. 756 | -------------------------------------------------------------------------------- /gfx/addbundle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/addbundle.png -------------------------------------------------------------------------------- /gfx/addtarget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/addtarget.png -------------------------------------------------------------------------------- /gfx/aggregatetarget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/aggregatetarget.png -------------------------------------------------------------------------------- /gfx/buildphase1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/buildphase1.png -------------------------------------------------------------------------------- /gfx/bundlecopy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/bundlecopy.png -------------------------------------------------------------------------------- /gfx/bundledependency.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/bundledependency.png -------------------------------------------------------------------------------- /gfx/bundledependency2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/bundledependency2.png -------------------------------------------------------------------------------- /gfx/bundlesettings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/bundlesettings.png -------------------------------------------------------------------------------- /gfx/delete_combine_hidpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/delete_combine_hidpi.png -------------------------------------------------------------------------------- /gfx/dependentapp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/dependentapp.png -------------------------------------------------------------------------------- /gfx/linker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/linker.png -------------------------------------------------------------------------------- /gfx/newbundleresource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/newbundleresource.png -------------------------------------------------------------------------------- /gfx/newbundletarget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/newbundletarget.png -------------------------------------------------------------------------------- /gfx/newbundletarget2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/newbundletarget2.png -------------------------------------------------------------------------------- /gfx/newstaticlib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/newstaticlib.png -------------------------------------------------------------------------------- /gfx/prepareframework.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/prepareframework.png -------------------------------------------------------------------------------- /gfx/publicheaders.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/publicheaders.png -------------------------------------------------------------------------------- /gfx/publicheadersconfig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/publicheadersconfig.png -------------------------------------------------------------------------------- /gfx/serenityproductname.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/serenityproductname.png -------------------------------------------------------------------------------- /gfx/skip_install.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/skip_install.png -------------------------------------------------------------------------------- /gfx/swift-error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/swift-error.png -------------------------------------------------------------------------------- /gfx/targetdependencies.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/targetdependencies.png -------------------------------------------------------------------------------- /gfx/thirdparty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/thirdparty.png -------------------------------------------------------------------------------- /gfx/utilitiesbutton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/gfx/utilitiesbutton.png -------------------------------------------------------------------------------- /sample/DependentApp/DependentApp.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 664A26E614E3417F00C297E6 /* Serenity.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 664A26C614E3361500C297E6 /* Serenity.bundle */; }; 11 | 66F5F14B14DB3B300068FD20 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66F5F14A14DB3B300068FD20 /* UIKit.framework */; }; 12 | 66F5F14D14DB3B310068FD20 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66F5F14C14DB3B300068FD20 /* Foundation.framework */; }; 13 | 66F5F14F14DB3B310068FD20 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66F5F14E14DB3B310068FD20 /* CoreGraphics.framework */; }; 14 | 66F5F15514DB3B310068FD20 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 66F5F15314DB3B310068FD20 /* InfoPlist.strings */; }; 15 | 66F5F15714DB3B310068FD20 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 66F5F15614DB3B310068FD20 /* main.m */; }; 16 | 66F5F15B14DB3B310068FD20 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 66F5F15A14DB3B310068FD20 /* AppDelegate.m */; }; 17 | 66F5F16F14DB3D820068FD20 /* libSerenity.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 66F5F16A14DB3B380068FD20 /* libSerenity.a */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | 664A26C514E3361500C297E6 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = 66F5F16114DB3B380068FD20 /* Serenity.xcodeproj */; 24 | proxyType = 2; 25 | remoteGlobalIDString = 664A269514E3265400C297E6; 26 | remoteInfo = SerenityResources; 27 | }; 28 | 664A26E314E33A7500C297E6 /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = 66F5F16114DB3B380068FD20 /* Serenity.xcodeproj */; 31 | proxyType = 1; 32 | remoteGlobalIDString = 664A269414E3265400C297E6; 33 | remoteInfo = SerenityResources; 34 | }; 35 | 66F5F16914DB3B380068FD20 /* PBXContainerItemProxy */ = { 36 | isa = PBXContainerItemProxy; 37 | containerPortal = 66F5F16114DB3B380068FD20 /* Serenity.xcodeproj */; 38 | proxyType = 2; 39 | remoteGlobalIDString = 66E8B6D314D899500074EAA4; 40 | remoteInfo = Serenity; 41 | }; 42 | 66F5F16D14DB3D0F0068FD20 /* PBXContainerItemProxy */ = { 43 | isa = PBXContainerItemProxy; 44 | containerPortal = 66F5F16114DB3B380068FD20 /* Serenity.xcodeproj */; 45 | proxyType = 1; 46 | remoteGlobalIDString = 66E8B6D214D899500074EAA4; 47 | remoteInfo = Serenity; 48 | }; 49 | /* End PBXContainerItemProxy section */ 50 | 51 | /* Begin PBXFileReference section */ 52 | 66F5F14614DB3B300068FD20 /* DependentApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DependentApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 66F5F14A14DB3B300068FD20 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 54 | 66F5F14C14DB3B300068FD20 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 55 | 66F5F14E14DB3B310068FD20 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 56 | 66F5F15214DB3B310068FD20 /* DependentApp-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "DependentApp-Info.plist"; sourceTree = ""; }; 57 | 66F5F15414DB3B310068FD20 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 58 | 66F5F15614DB3B310068FD20 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 59 | 66F5F15814DB3B310068FD20 /* DependentApp-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "DependentApp-Prefix.pch"; sourceTree = ""; }; 60 | 66F5F15914DB3B310068FD20 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 61 | 66F5F15A14DB3B310068FD20 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 62 | 66F5F16114DB3B380068FD20 /* Serenity.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Serenity.xcodeproj; path = ../Serenity/Serenity.xcodeproj; sourceTree = ""; }; 63 | /* End PBXFileReference section */ 64 | 65 | /* Begin PBXFrameworksBuildPhase section */ 66 | 66F5F14314DB3B300068FD20 /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | 66F5F16F14DB3D820068FD20 /* libSerenity.a in Frameworks */, 71 | 66F5F14B14DB3B300068FD20 /* UIKit.framework in Frameworks */, 72 | 66F5F14D14DB3B310068FD20 /* Foundation.framework in Frameworks */, 73 | 66F5F14F14DB3B310068FD20 /* CoreGraphics.framework in Frameworks */, 74 | ); 75 | runOnlyForDeploymentPostprocessing = 0; 76 | }; 77 | /* End PBXFrameworksBuildPhase section */ 78 | 79 | /* Begin PBXGroup section */ 80 | 66F5F13B14DB3B300068FD20 = { 81 | isa = PBXGroup; 82 | children = ( 83 | 66F5F15014DB3B310068FD20 /* DependentApp */, 84 | 66F5F14914DB3B300068FD20 /* Frameworks */, 85 | 66F5F14714DB3B300068FD20 /* Products */, 86 | ); 87 | sourceTree = ""; 88 | }; 89 | 66F5F14714DB3B300068FD20 /* Products */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | 66F5F14614DB3B300068FD20 /* DependentApp.app */, 93 | ); 94 | name = Products; 95 | sourceTree = ""; 96 | }; 97 | 66F5F14914DB3B300068FD20 /* Frameworks */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 66F5F16114DB3B380068FD20 /* Serenity.xcodeproj */, 101 | 66F5F14A14DB3B300068FD20 /* UIKit.framework */, 102 | 66F5F14C14DB3B300068FD20 /* Foundation.framework */, 103 | 66F5F14E14DB3B310068FD20 /* CoreGraphics.framework */, 104 | ); 105 | name = Frameworks; 106 | sourceTree = ""; 107 | }; 108 | 66F5F15014DB3B310068FD20 /* DependentApp */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | 66F5F15914DB3B310068FD20 /* AppDelegate.h */, 112 | 66F5F15A14DB3B310068FD20 /* AppDelegate.m */, 113 | 66F5F15114DB3B310068FD20 /* Supporting Files */, 114 | ); 115 | path = DependentApp; 116 | sourceTree = ""; 117 | }; 118 | 66F5F15114DB3B310068FD20 /* Supporting Files */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 66F5F15214DB3B310068FD20 /* DependentApp-Info.plist */, 122 | 66F5F15314DB3B310068FD20 /* InfoPlist.strings */, 123 | 66F5F15614DB3B310068FD20 /* main.m */, 124 | 66F5F15814DB3B310068FD20 /* DependentApp-Prefix.pch */, 125 | ); 126 | name = "Supporting Files"; 127 | sourceTree = ""; 128 | }; 129 | 66F5F16214DB3B380068FD20 /* Products */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 66F5F16A14DB3B380068FD20 /* libSerenity.a */, 133 | 664A26C614E3361500C297E6 /* Serenity.bundle */, 134 | ); 135 | name = Products; 136 | sourceTree = ""; 137 | }; 138 | /* End PBXGroup section */ 139 | 140 | /* Begin PBXNativeTarget section */ 141 | 66F5F14514DB3B300068FD20 /* DependentApp */ = { 142 | isa = PBXNativeTarget; 143 | buildConfigurationList = 66F5F15E14DB3B310068FD20 /* Build configuration list for PBXNativeTarget "DependentApp" */; 144 | buildPhases = ( 145 | 66F5F14214DB3B300068FD20 /* Sources */, 146 | 66F5F14314DB3B300068FD20 /* Frameworks */, 147 | 66F5F14414DB3B300068FD20 /* Resources */, 148 | ); 149 | buildRules = ( 150 | ); 151 | dependencies = ( 152 | 664A26E414E33A7500C297E6 /* PBXTargetDependency */, 153 | 66F5F16E14DB3D0F0068FD20 /* PBXTargetDependency */, 154 | ); 155 | name = DependentApp; 156 | productName = DependentApp; 157 | productReference = 66F5F14614DB3B300068FD20 /* DependentApp.app */; 158 | productType = "com.apple.product-type.application"; 159 | }; 160 | /* End PBXNativeTarget section */ 161 | 162 | /* Begin PBXProject section */ 163 | 66F5F13D14DB3B300068FD20 /* Project object */ = { 164 | isa = PBXProject; 165 | attributes = { 166 | LastUpgradeCheck = 0420; 167 | ORGANIZATIONNAME = Google; 168 | }; 169 | buildConfigurationList = 66F5F14014DB3B300068FD20 /* Build configuration list for PBXProject "DependentApp" */; 170 | compatibilityVersion = "Xcode 3.2"; 171 | developmentRegion = English; 172 | hasScannedForEncodings = 0; 173 | knownRegions = ( 174 | en, 175 | ); 176 | mainGroup = 66F5F13B14DB3B300068FD20; 177 | productRefGroup = 66F5F14714DB3B300068FD20 /* Products */; 178 | projectDirPath = ""; 179 | projectReferences = ( 180 | { 181 | ProductGroup = 66F5F16214DB3B380068FD20 /* Products */; 182 | ProjectRef = 66F5F16114DB3B380068FD20 /* Serenity.xcodeproj */; 183 | }, 184 | ); 185 | projectRoot = ""; 186 | targets = ( 187 | 66F5F14514DB3B300068FD20 /* DependentApp */, 188 | ); 189 | }; 190 | /* End PBXProject section */ 191 | 192 | /* Begin PBXReferenceProxy section */ 193 | 664A26C614E3361500C297E6 /* Serenity.bundle */ = { 194 | isa = PBXReferenceProxy; 195 | fileType = wrapper.cfbundle; 196 | path = Serenity.bundle; 197 | remoteRef = 664A26C514E3361500C297E6 /* PBXContainerItemProxy */; 198 | sourceTree = BUILT_PRODUCTS_DIR; 199 | }; 200 | 66F5F16A14DB3B380068FD20 /* libSerenity.a */ = { 201 | isa = PBXReferenceProxy; 202 | fileType = archive.ar; 203 | path = libSerenity.a; 204 | remoteRef = 66F5F16914DB3B380068FD20 /* PBXContainerItemProxy */; 205 | sourceTree = BUILT_PRODUCTS_DIR; 206 | }; 207 | /* End PBXReferenceProxy section */ 208 | 209 | /* Begin PBXResourcesBuildPhase section */ 210 | 66F5F14414DB3B300068FD20 /* Resources */ = { 211 | isa = PBXResourcesBuildPhase; 212 | buildActionMask = 2147483647; 213 | files = ( 214 | 66F5F15514DB3B310068FD20 /* InfoPlist.strings in Resources */, 215 | 664A26E614E3417F00C297E6 /* Serenity.bundle in Resources */, 216 | ); 217 | runOnlyForDeploymentPostprocessing = 0; 218 | }; 219 | /* End PBXResourcesBuildPhase section */ 220 | 221 | /* Begin PBXSourcesBuildPhase section */ 222 | 66F5F14214DB3B300068FD20 /* Sources */ = { 223 | isa = PBXSourcesBuildPhase; 224 | buildActionMask = 2147483647; 225 | files = ( 226 | 66F5F15714DB3B310068FD20 /* main.m in Sources */, 227 | 66F5F15B14DB3B310068FD20 /* AppDelegate.m in Sources */, 228 | ); 229 | runOnlyForDeploymentPostprocessing = 0; 230 | }; 231 | /* End PBXSourcesBuildPhase section */ 232 | 233 | /* Begin PBXTargetDependency section */ 234 | 664A26E414E33A7500C297E6 /* PBXTargetDependency */ = { 235 | isa = PBXTargetDependency; 236 | name = SerenityResources; 237 | targetProxy = 664A26E314E33A7500C297E6 /* PBXContainerItemProxy */; 238 | }; 239 | 66F5F16E14DB3D0F0068FD20 /* PBXTargetDependency */ = { 240 | isa = PBXTargetDependency; 241 | name = Serenity; 242 | targetProxy = 66F5F16D14DB3D0F0068FD20 /* PBXContainerItemProxy */; 243 | }; 244 | /* End PBXTargetDependency section */ 245 | 246 | /* Begin PBXVariantGroup section */ 247 | 66F5F15314DB3B310068FD20 /* InfoPlist.strings */ = { 248 | isa = PBXVariantGroup; 249 | children = ( 250 | 66F5F15414DB3B310068FD20 /* en */, 251 | ); 252 | name = InfoPlist.strings; 253 | sourceTree = ""; 254 | }; 255 | /* End PBXVariantGroup section */ 256 | 257 | /* Begin XCBuildConfiguration section */ 258 | 66F5F15C14DB3B310068FD20 /* Debug */ = { 259 | isa = XCBuildConfiguration; 260 | buildSettings = { 261 | ALWAYS_SEARCH_USER_PATHS = NO; 262 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 263 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 264 | COPY_PHASE_STRIP = NO; 265 | GCC_C_LANGUAGE_STANDARD = gnu99; 266 | GCC_DYNAMIC_NO_PIC = NO; 267 | GCC_OPTIMIZATION_LEVEL = 0; 268 | GCC_PREPROCESSOR_DEFINITIONS = ( 269 | "DEBUG=1", 270 | "$(inherited)", 271 | ); 272 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 273 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 274 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 275 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 276 | GCC_WARN_UNUSED_VARIABLE = YES; 277 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 278 | SDKROOT = iphoneos; 279 | }; 280 | name = Debug; 281 | }; 282 | 66F5F15D14DB3B310068FD20 /* Release */ = { 283 | isa = XCBuildConfiguration; 284 | buildSettings = { 285 | ALWAYS_SEARCH_USER_PATHS = NO; 286 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 287 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 288 | COPY_PHASE_STRIP = YES; 289 | GCC_C_LANGUAGE_STANDARD = gnu99; 290 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 291 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 292 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 293 | GCC_WARN_UNUSED_VARIABLE = YES; 294 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 295 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 296 | SDKROOT = iphoneos; 297 | VALIDATE_PRODUCT = YES; 298 | }; 299 | name = Release; 300 | }; 301 | 66F5F15F14DB3B310068FD20 /* Debug */ = { 302 | isa = XCBuildConfiguration; 303 | buildSettings = { 304 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 305 | GCC_PREFIX_HEADER = "DependentApp/DependentApp-Prefix.pch"; 306 | INFOPLIST_FILE = "DependentApp/DependentApp-Info.plist"; 307 | PRODUCT_NAME = "$(TARGET_NAME)"; 308 | WRAPPER_EXTENSION = app; 309 | }; 310 | name = Debug; 311 | }; 312 | 66F5F16014DB3B310068FD20 /* Release */ = { 313 | isa = XCBuildConfiguration; 314 | buildSettings = { 315 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 316 | GCC_PREFIX_HEADER = "DependentApp/DependentApp-Prefix.pch"; 317 | INFOPLIST_FILE = "DependentApp/DependentApp-Info.plist"; 318 | PRODUCT_NAME = "$(TARGET_NAME)"; 319 | WRAPPER_EXTENSION = app; 320 | }; 321 | name = Release; 322 | }; 323 | /* End XCBuildConfiguration section */ 324 | 325 | /* Begin XCConfigurationList section */ 326 | 66F5F14014DB3B300068FD20 /* Build configuration list for PBXProject "DependentApp" */ = { 327 | isa = XCConfigurationList; 328 | buildConfigurations = ( 329 | 66F5F15C14DB3B310068FD20 /* Debug */, 330 | 66F5F15D14DB3B310068FD20 /* Release */, 331 | ); 332 | defaultConfigurationIsVisible = 0; 333 | defaultConfigurationName = Release; 334 | }; 335 | 66F5F15E14DB3B310068FD20 /* Build configuration list for PBXNativeTarget "DependentApp" */ = { 336 | isa = XCConfigurationList; 337 | buildConfigurations = ( 338 | 66F5F15F14DB3B310068FD20 /* Debug */, 339 | 66F5F16014DB3B310068FD20 /* Release */, 340 | ); 341 | defaultConfigurationIsVisible = 0; 342 | defaultConfigurationName = Release; 343 | }; 344 | /* End XCConfigurationList section */ 345 | }; 346 | rootObject = 66F5F13D14DB3B300068FD20 /* Project object */; 347 | } 348 | -------------------------------------------------------------------------------- /sample/DependentApp/DependentApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /sample/DependentApp/DependentApp/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Jeff Verkoeyen 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | 19 | @interface AppDelegate : UIResponder 20 | 21 | @property (strong, nonatomic) UIWindow *window; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /sample/DependentApp/DependentApp/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Jeff Verkoeyen 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import "AppDelegate.h" 18 | 19 | @implementation AppDelegate 20 | 21 | @synthesize window = _window; 22 | 23 | - (void)dealloc { 24 | [_window release]; 25 | 26 | [super dealloc]; 27 | } 28 | 29 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 30 | self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; 31 | 32 | // Just to prove that we can use code from the Serenity framework. 33 | Widget* widget = [[[Widget alloc] init] autorelease]; 34 | UIImage* image = widget.image; 35 | UIImageView* imageView = [[[UIImageView alloc] initWithImage:image] autorelease]; 36 | [self.window addSubview:imageView]; 37 | 38 | self.window.backgroundColor = [UIColor whiteColor]; 39 | [self.window makeKeyAndVisible]; 40 | return YES; 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /sample/DependentApp/DependentApp/DependentApp-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFiles 12 | 13 | CFBundleIdentifier 14 | jeffverkoeyen.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /sample/DependentApp/DependentApp/DependentApp-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Jeff Verkoeyen 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | 19 | #ifndef __IPHONE_4_0 20 | #warning "This project uses features only available in iOS SDK 4.0 and later." 21 | #endif 22 | 23 | #ifdef __OBJC__ 24 | #import 25 | #import 26 | #import 27 | #endif 28 | -------------------------------------------------------------------------------- /sample/DependentApp/DependentApp/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /sample/DependentApp/DependentApp/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Jeff Verkoeyen 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | 19 | #import "AppDelegate.h" 20 | 21 | int main(int argc, char *argv[]) 22 | { 23 | @autoreleasepool { 24 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sample/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /sample/NOTICE: -------------------------------------------------------------------------------- 1 | 2 | Copyright 2012 Jeff Verkoeyen 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | See the AUTHORS and DONORS files for more information about Nimbus 17 | contributors. -------------------------------------------------------------------------------- /sample/Serenity/Serenity.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXAggregateTarget section */ 10 | 66F5F13314DB195B0068FD20 /* Framework */ = { 11 | isa = PBXAggregateTarget; 12 | buildConfigurationList = 66F5F13614DB195B0068FD20 /* Build configuration list for PBXAggregateTarget "Framework" */; 13 | buildPhases = ( 14 | 66F5F13A14DB19B20068FD20 /* Build Framework */, 15 | ); 16 | dependencies = ( 17 | 664A26AC14E330B700C297E6 /* PBXTargetDependency */, 18 | 66F5F13914DB19940068FD20 /* PBXTargetDependency */, 19 | ); 20 | name = Framework; 21 | productName = Framework; 22 | }; 23 | /* End PBXAggregateTarget section */ 24 | 25 | /* Begin PBXBuildFile section */ 26 | 664A269614E3265400C297E6 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 664A268414E3222700C297E6 /* CoreFoundation.framework */; }; 27 | 664A269C14E3265400C297E6 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 664A269A14E3265400C297E6 /* InfoPlist.strings */; }; 28 | 664A26A614E32B7500C297E6 /* linker.png in Resources */ = {isa = PBXBuildFile; fileRef = 664A26A514E32B7500C297E6 /* linker.png */; }; 29 | 664A26A914E32C4100C297E6 /* SimpleView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 664A26A814E32C4100C297E6 /* SimpleView.xib */; }; 30 | 66E8B6D714D899500074EAA4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66E8B6D614D899500074EAA4 /* Foundation.framework */; }; 31 | 66E8B6E314D89CCE0074EAA4 /* Serenity.h in Headers */ = {isa = PBXBuildFile; fileRef = 66E8B6DB14D899500074EAA4 /* Serenity.h */; settings = {ATTRIBUTES = (Public, ); }; }; 32 | 66E8B6E614D89FBE0074EAA4 /* Widget.h in Headers */ = {isa = PBXBuildFile; fileRef = 66E8B6E414D89FBE0074EAA4 /* Widget.h */; settings = {ATTRIBUTES = (Public, ); }; }; 33 | 66E8B6E714D89FBE0074EAA4 /* Widget.m in Sources */ = {isa = PBXBuildFile; fileRef = 66E8B6E514D89FBE0074EAA4 /* Widget.m */; }; 34 | /* End PBXBuildFile section */ 35 | 36 | /* Begin PBXContainerItemProxy section */ 37 | 664A26AB14E330B700C297E6 /* PBXContainerItemProxy */ = { 38 | isa = PBXContainerItemProxy; 39 | containerPortal = 66E8B6CA14D899500074EAA4 /* Project object */; 40 | proxyType = 1; 41 | remoteGlobalIDString = 664A269414E3265400C297E6; 42 | remoteInfo = SerenityResources; 43 | }; 44 | 66F5F13814DB19940068FD20 /* PBXContainerItemProxy */ = { 45 | isa = PBXContainerItemProxy; 46 | containerPortal = 66E8B6CA14D899500074EAA4 /* Project object */; 47 | proxyType = 1; 48 | remoteGlobalIDString = 66E8B6D214D899500074EAA4; 49 | remoteInfo = Serenity; 50 | }; 51 | /* End PBXContainerItemProxy section */ 52 | 53 | /* Begin PBXFileReference section */ 54 | 664A268414E3222700C297E6 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; 55 | 664A269514E3265400C297E6 /* Serenity.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Serenity.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | 664A269914E3265400C297E6 /* SerenityResources-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SerenityResources-Info.plist"; sourceTree = ""; }; 57 | 664A269B14E3265400C297E6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 58 | 664A26A514E32B7500C297E6 /* linker.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = linker.png; path = ../../../gfx/linker.png; sourceTree = ""; }; 59 | 664A26A814E32C4100C297E6 /* SimpleView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SimpleView.xib; sourceTree = ""; }; 60 | 66E8B6D314D899500074EAA4 /* libSerenity.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libSerenity.a; sourceTree = BUILT_PRODUCTS_DIR; }; 61 | 66E8B6D614D899500074EAA4 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 62 | 66E8B6DA14D899500074EAA4 /* Serenity-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Serenity-Prefix.pch"; sourceTree = ""; }; 63 | 66E8B6DB14D899500074EAA4 /* Serenity.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Serenity.h; sourceTree = ""; }; 64 | 66E8B6E414D89FBE0074EAA4 /* Widget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Widget.h; sourceTree = ""; }; 65 | 66E8B6E514D89FBE0074EAA4 /* Widget.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Widget.m; sourceTree = ""; }; 66 | /* End PBXFileReference section */ 67 | 68 | /* Begin PBXFrameworksBuildPhase section */ 69 | 664A269214E3265400C297E6 /* Frameworks */ = { 70 | isa = PBXFrameworksBuildPhase; 71 | buildActionMask = 2147483647; 72 | files = ( 73 | 664A269614E3265400C297E6 /* CoreFoundation.framework in Frameworks */, 74 | ); 75 | runOnlyForDeploymentPostprocessing = 0; 76 | }; 77 | 66E8B6D014D899500074EAA4 /* Frameworks */ = { 78 | isa = PBXFrameworksBuildPhase; 79 | buildActionMask = 2147483647; 80 | files = ( 81 | 66E8B6D714D899500074EAA4 /* Foundation.framework in Frameworks */, 82 | ); 83 | runOnlyForDeploymentPostprocessing = 0; 84 | }; 85 | /* End PBXFrameworksBuildPhase section */ 86 | 87 | /* Begin PBXGroup section */ 88 | 664A269714E3265400C297E6 /* SerenityResources */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | 664A26A514E32B7500C297E6 /* linker.png */, 92 | 664A26A814E32C4100C297E6 /* SimpleView.xib */, 93 | 664A26A714E32C0A00C297E6 /* English */, 94 | 664A269914E3265400C297E6 /* SerenityResources-Info.plist */, 95 | ); 96 | path = SerenityResources; 97 | sourceTree = ""; 98 | }; 99 | 664A26A714E32C0A00C297E6 /* English */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 664A269A14E3265400C297E6 /* InfoPlist.strings */, 103 | ); 104 | name = English; 105 | sourceTree = ""; 106 | }; 107 | 66E8B6C814D899500074EAA4 = { 108 | isa = PBXGroup; 109 | children = ( 110 | 66E8B6D814D899500074EAA4 /* Serenity */, 111 | 664A269714E3265400C297E6 /* SerenityResources */, 112 | 66E8B6D514D899500074EAA4 /* Frameworks */, 113 | 66E8B6D414D899500074EAA4 /* Products */, 114 | ); 115 | sourceTree = ""; 116 | }; 117 | 66E8B6D414D899500074EAA4 /* Products */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 66E8B6D314D899500074EAA4 /* libSerenity.a */, 121 | 664A269514E3265400C297E6 /* Serenity.bundle */, 122 | ); 123 | name = Products; 124 | sourceTree = ""; 125 | }; 126 | 66E8B6D514D899500074EAA4 /* Frameworks */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 66E8B6D614D899500074EAA4 /* Foundation.framework */, 130 | 664A268414E3222700C297E6 /* CoreFoundation.framework */, 131 | ); 132 | name = Frameworks; 133 | sourceTree = ""; 134 | }; 135 | 66E8B6D814D899500074EAA4 /* Serenity */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 66E8B6DA14D899500074EAA4 /* Serenity-Prefix.pch */, 139 | 66E8B6DB14D899500074EAA4 /* Serenity.h */, 140 | 66E8B6E414D89FBE0074EAA4 /* Widget.h */, 141 | 66E8B6E514D89FBE0074EAA4 /* Widget.m */, 142 | ); 143 | path = Serenity; 144 | sourceTree = ""; 145 | }; 146 | /* End PBXGroup section */ 147 | 148 | /* Begin PBXHeadersBuildPhase section */ 149 | 66E8B6D114D899500074EAA4 /* Headers */ = { 150 | isa = PBXHeadersBuildPhase; 151 | buildActionMask = 2147483647; 152 | files = ( 153 | 66E8B6E314D89CCE0074EAA4 /* Serenity.h in Headers */, 154 | 66E8B6E614D89FBE0074EAA4 /* Widget.h in Headers */, 155 | ); 156 | runOnlyForDeploymentPostprocessing = 0; 157 | }; 158 | /* End PBXHeadersBuildPhase section */ 159 | 160 | /* Begin PBXNativeTarget section */ 161 | 664A269414E3265400C297E6 /* SerenityResources */ = { 162 | isa = PBXNativeTarget; 163 | buildConfigurationList = 664A269E14E3265400C297E6 /* Build configuration list for PBXNativeTarget "SerenityResources" */; 164 | buildPhases = ( 165 | 664A269114E3265400C297E6 /* Sources */, 166 | 664A269214E3265400C297E6 /* Frameworks */, 167 | 664A269314E3265400C297E6 /* Resources */, 168 | ); 169 | buildRules = ( 170 | ); 171 | dependencies = ( 172 | ); 173 | name = SerenityResources; 174 | productName = SerenityResources; 175 | productReference = 664A269514E3265400C297E6 /* Serenity.bundle */; 176 | productType = "com.apple.product-type.bundle"; 177 | }; 178 | 66E8B6D214D899500074EAA4 /* Serenity */ = { 179 | isa = PBXNativeTarget; 180 | buildConfigurationList = 66E8B6E014D899500074EAA4 /* Build configuration list for PBXNativeTarget "Serenity" */; 181 | buildPhases = ( 182 | 66E8B6CF14D899500074EAA4 /* Sources */, 183 | 66E8B6D014D899500074EAA4 /* Frameworks */, 184 | 66E8B6D114D899500074EAA4 /* Headers */, 185 | 66E8B6E814D8A4D10074EAA4 /* Prepare Framework */, 186 | ); 187 | buildRules = ( 188 | ); 189 | dependencies = ( 190 | ); 191 | name = Serenity; 192 | productName = Serenity; 193 | productReference = 66E8B6D314D899500074EAA4 /* libSerenity.a */; 194 | productType = "com.apple.product-type.library.static"; 195 | }; 196 | /* End PBXNativeTarget section */ 197 | 198 | /* Begin PBXProject section */ 199 | 66E8B6CA14D899500074EAA4 /* Project object */ = { 200 | isa = PBXProject; 201 | attributes = { 202 | LastUpgradeCheck = 0420; 203 | ORGANIZATIONNAME = Google; 204 | }; 205 | buildConfigurationList = 66E8B6CD14D899500074EAA4 /* Build configuration list for PBXProject "Serenity" */; 206 | compatibilityVersion = "Xcode 3.2"; 207 | developmentRegion = English; 208 | hasScannedForEncodings = 0; 209 | knownRegions = ( 210 | en, 211 | ); 212 | mainGroup = 66E8B6C814D899500074EAA4; 213 | productRefGroup = 66E8B6D414D899500074EAA4 /* Products */; 214 | projectDirPath = ""; 215 | projectRoot = ""; 216 | targets = ( 217 | 66E8B6D214D899500074EAA4 /* Serenity */, 218 | 664A269414E3265400C297E6 /* SerenityResources */, 219 | 66F5F13314DB195B0068FD20 /* Framework */, 220 | ); 221 | }; 222 | /* End PBXProject section */ 223 | 224 | /* Begin PBXResourcesBuildPhase section */ 225 | 664A269314E3265400C297E6 /* Resources */ = { 226 | isa = PBXResourcesBuildPhase; 227 | buildActionMask = 2147483647; 228 | files = ( 229 | 664A269C14E3265400C297E6 /* InfoPlist.strings in Resources */, 230 | 664A26A614E32B7500C297E6 /* linker.png in Resources */, 231 | 664A26A914E32C4100C297E6 /* SimpleView.xib in Resources */, 232 | ); 233 | runOnlyForDeploymentPostprocessing = 0; 234 | }; 235 | /* End PBXResourcesBuildPhase section */ 236 | 237 | /* Begin PBXShellScriptBuildPhase section */ 238 | 66E8B6E814D8A4D10074EAA4 /* Prepare Framework */ = { 239 | isa = PBXShellScriptBuildPhase; 240 | buildActionMask = 2147483647; 241 | files = ( 242 | ); 243 | inputPaths = ( 244 | ); 245 | name = "Prepare Framework"; 246 | outputPaths = ( 247 | ); 248 | runOnlyForDeploymentPostprocessing = 0; 249 | shellPath = /bin/sh; 250 | shellScript = "set -e\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/${FRAMEWORK_VERSION}/Headers\"\n\n# Link the \"Current\" version to \"${FRAMEWORK_VERSION}\"\nln -sfh ${FRAMEWORK_VERSION} \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/Current\"\nln -sfh Versions/Current/Headers \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Headers\"\nln -sfh \"Versions/Current/${PRODUCT_NAME}\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/${PRODUCT_NAME}\"\n\n# The -a ensures that the headers maintain the source modification date so that we don't constantly\n# cause propagating rebuilds of files that import these headers.\ncp -a \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/\" \"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/${FRAMEWORK_VERSION}/Headers\"\n"; 251 | }; 252 | 66F5F13A14DB19B20068FD20 /* Build Framework */ = { 253 | isa = PBXShellScriptBuildPhase; 254 | buildActionMask = 2147483647; 255 | files = ( 256 | ); 257 | inputPaths = ( 258 | ); 259 | name = "Build Framework"; 260 | outputPaths = ( 261 | ); 262 | runOnlyForDeploymentPostprocessing = 0; 263 | shellPath = /bin/sh; 264 | shellScript = "set -e\nset +u\n# Avoid recursively calling this script.\nif [[ $SF_MASTER_SCRIPT_RUNNING ]]\nthen\n exit 0\nfi\nset -u\nexport SF_MASTER_SCRIPT_RUNNING=1\n\nSF_TARGET_NAME=${PROJECT_NAME}\nSF_EXECUTABLE_PATH=\"lib${SF_TARGET_NAME}.a\"\nSF_WRAPPER_NAME=\"${SF_TARGET_NAME}.framework\"\n\n# The following conditionals come from\n# https://github.com/kstenerud/iOS-Universal-Framework\n\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]\nthen\n SF_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\n echo \"Could not find platform name from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]\nthen\n SF_SDK_VERSION=${BASH_REMATCH[1]}\nelse\n echo \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\n exit 1\nfi\n\nif [[ \"$SF_SDK_PLATFORM\" = \"iphoneos\" ]]\nthen\n SF_OTHER_PLATFORM=iphonesimulator\nelse\n SF_OTHER_PLATFORM=iphoneos\nfi\n\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$SF_SDK_PLATFORM$ ]]\nthen\n SF_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${SF_OTHER_PLATFORM}\"\nelse\n echo \"Could not find platform name from build products directory: $BUILT_PRODUCTS_DIR\"\n exit 1\nfi\n\n# Build the other platform.\nxcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${SF_OTHER_PLATFORM}${SF_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" OBJROOT=\"${OBJROOT}\" BUILD_ROOT=\"${BUILD_ROOT}\" SYMROOT=\"${SYMROOT}\" $ACTION\n\n# Smash the two static libraries into one fat binary and store it in the .framework\nlipo -create \"${BUILT_PRODUCTS_DIR}/${SF_EXECUTABLE_PATH}\" \"${SF_OTHER_BUILT_PRODUCTS_DIR}/${SF_EXECUTABLE_PATH}\" -output \"${BUILT_PRODUCTS_DIR}/${SF_WRAPPER_NAME}/Versions/${FRAMEWORK_VERSION}/${SF_TARGET_NAME}\"\n\n# Copy the binary to the other architecture folder to have a complete framework in both.\ncp -a \"${BUILT_PRODUCTS_DIR}/${SF_WRAPPER_NAME}/Versions/${FRAMEWORK_VERSION}/${SF_TARGET_NAME}\" \"${SF_OTHER_BUILT_PRODUCTS_DIR}/${SF_WRAPPER_NAME}/Versions/${FRAMEWORK_VERSION}/${SF_TARGET_NAME}\"\n"; 265 | }; 266 | /* End PBXShellScriptBuildPhase section */ 267 | 268 | /* Begin PBXSourcesBuildPhase section */ 269 | 664A269114E3265400C297E6 /* Sources */ = { 270 | isa = PBXSourcesBuildPhase; 271 | buildActionMask = 2147483647; 272 | files = ( 273 | ); 274 | runOnlyForDeploymentPostprocessing = 0; 275 | }; 276 | 66E8B6CF14D899500074EAA4 /* Sources */ = { 277 | isa = PBXSourcesBuildPhase; 278 | buildActionMask = 2147483647; 279 | files = ( 280 | 66E8B6E714D89FBE0074EAA4 /* Widget.m in Sources */, 281 | ); 282 | runOnlyForDeploymentPostprocessing = 0; 283 | }; 284 | /* End PBXSourcesBuildPhase section */ 285 | 286 | /* Begin PBXTargetDependency section */ 287 | 664A26AC14E330B700C297E6 /* PBXTargetDependency */ = { 288 | isa = PBXTargetDependency; 289 | target = 664A269414E3265400C297E6 /* SerenityResources */; 290 | targetProxy = 664A26AB14E330B700C297E6 /* PBXContainerItemProxy */; 291 | }; 292 | 66F5F13914DB19940068FD20 /* PBXTargetDependency */ = { 293 | isa = PBXTargetDependency; 294 | target = 66E8B6D214D899500074EAA4 /* Serenity */; 295 | targetProxy = 66F5F13814DB19940068FD20 /* PBXContainerItemProxy */; 296 | }; 297 | /* End PBXTargetDependency section */ 298 | 299 | /* Begin PBXVariantGroup section */ 300 | 664A269A14E3265400C297E6 /* InfoPlist.strings */ = { 301 | isa = PBXVariantGroup; 302 | children = ( 303 | 664A269B14E3265400C297E6 /* en */, 304 | ); 305 | name = InfoPlist.strings; 306 | sourceTree = ""; 307 | }; 308 | /* End PBXVariantGroup section */ 309 | 310 | /* Begin XCBuildConfiguration section */ 311 | 664A269F14E3265400C297E6 /* Debug */ = { 312 | isa = XCBuildConfiguration; 313 | buildSettings = { 314 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 315 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 316 | INFOPLIST_FILE = "SerenityResources/SerenityResources-Info.plist"; 317 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; 318 | MACOSX_DEPLOYMENT_TARGET = 10.6; 319 | PRODUCT_NAME = Serenity; 320 | SKIP_INSTALL = YES; 321 | WRAPPER_EXTENSION = bundle; 322 | }; 323 | name = Debug; 324 | }; 325 | 664A26A014E3265400C297E6 /* Release */ = { 326 | isa = XCBuildConfiguration; 327 | buildSettings = { 328 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 329 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 330 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 331 | INFOPLIST_FILE = "SerenityResources/SerenityResources-Info.plist"; 332 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; 333 | MACOSX_DEPLOYMENT_TARGET = 10.6; 334 | PRODUCT_NAME = Serenity; 335 | SKIP_INSTALL = YES; 336 | WRAPPER_EXTENSION = bundle; 337 | }; 338 | name = Release; 339 | }; 340 | 66E8B6DE14D899500074EAA4 /* Debug */ = { 341 | isa = XCBuildConfiguration; 342 | buildSettings = { 343 | ALWAYS_SEARCH_USER_PATHS = NO; 344 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 345 | COPY_PHASE_STRIP = NO; 346 | GCC_C_LANGUAGE_STANDARD = gnu99; 347 | GCC_DYNAMIC_NO_PIC = NO; 348 | GCC_OPTIMIZATION_LEVEL = 0; 349 | GCC_PREPROCESSOR_DEFINITIONS = ( 350 | "DEBUG=1", 351 | "$(inherited)", 352 | ); 353 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 354 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 355 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 356 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 357 | GCC_WARN_UNUSED_VARIABLE = YES; 358 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 359 | SDKROOT = iphoneos; 360 | }; 361 | name = Debug; 362 | }; 363 | 66E8B6DF14D899500074EAA4 /* Release */ = { 364 | isa = XCBuildConfiguration; 365 | buildSettings = { 366 | ALWAYS_SEARCH_USER_PATHS = NO; 367 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 368 | COPY_PHASE_STRIP = YES; 369 | GCC_C_LANGUAGE_STANDARD = gnu99; 370 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 371 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 372 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 373 | GCC_WARN_UNUSED_VARIABLE = YES; 374 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 375 | SDKROOT = iphoneos; 376 | VALIDATE_PRODUCT = YES; 377 | }; 378 | name = Release; 379 | }; 380 | 66E8B6E114D899500074EAA4 /* Debug */ = { 381 | isa = XCBuildConfiguration; 382 | buildSettings = { 383 | COPY_PHASE_STRIP = NO; 384 | DEAD_CODE_STRIPPING = NO; 385 | DSTROOT = /tmp/Serenity.dst; 386 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 387 | GCC_PREFIX_HEADER = "Serenity/Serenity-Prefix.pch"; 388 | OTHER_LDFLAGS = "-ObjC"; 389 | PRODUCT_NAME = "$(TARGET_NAME)"; 390 | PUBLIC_HEADERS_FOLDER_PATH = "$(PROJECT_NAME)Headers"; 391 | SKIP_INSTALL = YES; 392 | STRIP_STYLE = "non-global"; 393 | }; 394 | name = Debug; 395 | }; 396 | 66E8B6E214D899500074EAA4 /* Release */ = { 397 | isa = XCBuildConfiguration; 398 | buildSettings = { 399 | COPY_PHASE_STRIP = NO; 400 | DEAD_CODE_STRIPPING = NO; 401 | DSTROOT = /tmp/Serenity.dst; 402 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 403 | GCC_PREFIX_HEADER = "Serenity/Serenity-Prefix.pch"; 404 | OTHER_LDFLAGS = "-ObjC"; 405 | PRODUCT_NAME = "$(TARGET_NAME)"; 406 | PUBLIC_HEADERS_FOLDER_PATH = "$(PROJECT_NAME)Headers"; 407 | SKIP_INSTALL = YES; 408 | STRIP_STYLE = "non-global"; 409 | }; 410 | name = Release; 411 | }; 412 | 66F5F13414DB195B0068FD20 /* Debug */ = { 413 | isa = XCBuildConfiguration; 414 | buildSettings = { 415 | PRODUCT_NAME = "$(TARGET_NAME)"; 416 | }; 417 | name = Debug; 418 | }; 419 | 66F5F13514DB195B0068FD20 /* Release */ = { 420 | isa = XCBuildConfiguration; 421 | buildSettings = { 422 | PRODUCT_NAME = "$(TARGET_NAME)"; 423 | }; 424 | name = Release; 425 | }; 426 | /* End XCBuildConfiguration section */ 427 | 428 | /* Begin XCConfigurationList section */ 429 | 664A269E14E3265400C297E6 /* Build configuration list for PBXNativeTarget "SerenityResources" */ = { 430 | isa = XCConfigurationList; 431 | buildConfigurations = ( 432 | 664A269F14E3265400C297E6 /* Debug */, 433 | 664A26A014E3265400C297E6 /* Release */, 434 | ); 435 | defaultConfigurationIsVisible = 0; 436 | defaultConfigurationName = Release; 437 | }; 438 | 66E8B6CD14D899500074EAA4 /* Build configuration list for PBXProject "Serenity" */ = { 439 | isa = XCConfigurationList; 440 | buildConfigurations = ( 441 | 66E8B6DE14D899500074EAA4 /* Debug */, 442 | 66E8B6DF14D899500074EAA4 /* Release */, 443 | ); 444 | defaultConfigurationIsVisible = 0; 445 | defaultConfigurationName = Release; 446 | }; 447 | 66E8B6E014D899500074EAA4 /* Build configuration list for PBXNativeTarget "Serenity" */ = { 448 | isa = XCConfigurationList; 449 | buildConfigurations = ( 450 | 66E8B6E114D899500074EAA4 /* Debug */, 451 | 66E8B6E214D899500074EAA4 /* Release */, 452 | ); 453 | defaultConfigurationIsVisible = 0; 454 | defaultConfigurationName = Release; 455 | }; 456 | 66F5F13614DB195B0068FD20 /* Build configuration list for PBXAggregateTarget "Framework" */ = { 457 | isa = XCConfigurationList; 458 | buildConfigurations = ( 459 | 66F5F13414DB195B0068FD20 /* Debug */, 460 | 66F5F13514DB195B0068FD20 /* Release */, 461 | ); 462 | defaultConfigurationIsVisible = 0; 463 | defaultConfigurationName = Release; 464 | }; 465 | /* End XCConfigurationList section */ 466 | }; 467 | rootObject = 66E8B6CA14D899500074EAA4 /* Project object */; 468 | } 469 | -------------------------------------------------------------------------------- /sample/Serenity/Serenity.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /sample/Serenity/Serenity/Serenity-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Jeff Verkoeyen 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #ifdef __OBJC__ 18 | #import 19 | #endif 20 | -------------------------------------------------------------------------------- /sample/Serenity/Serenity/Serenity.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Jeff Verkoeyen 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | 19 | #import 20 | -------------------------------------------------------------------------------- /sample/Serenity/Serenity/Widget.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Jeff Verkoeyen 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | #import 19 | 20 | @interface Widget : NSObject 21 | 22 | - (UIImage *)image; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /sample/Serenity/Serenity/Widget.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Jeff Verkoeyen 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import "Widget.h" 18 | 19 | @implementation Widget 20 | 21 | + (NSBundle *)frameworkBundle { 22 | static NSBundle* frameworkBundle = nil; 23 | static dispatch_once_t predicate; 24 | dispatch_once(&predicate, ^{ 25 | NSString* mainBundlePath = [[NSBundle mainBundle] resourcePath]; 26 | NSString* frameworkBundlePath = [mainBundlePath stringByAppendingPathComponent:@"Serenity.bundle"]; 27 | frameworkBundle = [[NSBundle bundleWithPath:frameworkBundlePath] retain]; 28 | }); 29 | return frameworkBundle; 30 | } 31 | 32 | - (UIImage *)image { 33 | return [UIImage imageWithContentsOfFile:[[[self class] frameworkBundle] pathForResource:@"linker" ofType:@"png"]]; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /sample/Serenity/SerenityResources/SerenityResources-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | jeffverkoeyen.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | BNDL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | CFPlugInDynamicRegisterFunction 26 | 27 | CFPlugInDynamicRegistration 28 | NO 29 | CFPlugInFactories 30 | 31 | 00000000-0000-0000-0000-000000000000 32 | MyFactoryFunction 33 | 34 | CFPlugInTypes 35 | 36 | 00000000-0000-0000-0000-000000000000 37 | 38 | 00000000-0000-0000-0000-000000000000 39 | 40 | 41 | CFPlugInUnloadFunction 42 | 43 | NSHumanReadableCopyright 44 | Copyright © 2012 Jeff Verkoeyen. All rights reserved. 45 | 46 | 47 | -------------------------------------------------------------------------------- /sample/Serenity/SerenityResources/SimpleView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1280 5 | 10K549 6 | 1934 7 | 1038.36 8 | 461.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 931 12 | 13 | 14 | IBProxyObject 15 | IBUIView 16 | IBUILabel 17 | 18 | 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | PluginDependencyRecalculationVersion 23 | 24 | 25 | 26 | 27 | IBFilesOwner 28 | IBCocoaTouchFramework 29 | 30 | 31 | IBFirstResponder 32 | IBCocoaTouchFramework 33 | 34 | 35 | 36 | 274 37 | 38 | 39 | 40 | 292 41 | {{126, 219}, {69, 21}} 42 | 43 | 44 | 45 | NO 46 | YES 47 | 7 48 | NO 49 | IBCocoaTouchFramework 50 | Serenity 51 | 52 | 1 53 | MCAwIDAAA 54 | 55 | 56 | 1 57 | 10 58 | 59 | 1 60 | 17 61 | 62 | 63 | Helvetica 64 | 17 65 | 16 66 | 67 | 68 | 69 | {{0, 20}, {320, 460}} 70 | 71 | 72 | 73 | 74 | 3 75 | MQA 76 | 77 | 2 78 | 79 | 80 | 81 | IBCocoaTouchFramework 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 0 90 | 91 | 92 | 93 | 94 | 95 | 1 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | -1 104 | 105 | 106 | File's Owner 107 | 108 | 109 | -2 110 | 111 | 112 | 113 | 114 | 3 115 | 116 | 117 | 118 | 119 | 120 | 121 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 122 | UIResponder 123 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 124 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 125 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 126 | 127 | 128 | 129 | 130 | 131 | 3 132 | 133 | 134 | 0 135 | IBCocoaTouchFramework 136 | YES 137 | 3 138 | 931 139 | 140 | 141 | -------------------------------------------------------------------------------- /sample/Serenity/SerenityResources/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /sample/ThirdParty/Serenity.bundle/Contents/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/sample/ThirdParty/Serenity.bundle/Contents/Info.plist -------------------------------------------------------------------------------- /sample/ThirdParty/Serenity.bundle/Contents/Resources/SimpleView.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/sample/ThirdParty/Serenity.bundle/Contents/Resources/SimpleView.nib -------------------------------------------------------------------------------- /sample/ThirdParty/Serenity.bundle/Contents/Resources/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/sample/ThirdParty/Serenity.bundle/Contents/Resources/en.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /sample/ThirdParty/Serenity.bundle/Contents/Resources/linker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/sample/ThirdParty/Serenity.bundle/Contents/Resources/linker.png -------------------------------------------------------------------------------- /sample/ThirdParty/Serenity.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /sample/ThirdParty/Serenity.framework/Serenity: -------------------------------------------------------------------------------- 1 | Versions/Current/Serenity -------------------------------------------------------------------------------- /sample/ThirdParty/Serenity.framework/Versions/A/Headers/Serenity.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Jeff Verkoeyen 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | 19 | #import 20 | -------------------------------------------------------------------------------- /sample/ThirdParty/Serenity.framework/Versions/A/Headers/Widget.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Jeff Verkoeyen 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | #import 19 | 20 | @interface Widget : NSObject 21 | 22 | - (UIImage *)image; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /sample/ThirdParty/Serenity.framework/Versions/A/Serenity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jverkoey/iOS-Framework/b0285526e29e45d1491bb40d26e4be8b833a8084/sample/ThirdParty/Serenity.framework/Versions/A/Serenity -------------------------------------------------------------------------------- /sample/ThirdParty/Serenity.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /sample/ThirdParty/ThirdParty.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 664A26B514E334EF00C297E6 /* Serenity.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 664A26B414E334EF00C297E6 /* Serenity.bundle */; }; 11 | 66F5F18014DB420E0068FD20 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66F5F17F14DB420E0068FD20 /* UIKit.framework */; }; 12 | 66F5F18214DB420E0068FD20 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66F5F18114DB420E0068FD20 /* Foundation.framework */; }; 13 | 66F5F18414DB420E0068FD20 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66F5F18314DB420E0068FD20 /* CoreGraphics.framework */; }; 14 | 66F5F18A14DB420E0068FD20 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 66F5F18814DB420E0068FD20 /* InfoPlist.strings */; }; 15 | 66F5F18C14DB420E0068FD20 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 66F5F18B14DB420E0068FD20 /* main.m */; }; 16 | 66F5F19014DB420E0068FD20 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 66F5F18F14DB420E0068FD20 /* AppDelegate.m */; }; 17 | 66F5F19A14DB43C20068FD20 /* Serenity.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66F5F19914DB43C20068FD20 /* Serenity.framework */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | 664A26B414E334EF00C297E6 /* Serenity.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Serenity.bundle; sourceTree = SOURCE_ROOT; }; 22 | 66F5F17B14DB420E0068FD20 /* ThirdParty.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ThirdParty.app; sourceTree = BUILT_PRODUCTS_DIR; }; 23 | 66F5F17F14DB420E0068FD20 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 24 | 66F5F18114DB420E0068FD20 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 25 | 66F5F18314DB420E0068FD20 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 26 | 66F5F18714DB420E0068FD20 /* ThirdParty-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ThirdParty-Info.plist"; sourceTree = ""; }; 27 | 66F5F18914DB420E0068FD20 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 28 | 66F5F18B14DB420E0068FD20 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 29 | 66F5F18D14DB420E0068FD20 /* ThirdParty-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ThirdParty-Prefix.pch"; sourceTree = ""; }; 30 | 66F5F18E14DB420E0068FD20 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 31 | 66F5F18F14DB420E0068FD20 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 32 | 66F5F19914DB43C20068FD20 /* Serenity.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Serenity.framework; sourceTree = ""; }; 33 | /* End PBXFileReference section */ 34 | 35 | /* Begin PBXFrameworksBuildPhase section */ 36 | 66F5F17814DB420E0068FD20 /* Frameworks */ = { 37 | isa = PBXFrameworksBuildPhase; 38 | buildActionMask = 2147483647; 39 | files = ( 40 | 66F5F18014DB420E0068FD20 /* UIKit.framework in Frameworks */, 41 | 66F5F18214DB420E0068FD20 /* Foundation.framework in Frameworks */, 42 | 66F5F18414DB420E0068FD20 /* CoreGraphics.framework in Frameworks */, 43 | 66F5F19A14DB43C20068FD20 /* Serenity.framework in Frameworks */, 44 | ); 45 | runOnlyForDeploymentPostprocessing = 0; 46 | }; 47 | /* End PBXFrameworksBuildPhase section */ 48 | 49 | /* Begin PBXGroup section */ 50 | 66F5F17014DB420E0068FD20 = { 51 | isa = PBXGroup; 52 | children = ( 53 | 66F5F18514DB420E0068FD20 /* ThirdParty */, 54 | 66F5F17E14DB420E0068FD20 /* Frameworks */, 55 | 66F5F17C14DB420E0068FD20 /* Products */, 56 | ); 57 | sourceTree = ""; 58 | }; 59 | 66F5F17C14DB420E0068FD20 /* Products */ = { 60 | isa = PBXGroup; 61 | children = ( 62 | 66F5F17B14DB420E0068FD20 /* ThirdParty.app */, 63 | ); 64 | name = Products; 65 | sourceTree = ""; 66 | }; 67 | 66F5F17E14DB420E0068FD20 /* Frameworks */ = { 68 | isa = PBXGroup; 69 | children = ( 70 | 66F5F19914DB43C20068FD20 /* Serenity.framework */, 71 | 66F5F17F14DB420E0068FD20 /* UIKit.framework */, 72 | 66F5F18114DB420E0068FD20 /* Foundation.framework */, 73 | 66F5F18314DB420E0068FD20 /* CoreGraphics.framework */, 74 | ); 75 | name = Frameworks; 76 | sourceTree = ""; 77 | }; 78 | 66F5F18514DB420E0068FD20 /* ThirdParty */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 66F5F18E14DB420E0068FD20 /* AppDelegate.h */, 82 | 66F5F18F14DB420E0068FD20 /* AppDelegate.m */, 83 | 66F5F18614DB420E0068FD20 /* Supporting Files */, 84 | 664A26B414E334EF00C297E6 /* Serenity.bundle */, 85 | ); 86 | path = ThirdParty; 87 | sourceTree = ""; 88 | }; 89 | 66F5F18614DB420E0068FD20 /* Supporting Files */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | 66F5F18714DB420E0068FD20 /* ThirdParty-Info.plist */, 93 | 66F5F18814DB420E0068FD20 /* InfoPlist.strings */, 94 | 66F5F18B14DB420E0068FD20 /* main.m */, 95 | 66F5F18D14DB420E0068FD20 /* ThirdParty-Prefix.pch */, 96 | ); 97 | name = "Supporting Files"; 98 | sourceTree = ""; 99 | }; 100 | /* End PBXGroup section */ 101 | 102 | /* Begin PBXNativeTarget section */ 103 | 66F5F17A14DB420E0068FD20 /* ThirdParty */ = { 104 | isa = PBXNativeTarget; 105 | buildConfigurationList = 66F5F19314DB420E0068FD20 /* Build configuration list for PBXNativeTarget "ThirdParty" */; 106 | buildPhases = ( 107 | 66F5F17714DB420E0068FD20 /* Sources */, 108 | 66F5F17814DB420E0068FD20 /* Frameworks */, 109 | 66F5F17914DB420E0068FD20 /* Resources */, 110 | ); 111 | buildRules = ( 112 | ); 113 | dependencies = ( 114 | ); 115 | name = ThirdParty; 116 | productName = ThirdParty; 117 | productReference = 66F5F17B14DB420E0068FD20 /* ThirdParty.app */; 118 | productType = "com.apple.product-type.application"; 119 | }; 120 | /* End PBXNativeTarget section */ 121 | 122 | /* Begin PBXProject section */ 123 | 66F5F17214DB420E0068FD20 /* Project object */ = { 124 | isa = PBXProject; 125 | attributes = { 126 | LastUpgradeCheck = 0420; 127 | ORGANIZATIONNAME = Google; 128 | }; 129 | buildConfigurationList = 66F5F17514DB420E0068FD20 /* Build configuration list for PBXProject "ThirdParty" */; 130 | compatibilityVersion = "Xcode 3.2"; 131 | developmentRegion = English; 132 | hasScannedForEncodings = 0; 133 | knownRegions = ( 134 | en, 135 | ); 136 | mainGroup = 66F5F17014DB420E0068FD20; 137 | productRefGroup = 66F5F17C14DB420E0068FD20 /* Products */; 138 | projectDirPath = ""; 139 | projectRoot = ""; 140 | targets = ( 141 | 66F5F17A14DB420E0068FD20 /* ThirdParty */, 142 | ); 143 | }; 144 | /* End PBXProject section */ 145 | 146 | /* Begin PBXResourcesBuildPhase section */ 147 | 66F5F17914DB420E0068FD20 /* Resources */ = { 148 | isa = PBXResourcesBuildPhase; 149 | buildActionMask = 2147483647; 150 | files = ( 151 | 66F5F18A14DB420E0068FD20 /* InfoPlist.strings in Resources */, 152 | 664A26B514E334EF00C297E6 /* Serenity.bundle in Resources */, 153 | ); 154 | runOnlyForDeploymentPostprocessing = 0; 155 | }; 156 | /* End PBXResourcesBuildPhase section */ 157 | 158 | /* Begin PBXSourcesBuildPhase section */ 159 | 66F5F17714DB420E0068FD20 /* Sources */ = { 160 | isa = PBXSourcesBuildPhase; 161 | buildActionMask = 2147483647; 162 | files = ( 163 | 66F5F18C14DB420E0068FD20 /* main.m in Sources */, 164 | 66F5F19014DB420E0068FD20 /* AppDelegate.m in Sources */, 165 | ); 166 | runOnlyForDeploymentPostprocessing = 0; 167 | }; 168 | /* End PBXSourcesBuildPhase section */ 169 | 170 | /* Begin PBXVariantGroup section */ 171 | 66F5F18814DB420E0068FD20 /* InfoPlist.strings */ = { 172 | isa = PBXVariantGroup; 173 | children = ( 174 | 66F5F18914DB420E0068FD20 /* en */, 175 | ); 176 | name = InfoPlist.strings; 177 | sourceTree = ""; 178 | }; 179 | /* End PBXVariantGroup section */ 180 | 181 | /* Begin XCBuildConfiguration section */ 182 | 66F5F19114DB420E0068FD20 /* Debug */ = { 183 | isa = XCBuildConfiguration; 184 | buildSettings = { 185 | ALWAYS_SEARCH_USER_PATHS = NO; 186 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 187 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 188 | COPY_PHASE_STRIP = NO; 189 | GCC_C_LANGUAGE_STANDARD = gnu99; 190 | GCC_DYNAMIC_NO_PIC = NO; 191 | GCC_OPTIMIZATION_LEVEL = 0; 192 | GCC_PREPROCESSOR_DEFINITIONS = ( 193 | "DEBUG=1", 194 | "$(inherited)", 195 | ); 196 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 197 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 198 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 199 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 200 | GCC_WARN_UNUSED_VARIABLE = YES; 201 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 202 | SDKROOT = iphoneos; 203 | }; 204 | name = Debug; 205 | }; 206 | 66F5F19214DB420E0068FD20 /* Release */ = { 207 | isa = XCBuildConfiguration; 208 | buildSettings = { 209 | ALWAYS_SEARCH_USER_PATHS = NO; 210 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 211 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 212 | COPY_PHASE_STRIP = YES; 213 | GCC_C_LANGUAGE_STANDARD = gnu99; 214 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 215 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 216 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 217 | GCC_WARN_UNUSED_VARIABLE = YES; 218 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 219 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 220 | SDKROOT = iphoneos; 221 | VALIDATE_PRODUCT = YES; 222 | }; 223 | name = Release; 224 | }; 225 | 66F5F19414DB420E0068FD20 /* Debug */ = { 226 | isa = XCBuildConfiguration; 227 | buildSettings = { 228 | FRAMEWORK_SEARCH_PATHS = ( 229 | "$(inherited)", 230 | "\"$(SRCROOT)\"", 231 | ); 232 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 233 | GCC_PREFIX_HEADER = "ThirdParty/ThirdParty-Prefix.pch"; 234 | INFOPLIST_FILE = "ThirdParty/ThirdParty-Info.plist"; 235 | PRODUCT_NAME = "$(TARGET_NAME)"; 236 | WRAPPER_EXTENSION = app; 237 | }; 238 | name = Debug; 239 | }; 240 | 66F5F19514DB420E0068FD20 /* Release */ = { 241 | isa = XCBuildConfiguration; 242 | buildSettings = { 243 | FRAMEWORK_SEARCH_PATHS = ( 244 | "$(inherited)", 245 | "\"$(SRCROOT)\"", 246 | ); 247 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 248 | GCC_PREFIX_HEADER = "ThirdParty/ThirdParty-Prefix.pch"; 249 | INFOPLIST_FILE = "ThirdParty/ThirdParty-Info.plist"; 250 | PRODUCT_NAME = "$(TARGET_NAME)"; 251 | WRAPPER_EXTENSION = app; 252 | }; 253 | name = Release; 254 | }; 255 | /* End XCBuildConfiguration section */ 256 | 257 | /* Begin XCConfigurationList section */ 258 | 66F5F17514DB420E0068FD20 /* Build configuration list for PBXProject "ThirdParty" */ = { 259 | isa = XCConfigurationList; 260 | buildConfigurations = ( 261 | 66F5F19114DB420E0068FD20 /* Debug */, 262 | 66F5F19214DB420E0068FD20 /* Release */, 263 | ); 264 | defaultConfigurationIsVisible = 0; 265 | defaultConfigurationName = Release; 266 | }; 267 | 66F5F19314DB420E0068FD20 /* Build configuration list for PBXNativeTarget "ThirdParty" */ = { 268 | isa = XCConfigurationList; 269 | buildConfigurations = ( 270 | 66F5F19414DB420E0068FD20 /* Debug */, 271 | 66F5F19514DB420E0068FD20 /* Release */, 272 | ); 273 | defaultConfigurationIsVisible = 0; 274 | defaultConfigurationName = Release; 275 | }; 276 | /* End XCConfigurationList section */ 277 | }; 278 | rootObject = 66F5F17214DB420E0068FD20 /* Project object */; 279 | } 280 | -------------------------------------------------------------------------------- /sample/ThirdParty/ThirdParty.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /sample/ThirdParty/ThirdParty/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Jeff Verkoeyen 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | 19 | @interface AppDelegate : UIResponder 20 | 21 | @property (strong, nonatomic) UIWindow *window; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /sample/ThirdParty/ThirdParty/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Jeff Verkoeyen 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import "AppDelegate.h" 18 | 19 | @implementation AppDelegate 20 | 21 | @synthesize window = _window; 22 | 23 | - (void)dealloc { 24 | [_window release]; 25 | 26 | [super dealloc]; 27 | } 28 | 29 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 30 | self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; 31 | 32 | // Just to prove that we can use code from the Serenity framework. 33 | Widget* widget = [[[Widget alloc] init] autorelease]; 34 | UIImage* image = widget.image; 35 | UIImageView* imageView = [[[UIImageView alloc] initWithImage:image] autorelease]; 36 | [self.window addSubview:imageView]; 37 | 38 | self.window.backgroundColor = [UIColor whiteColor]; 39 | [self.window makeKeyAndVisible]; 40 | return YES; 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /sample/ThirdParty/ThirdParty/ThirdParty-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFiles 12 | 13 | CFBundleIdentifier 14 | jeffverkoeyen.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /sample/ThirdParty/ThirdParty/ThirdParty-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Jeff Verkoeyen 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | 19 | #ifndef __IPHONE_3_0 20 | #warning "This project uses features only available in iOS SDK 3.0 and later." 21 | #endif 22 | 23 | #ifdef __OBJC__ 24 | #import 25 | #import 26 | #import 27 | #endif 28 | -------------------------------------------------------------------------------- /sample/ThirdParty/ThirdParty/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /sample/ThirdParty/ThirdParty/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Jeff Verkoeyen 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | 19 | #import "AppDelegate.h" 20 | 21 | int main(int argc, char *argv[]) 22 | { 23 | @autoreleasepool { 24 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /scripts/build_framework.sh: -------------------------------------------------------------------------------- 1 | set -e 2 | set +u 3 | # Avoid recursively calling this script. 4 | if [[ $SF_MASTER_SCRIPT_RUNNING ]] 5 | then 6 | exit 0 7 | fi 8 | set -u 9 | export SF_MASTER_SCRIPT_RUNNING=1 10 | 11 | SF_TARGET_NAME=${PROJECT_NAME} 12 | SF_EXECUTABLE_PATH="lib${SF_TARGET_NAME}.a" 13 | SF_WRAPPER_NAME="${SF_TARGET_NAME}.framework" 14 | 15 | # The following conditionals come from 16 | # https://github.com/kstenerud/iOS-Universal-Framework 17 | 18 | if [[ "$SDK_NAME" =~ ([A-Za-z]+) ]] 19 | then 20 | SF_SDK_PLATFORM=${BASH_REMATCH[1]} 21 | else 22 | echo "Could not find platform name from SDK_NAME: $SDK_NAME" 23 | exit 1 24 | fi 25 | 26 | if [[ "$SDK_NAME" =~ ([0-9]+.*$) ]] 27 | then 28 | SF_SDK_VERSION=${BASH_REMATCH[1]} 29 | else 30 | echo "Could not find sdk version from SDK_NAME: $SDK_NAME" 31 | exit 1 32 | fi 33 | 34 | if [[ "$SF_SDK_PLATFORM" = "iphoneos" ]] 35 | then 36 | SF_OTHER_PLATFORM=iphonesimulator 37 | else 38 | SF_OTHER_PLATFORM=iphoneos 39 | fi 40 | 41 | if [[ "$BUILT_PRODUCTS_DIR" =~ (.*)$SF_SDK_PLATFORM$ ]] 42 | then 43 | SF_OTHER_BUILT_PRODUCTS_DIR="${BASH_REMATCH[1]}${SF_OTHER_PLATFORM}" 44 | else 45 | echo "Could not find platform name from build products directory: $BUILT_PRODUCTS_DIR" 46 | exit 1 47 | fi 48 | 49 | # Build the other platform. 50 | xcodebuild -project "${PROJECT_FILE_PATH}" -target "${TARGET_NAME}" -configuration "${CONFIGURATION}" -sdk ${SF_OTHER_PLATFORM}${SF_SDK_VERSION} BUILD_DIR="${BUILD_DIR}" OBJROOT="${OBJROOT}" BUILD_ROOT="${BUILD_ROOT}" SYMROOT="${SYMROOT}" $ACTION 51 | 52 | # Smash the two static libraries into one fat binary and store it in the .framework 53 | lipo -create "${BUILT_PRODUCTS_DIR}/${SF_EXECUTABLE_PATH}" "${SF_OTHER_BUILT_PRODUCTS_DIR}/${SF_EXECUTABLE_PATH}" -output "${BUILT_PRODUCTS_DIR}/${SF_WRAPPER_NAME}/Versions/${FRAMEWORK_VERSION}/${SF_TARGET_NAME}" 54 | 55 | # Copy the binary to the other architecture folder to have a complete framework in both. 56 | cp -a "${BUILT_PRODUCTS_DIR}/${SF_WRAPPER_NAME}/Versions/${FRAMEWORK_VERSION}/${SF_TARGET_NAME}" "${SF_OTHER_BUILT_PRODUCTS_DIR}/${SF_WRAPPER_NAME}/Versions/${FRAMEWORK_VERSION}/${SF_TARGET_NAME}" 57 | -------------------------------------------------------------------------------- /scripts/prepare_framework.sh: -------------------------------------------------------------------------------- 1 | set -e 2 | 3 | mkdir -p "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/${FRAMEWORK_VERSION}/Headers" 4 | 5 | # Link the "Current" version to "${FRAMEWORK_VERSION}" 6 | ln -sfh ${FRAMEWORK_VERSION} "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/Current" 7 | ln -sfh Versions/Current/Headers "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Headers" 8 | ln -sfh "Versions/Current/${PRODUCT_NAME}" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/${PRODUCT_NAME}" 9 | 10 | # The -a ensures that the headers maintain the source modification date so that we don't constantly 11 | # cause propagating rebuilds of files that import these headers. 12 | cp -a "${BUILT_PRODUCTS_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/${FRAMEWORK_VERSION}/Headers" 13 | --------------------------------------------------------------------------------