SlideShare une entreprise Scribd logo
1  sur  14
Télécharger pour lire hors ligne
Create an iOS 
Framework, document it 
and not die trying 
by @alexruperez
• Fast iterative builds when developing the 
framework. We may have a simple application that 
has the .framework as a dependency and we 
want to quickly iterate on development of 
the .framework. 
• Infrequent distribution builds of the .framework. 
• Resource distribution should be intuitive and not 
bloat the application. 
• Setup for third-party developers using 
the .framework should be easy.
Uncheck “Create git repository on…” option.
• Developers expect to be able to import your framework by importing the 
<YourFramework/YourFramework.h> header. Ensure that your project has such a 
header (if you created a new static library then there should already be a 
YourFramework.h and YourFramework.m file; you can delete the .m). 
• 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. 
• 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 (Cmd+Option+0). 
• Look at the "Target Membership" group and ensure that the checkbox next to the .h 
file is checked. 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 copied to the correct location in the copy headers phase.
• By default the static library project will copy private and 
public headers to the same folder: /usr/local/include. To 
avoid mistakenly copying private headers to our framework 
we want to ensure that our public headers are copied to a 
separate directory, e.g. Headers. 
• To change this setting, select the project in the Project 
Navigator and then click the "Build Settings" tab. Search for 
"public headers" and then set the "Public Headers Folder 
Path" to "Headers" for all configurations. If you are working 
with multiple Frameworks make sure that this folder is 
unique.
• We do not want to strip any code from the library; 
we leave this up to the application that is linking 
to the framework. To disable code stripping we 
must modify the following configuration settings. 
• "Dead Code Stripping" => No (for all settings) 
• "Strip Debug Symbols During Copy" => No (for 
all settings) 
• "Strip Style" => Non-Global Symbols (for all 
settings)
• Select Editor menu > Add Build Phase > Add 
Run Script Build Phase 
set -e! 
! 
mkdir -p "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/A/Headers"! 
! 
# Link the "Current" version to "A"! 
/bin/ln -sfh A "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/Current"! 
/bin/ln -sfh Versions/Current/Headers "${BUILT_PRODUCTS_DIR}/$ 
{PRODUCT_NAME}.framework/Headers"! 
/bin/ln -sfh "Versions/Current/${PRODUCT_NAME}" "${BUILT_PRODUCTS_DIR}/$ 
{PRODUCT_NAME}.framework/${PRODUCT_NAME}"! 
! 
# The -a ensures that the headers maintain the source modification date so that we don't 
constantly! 
# cause propagating rebuilds of files that import these headers.! 
/bin/cp -a "${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/" "$ 
{BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/A/Headers"
• Add the static library target to the "Target 
Dependencies”. 
• Set “Arquitectures” and “Valid arquitectures” in 
the Build Settings to i386, x86_64, armv7, 
armv7s and arm64. 
• Select Editor menu > Add Build Phase > Add 
Run Script Build Phase
set -e! 
set +u! 
# Avoid recursively calling this script.! 
if [[ $SF_MASTER_SCRIPT_RUNNING ]]! 
then! 
exit 0! 
fi! 
set -u! 
export SF_MASTER_SCRIPT_RUNNING=1! ! 
SF_TARGET_NAME=${PROJECT_NAME}! 
SF_EXECUTABLE_PATH="lib${SF_TARGET_NAME}.a"! 
SF_WRAPPER_NAME="${SF_TARGET_NAME}.framework"! 
SF_BUNDLE_NAME="${SF_TARGET_NAME}.bundle"! !# 
The following conditionals come from! 
# https://github.com/kstenerud/iOS-Universal-Framework! ! 
if [[ "$SDK_NAME" =~ ([A-Za-z]+) ]]! 
then! 
SF_SDK_PLATFORM=${BASH_REMATCH[1]}! 
else! 
echo "Could not find platform name from SDK_NAME: $SDK_NAME"! 
exit 1! 
fi! ! 
if [[ "$SDK_NAME" =~ ([0-9]+.*$) ]]! 
then! 
SF_SDK_VERSION=${BASH_REMATCH[1]}! 
else! 
echo "Could not find sdk version from SDK_NAME: $SDK_NAME"! 
exit 1! 
fi! ! 
if [[ "$SF_SDK_PLATFORM" = "iphoneos" ]]! 
then! 
SF_OTHER_PLATFORM=iphonesimulator! 
else! 
SF_OTHER_PLATFORM=iphoneos! 
fi! ! 
if [[ "$BUILT_PRODUCTS_DIR" =~ (.*)$SF_SDK_PLATFORM$ ]]! 
then! 
SF_OTHER_BUILT_PRODUCTS_DIR="${BASH_REMATCH[1]}${SF_OTHER_PLATFORM}"! 
else! 
echo "Could not find platform name from build products directory: $BUILT_PRODUCTS_DIR"! 
exit 1! 
fi!!# 
Build the other platform.! 
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! !# 
Smash the two static libraries into one fat binary and store it in the .framework! 
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}"! !# 
Copy the binary to the other architecture folder to have a complete framework in both.! 
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}"! ! 
rm -rf "${PROJECT_DIR}/Framework/"! 
mkdir "${PROJECT_DIR}/Framework/"! 
cp -rf "${BUILT_PRODUCTS_DIR}/${SF_WRAPPER_NAME}" "${PROJECT_DIR}/Framework/"! 
cp -rf "${BUILT_PRODUCTS_DIR}/${SF_BUNDLE_NAME}" "${PROJECT_DIR}/Framework/" 2>/dev/null || :
• Add the Framework Project to your Application 
Project 
• Select your project in the Project Navigator and 
open the "Build Phases" tab. Expand the "Target 
Dependencies" group and click the + button. 
Select the static library target and click “Add". 
• Expand the "Link Binary With Libraries" phase 
and click the + button. Select the .a file that's 
exposed by your framework's project and then 
click add.
• git clone git://github.com/tomaz/appledoc.git 
• sudo sh install-appledoc.sh 
• Select Editor menu > Add Build Phase > Add Run Script 
Build Phase 
#appledoc Xcode script! 
# Start constants! 
company="alexruperez";! 
companyID="com.alexruperez";! 
companyURL="http://alexruperez.com";! 
target="iphoneos";! 
outputPath="~/help";! 
# End constants! 
/usr/local/bin/appledoc ! 
--project-name "${PROJECT_NAME}" ! 
--project-company "${company}" ! 
--company-id "${companyID}" ! 
--docset-atom-filename "${company}.atom" ! 
--docset-feed-url "${companyURL}/${company}/%DOCSETATOMFILENAME" ! 
--docset-package-url "${companyURL}/${company}/%DOCSETPACKAGEFILENAME" ! 
--docset-fallback-url "${companyURL}/${company}" ! 
--output "${outputPath}" ! 
--ignore "Private" ! 
--publish-docset ! 
--docset-platform-family "${target}" ! 
--logformat xcode ! 
--keep-intermediate-files ! 
--no-repeat-first-par ! 
--no-warn-invalid-crossref ! 
--exit-threshold 2 ! 
"${PROJECT_DIR}"! 
rm -rf "${PROJECT_DIR}/Documentation/"! 
mkdir "${PROJECT_DIR}/Documentation/"! 
cp -rf ~/help/html/ "${PROJECT_DIR}/Documentation/"
/// Simple description 
! 
! 
! 
/** 
* Description. 
* 
* @warning Warning 
* @param Param A 
* @param Param B 
* @return Return 
*/
Addendum 
• alexruperez/FrameworkExample 
• jverkoey/iOS-Framework 
• tomaz/appledoc

Contenu connexe

Tendances

Selenium in the palm of your hand: Appium and automated mobile testing
Selenium in the palm of your hand: Appium and automated mobile testingSelenium in the palm of your hand: Appium and automated mobile testing
Selenium in the palm of your hand: Appium and automated mobile testingIsaac Murchie
 
Gearing up for mobile push notifications
Gearing up for mobile push notificationsGearing up for mobile push notifications
Gearing up for mobile push notificationsKeith Moore
 
Simple ways to deploy VM Images from Self Service UI in IBM Cloud Orchestrato...
Simple ways to deploy VM Images from Self Service UI in IBM Cloud Orchestrato...Simple ways to deploy VM Images from Self Service UI in IBM Cloud Orchestrato...
Simple ways to deploy VM Images from Self Service UI in IBM Cloud Orchestrato...Paulraj Pappaiah
 
KKBOX WWDC17 UIKit Drag and Drop - Mario
KKBOX WWDC17  UIKit Drag and Drop - MarioKKBOX WWDC17  UIKit Drag and Drop - Mario
KKBOX WWDC17 UIKit Drag and Drop - MarioLiyao Chen
 
Integrate Jenkins with S3
Integrate Jenkins with S3Integrate Jenkins with S3
Integrate Jenkins with S3devopsjourney
 
Aleksey_Demedetskiy_Jenkins
Aleksey_Demedetskiy_JenkinsAleksey_Demedetskiy_Jenkins
Aleksey_Demedetskiy_JenkinsCiklum
 
Inspect The Uninspected
Inspect The UninspectedInspect The Uninspected
Inspect The Uninspectedcgack
 
iOS Remote Notifications
iOS Remote NotificationsiOS Remote Notifications
iOS Remote NotificationsLeeHericks
 
Create or Modify Virtual system Patterns using IBM Cloud Orchestrator v2.5
Create or Modify Virtual system Patterns using  IBM Cloud Orchestrator v2.5Create or Modify Virtual system Patterns using  IBM Cloud Orchestrator v2.5
Create or Modify Virtual system Patterns using IBM Cloud Orchestrator v2.5Paulraj Pappaiah
 
Henry Been - Secure development: keeping your application secrets private
Henry Been - Secure development: keeping your application secrets privateHenry Been - Secure development: keeping your application secrets private
Henry Been - Secure development: keeping your application secrets privateHenry Been
 
DevOpsDays Austin - Configuration Management Evolution
DevOpsDays Austin - Configuration Management EvolutionDevOpsDays Austin - Configuration Management Evolution
DevOpsDays Austin - Configuration Management Evolutionjoehack3r
 
Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...
Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...
Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...Joseph Labrecque
 
Iteratively Develop Microservices with Speed on Kubernetes
Iteratively Develop Microservices with Speed on KubernetesIteratively Develop Microservices with Speed on Kubernetes
Iteratively Develop Microservices with Speed on KubernetesMicrosoft Tech Community
 
Building Mobile Apps With Xamarin and Visual Studio App Center
Building Mobile Apps With Xamarin and Visual Studio App CenterBuilding Mobile Apps With Xamarin and Visual Studio App Center
Building Mobile Apps With Xamarin and Visual Studio App CenterSharePoint Saturday New Jersey
 
KKBOX WWDC17 WatchOS - Dada
KKBOX WWDC17  WatchOS  - DadaKKBOX WWDC17  WatchOS  - Dada
KKBOX WWDC17 WatchOS - DadaLiyao Chen
 
PlayFab multiplayer_party
PlayFab multiplayer_partyPlayFab multiplayer_party
PlayFab multiplayer_partyCrystin Cox
 
PlayFab and unity gdc2019
PlayFab and unity gdc2019PlayFab and unity gdc2019
PlayFab and unity gdc2019Crystin Cox
 

Tendances (19)

Selenium in the palm of your hand: Appium and automated mobile testing
Selenium in the palm of your hand: Appium and automated mobile testingSelenium in the palm of your hand: Appium and automated mobile testing
Selenium in the palm of your hand: Appium and automated mobile testing
 
Gearing up for mobile push notifications
Gearing up for mobile push notificationsGearing up for mobile push notifications
Gearing up for mobile push notifications
 
Simple ways to deploy VM Images from Self Service UI in IBM Cloud Orchestrato...
Simple ways to deploy VM Images from Self Service UI in IBM Cloud Orchestrato...Simple ways to deploy VM Images from Self Service UI in IBM Cloud Orchestrato...
Simple ways to deploy VM Images from Self Service UI in IBM Cloud Orchestrato...
 
KKBOX WWDC17 UIKit Drag and Drop - Mario
KKBOX WWDC17  UIKit Drag and Drop - MarioKKBOX WWDC17  UIKit Drag and Drop - Mario
KKBOX WWDC17 UIKit Drag and Drop - Mario
 
Hello windows 10
Hello windows 10Hello windows 10
Hello windows 10
 
monkeyTalk
monkeyTalkmonkeyTalk
monkeyTalk
 
Integrate Jenkins with S3
Integrate Jenkins with S3Integrate Jenkins with S3
Integrate Jenkins with S3
 
Aleksey_Demedetskiy_Jenkins
Aleksey_Demedetskiy_JenkinsAleksey_Demedetskiy_Jenkins
Aleksey_Demedetskiy_Jenkins
 
Inspect The Uninspected
Inspect The UninspectedInspect The Uninspected
Inspect The Uninspected
 
iOS Remote Notifications
iOS Remote NotificationsiOS Remote Notifications
iOS Remote Notifications
 
Create or Modify Virtual system Patterns using IBM Cloud Orchestrator v2.5
Create or Modify Virtual system Patterns using  IBM Cloud Orchestrator v2.5Create or Modify Virtual system Patterns using  IBM Cloud Orchestrator v2.5
Create or Modify Virtual system Patterns using IBM Cloud Orchestrator v2.5
 
Henry Been - Secure development: keeping your application secrets private
Henry Been - Secure development: keeping your application secrets privateHenry Been - Secure development: keeping your application secrets private
Henry Been - Secure development: keeping your application secrets private
 
DevOpsDays Austin - Configuration Management Evolution
DevOpsDays Austin - Configuration Management EvolutionDevOpsDays Austin - Configuration Management Evolution
DevOpsDays Austin - Configuration Management Evolution
 
Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...
Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...
Building GPU-Accelerated Mobile Application Interfaces with Starling and Feat...
 
Iteratively Develop Microservices with Speed on Kubernetes
Iteratively Develop Microservices with Speed on KubernetesIteratively Develop Microservices with Speed on Kubernetes
Iteratively Develop Microservices with Speed on Kubernetes
 
Building Mobile Apps With Xamarin and Visual Studio App Center
Building Mobile Apps With Xamarin and Visual Studio App CenterBuilding Mobile Apps With Xamarin and Visual Studio App Center
Building Mobile Apps With Xamarin and Visual Studio App Center
 
KKBOX WWDC17 WatchOS - Dada
KKBOX WWDC17  WatchOS  - DadaKKBOX WWDC17  WatchOS  - Dada
KKBOX WWDC17 WatchOS - Dada
 
PlayFab multiplayer_party
PlayFab multiplayer_partyPlayFab multiplayer_party
PlayFab multiplayer_party
 
PlayFab and unity gdc2019
PlayFab and unity gdc2019PlayFab and unity gdc2019
PlayFab and unity gdc2019
 

Similaire à Gigigo Workshop - Create an iOS Framework, document it and not die trying

"I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more."I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more.Fabio Milano
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Drupalcon Paris
 
OpenWRT guide and memo
OpenWRT guide and memoOpenWRT guide and memo
OpenWRT guide and memo家榮 吳
 
APEX Application Lifecycle and Deployment 20220714.pdf
APEX Application Lifecycle and Deployment 20220714.pdfAPEX Application Lifecycle and Deployment 20220714.pdf
APEX Application Lifecycle and Deployment 20220714.pdfRichard Martens
 
Dependent things dependency management for apple sw - slideshare
Dependent things   dependency management for apple sw - slideshareDependent things   dependency management for apple sw - slideshare
Dependent things dependency management for apple sw - slideshareCavelle Benjamin
 
FLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 FrankfurtFLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 FrankfurtRobert Lemke
 
Pass Summit Linux Scripting for the Microsoft Professional
Pass Summit Linux Scripting for the Microsoft ProfessionalPass Summit Linux Scripting for the Microsoft Professional
Pass Summit Linux Scripting for the Microsoft ProfessionalKellyn Pot'Vin-Gorman
 
Gnubs-pres-foss-cdac-sem
Gnubs-pres-foss-cdac-semGnubs-pres-foss-cdac-sem
Gnubs-pres-foss-cdac-semSagun Baijal
 
Gnubs pres-foss-cdac-sem
Gnubs pres-foss-cdac-semGnubs pres-foss-cdac-sem
Gnubs pres-foss-cdac-semSagun Baijal
 
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...Erich Beyrent
 
Building and Maintaining a Distribution in Drupal 7 with Features
Building and Maintaining a  Distribution in Drupal 7 with FeaturesBuilding and Maintaining a  Distribution in Drupal 7 with Features
Building and Maintaining a Distribution in Drupal 7 with FeaturesNuvole
 
Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0Robert Lemke
 
Build Automation of PHP Applications
Build Automation of PHP ApplicationsBuild Automation of PHP Applications
Build Automation of PHP ApplicationsPavan Kumar N
 
(Re)-Introduction to Maven
(Re)-Introduction to Maven(Re)-Introduction to Maven
(Re)-Introduction to MavenEric Wyles
 
Creating Better Builds with Gradle
Creating Better Builds with GradleCreating Better Builds with Gradle
Creating Better Builds with GradleAndres Almiray
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
Php Development With Eclipde PDT
Php Development With Eclipde PDTPhp Development With Eclipde PDT
Php Development With Eclipde PDTBastian Feder
 
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)mfrancis
 
Development Setup of B-Translator
Development Setup of B-TranslatorDevelopment Setup of B-Translator
Development Setup of B-TranslatorDashamir Hoxha
 
Sbt, idea and eclipse
Sbt, idea and eclipseSbt, idea and eclipse
Sbt, idea and eclipseMike Slinn
 

Similaire à Gigigo Workshop - Create an iOS Framework, document it and not die trying (20)

"I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more."I have a framework idea" - Repeat less, share more.
"I have a framework idea" - Repeat less, share more.
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3
 
OpenWRT guide and memo
OpenWRT guide and memoOpenWRT guide and memo
OpenWRT guide and memo
 
APEX Application Lifecycle and Deployment 20220714.pdf
APEX Application Lifecycle and Deployment 20220714.pdfAPEX Application Lifecycle and Deployment 20220714.pdf
APEX Application Lifecycle and Deployment 20220714.pdf
 
Dependent things dependency management for apple sw - slideshare
Dependent things   dependency management for apple sw - slideshareDependent things   dependency management for apple sw - slideshare
Dependent things dependency management for apple sw - slideshare
 
FLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 FrankfurtFLOW3 Tutorial - T3CON11 Frankfurt
FLOW3 Tutorial - T3CON11 Frankfurt
 
Pass Summit Linux Scripting for the Microsoft Professional
Pass Summit Linux Scripting for the Microsoft ProfessionalPass Summit Linux Scripting for the Microsoft Professional
Pass Summit Linux Scripting for the Microsoft Professional
 
Gnubs-pres-foss-cdac-sem
Gnubs-pres-foss-cdac-semGnubs-pres-foss-cdac-sem
Gnubs-pres-foss-cdac-sem
 
Gnubs pres-foss-cdac-sem
Gnubs pres-foss-cdac-semGnubs pres-foss-cdac-sem
Gnubs pres-foss-cdac-sem
 
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
 
Building and Maintaining a Distribution in Drupal 7 with Features
Building and Maintaining a  Distribution in Drupal 7 with FeaturesBuilding and Maintaining a  Distribution in Drupal 7 with Features
Building and Maintaining a Distribution in Drupal 7 with Features
 
Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0Fluent Development with FLOW3 1.0
Fluent Development with FLOW3 1.0
 
Build Automation of PHP Applications
Build Automation of PHP ApplicationsBuild Automation of PHP Applications
Build Automation of PHP Applications
 
(Re)-Introduction to Maven
(Re)-Introduction to Maven(Re)-Introduction to Maven
(Re)-Introduction to Maven
 
Creating Better Builds with Gradle
Creating Better Builds with GradleCreating Better Builds with Gradle
Creating Better Builds with Gradle
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Php Development With Eclipde PDT
Php Development With Eclipde PDTPhp Development With Eclipde PDT
Php Development With Eclipde PDT
 
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
 
Development Setup of B-Translator
Development Setup of B-TranslatorDevelopment Setup of B-Translator
Development Setup of B-Translator
 
Sbt, idea and eclipse
Sbt, idea and eclipseSbt, idea and eclipse
Sbt, idea and eclipse
 

Plus de Alex Rupérez

Iterando arquitecturas, creando herramientas | T3chFest
Iterando arquitecturas, creando herramientas | T3chFestIterando arquitecturas, creando herramientas | T3chFest
Iterando arquitecturas, creando herramientas | T3chFestAlex Rupérez
 
Desarrollando mogollón de apps a la vez... ¿en qué lío me he metido?
Desarrollando mogollón de apps a la vez... ¿en qué lío me he metido?Desarrollando mogollón de apps a la vez... ¿en qué lío me he metido?
Desarrollando mogollón de apps a la vez... ¿en qué lío me he metido?Alex Rupérez
 
MADBike – Destapando la seguridad de BiciMAD (T3chFest 2017)
MADBike – Destapando la seguridad de BiciMAD (T3chFest 2017)MADBike – Destapando la seguridad de BiciMAD (T3chFest 2017)
MADBike – Destapando la seguridad de BiciMAD (T3chFest 2017)Alex Rupérez
 
Gigigo Rails Workshop
Gigigo Rails WorkshopGigigo Rails Workshop
Gigigo Rails WorkshopAlex Rupérez
 
Gigigo Ruby Workshop
Gigigo Ruby WorkshopGigigo Ruby Workshop
Gigigo Ruby WorkshopAlex Rupérez
 
Magister of Entrepreneurship - Social Development
Magister of Entrepreneurship - Social DevelopmentMagister of Entrepreneurship - Social Development
Magister of Entrepreneurship - Social DevelopmentAlex Rupérez
 

Plus de Alex Rupérez (7)

Iterando arquitecturas, creando herramientas | T3chFest
Iterando arquitecturas, creando herramientas | T3chFestIterando arquitecturas, creando herramientas | T3chFest
Iterando arquitecturas, creando herramientas | T3chFest
 
Desarrollando mogollón de apps a la vez... ¿en qué lío me he metido?
Desarrollando mogollón de apps a la vez... ¿en qué lío me he metido?Desarrollando mogollón de apps a la vez... ¿en qué lío me he metido?
Desarrollando mogollón de apps a la vez... ¿en qué lío me he metido?
 
MADBike – Destapando la seguridad de BiciMAD (T3chFest 2017)
MADBike – Destapando la seguridad de BiciMAD (T3chFest 2017)MADBike – Destapando la seguridad de BiciMAD (T3chFest 2017)
MADBike – Destapando la seguridad de BiciMAD (T3chFest 2017)
 
Gigigo Rails Workshop
Gigigo Rails WorkshopGigigo Rails Workshop
Gigigo Rails Workshop
 
Gigigo Ruby Workshop
Gigigo Ruby WorkshopGigigo Ruby Workshop
Gigigo Ruby Workshop
 
iOS Sync Libraries
iOS Sync LibrariesiOS Sync Libraries
iOS Sync Libraries
 
Magister of Entrepreneurship - Social Development
Magister of Entrepreneurship - Social DevelopmentMagister of Entrepreneurship - Social Development
Magister of Entrepreneurship - Social Development
 

Dernier

DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...Henrik Hanke
 
Chizaram's Women Tech Makers Deck. .pptx
Chizaram's Women Tech Makers Deck.  .pptxChizaram's Women Tech Makers Deck.  .pptx
Chizaram's Women Tech Makers Deck. .pptxogubuikealex
 
The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationNathan Young
 
Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Escort Service
 
Application of GIS in Landslide Disaster Response.pptx
Application of GIS in Landslide Disaster Response.pptxApplication of GIS in Landslide Disaster Response.pptx
Application of GIS in Landslide Disaster Response.pptxRoquia Salam
 
Internship Presentation | PPT | CSE | SE
Internship Presentation | PPT | CSE | SEInternship Presentation | PPT | CSE | SE
Internship Presentation | PPT | CSE | SESaleh Ibne Omar
 
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...漢銘 謝
 
Engaging Eid Ul Fitr Presentation for Kindergartners.pptx
Engaging Eid Ul Fitr Presentation for Kindergartners.pptxEngaging Eid Ul Fitr Presentation for Kindergartners.pptx
Engaging Eid Ul Fitr Presentation for Kindergartners.pptxAsifArshad8
 
Event 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxEvent 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxaryanv1753
 
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power
 
General Elections Final Press Noteas per M
General Elections Final Press Noteas per MGeneral Elections Final Press Noteas per M
General Elections Final Press Noteas per MVidyaAdsule1
 
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRRINDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRRsarwankumar4524
 
proposal kumeneger edited.docx A kumeeger
proposal kumeneger edited.docx A kumeegerproposal kumeneger edited.docx A kumeeger
proposal kumeneger edited.docx A kumeegerkumenegertelayegrama
 
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATIONRACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATIONRachelAnnTenibroAmaz
 
Early Modern Spain. All about this period
Early Modern Spain. All about this periodEarly Modern Spain. All about this period
Early Modern Spain. All about this periodSaraIsabelJimenez
 
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comSaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comsaastr
 
Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸mathanramanathan2005
 
Quality by design.. ppt for RA (1ST SEM
Quality by design.. ppt for  RA (1ST SEMQuality by design.. ppt for  RA (1ST SEM
Quality by design.. ppt for RA (1ST SEMCharmi13
 

Dernier (18)

DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
 
Chizaram's Women Tech Makers Deck. .pptx
Chizaram's Women Tech Makers Deck.  .pptxChizaram's Women Tech Makers Deck.  .pptx
Chizaram's Women Tech Makers Deck. .pptx
 
The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism Presentation
 
Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170
 
Application of GIS in Landslide Disaster Response.pptx
Application of GIS in Landslide Disaster Response.pptxApplication of GIS in Landslide Disaster Response.pptx
Application of GIS in Landslide Disaster Response.pptx
 
Internship Presentation | PPT | CSE | SE
Internship Presentation | PPT | CSE | SEInternship Presentation | PPT | CSE | SE
Internship Presentation | PPT | CSE | SE
 
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
 
Engaging Eid Ul Fitr Presentation for Kindergartners.pptx
Engaging Eid Ul Fitr Presentation for Kindergartners.pptxEngaging Eid Ul Fitr Presentation for Kindergartners.pptx
Engaging Eid Ul Fitr Presentation for Kindergartners.pptx
 
Event 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxEvent 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptx
 
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
 
General Elections Final Press Noteas per M
General Elections Final Press Noteas per MGeneral Elections Final Press Noteas per M
General Elections Final Press Noteas per M
 
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRRINDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRR
 
proposal kumeneger edited.docx A kumeeger
proposal kumeneger edited.docx A kumeegerproposal kumeneger edited.docx A kumeeger
proposal kumeneger edited.docx A kumeeger
 
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATIONRACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
 
Early Modern Spain. All about this period
Early Modern Spain. All about this periodEarly Modern Spain. All about this period
Early Modern Spain. All about this period
 
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comSaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
 
Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸
 
Quality by design.. ppt for RA (1ST SEM
Quality by design.. ppt for  RA (1ST SEMQuality by design.. ppt for  RA (1ST SEM
Quality by design.. ppt for RA (1ST SEM
 

Gigigo Workshop - Create an iOS Framework, document it and not die trying

  • 1. Create an iOS Framework, document it and not die trying by @alexruperez
  • 2. • Fast iterative builds when developing the framework. We may have a simple application that has the .framework as a dependency and we want to quickly iterate on development of the .framework. • Infrequent distribution builds of the .framework. • Resource distribution should be intuitive and not bloat the application. • Setup for third-party developers using the .framework should be easy.
  • 3. Uncheck “Create git repository on…” option.
  • 4. • Developers expect to be able to import your framework by importing the <YourFramework/YourFramework.h> header. Ensure that your project has such a header (if you created a new static library then there should already be a YourFramework.h and YourFramework.m file; you can delete the .m). • 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. • 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 (Cmd+Option+0). • Look at the "Target Membership" group and ensure that the checkbox next to the .h file is checked. 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 copied to the correct location in the copy headers phase.
  • 5. • By default the static library project will copy private and public headers to the same folder: /usr/local/include. To avoid mistakenly copying private headers to our framework we want to ensure that our public headers are copied to a separate directory, e.g. Headers. • To change this setting, select the project in the Project Navigator and then click the "Build Settings" tab. Search for "public headers" and then set the "Public Headers Folder Path" to "Headers" for all configurations. If you are working with multiple Frameworks make sure that this folder is unique.
  • 6. • We do not want to strip any code from the library; we leave this up to the application that is linking to the framework. To disable code stripping we must modify the following configuration settings. • "Dead Code Stripping" => No (for all settings) • "Strip Debug Symbols During Copy" => No (for all settings) • "Strip Style" => Non-Global Symbols (for all settings)
  • 7. • Select Editor menu > Add Build Phase > Add Run Script Build Phase set -e! ! mkdir -p "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/A/Headers"! ! # Link the "Current" version to "A"! /bin/ln -sfh A "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/Current"! /bin/ln -sfh Versions/Current/Headers "${BUILT_PRODUCTS_DIR}/$ {PRODUCT_NAME}.framework/Headers"! /bin/ln -sfh "Versions/Current/${PRODUCT_NAME}" "${BUILT_PRODUCTS_DIR}/$ {PRODUCT_NAME}.framework/${PRODUCT_NAME}"! ! # The -a ensures that the headers maintain the source modification date so that we don't constantly! # cause propagating rebuilds of files that import these headers.! /bin/cp -a "${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/" "$ {BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.framework/Versions/A/Headers"
  • 8.
  • 9. • Add the static library target to the "Target Dependencies”. • Set “Arquitectures” and “Valid arquitectures” in the Build Settings to i386, x86_64, armv7, armv7s and arm64. • Select Editor menu > Add Build Phase > Add Run Script Build Phase
  • 10. set -e! set +u! # Avoid recursively calling this script.! if [[ $SF_MASTER_SCRIPT_RUNNING ]]! then! exit 0! fi! set -u! export SF_MASTER_SCRIPT_RUNNING=1! ! SF_TARGET_NAME=${PROJECT_NAME}! SF_EXECUTABLE_PATH="lib${SF_TARGET_NAME}.a"! SF_WRAPPER_NAME="${SF_TARGET_NAME}.framework"! SF_BUNDLE_NAME="${SF_TARGET_NAME}.bundle"! !# The following conditionals come from! # https://github.com/kstenerud/iOS-Universal-Framework! ! if [[ "$SDK_NAME" =~ ([A-Za-z]+) ]]! then! SF_SDK_PLATFORM=${BASH_REMATCH[1]}! else! echo "Could not find platform name from SDK_NAME: $SDK_NAME"! exit 1! fi! ! if [[ "$SDK_NAME" =~ ([0-9]+.*$) ]]! then! SF_SDK_VERSION=${BASH_REMATCH[1]}! else! echo "Could not find sdk version from SDK_NAME: $SDK_NAME"! exit 1! fi! ! if [[ "$SF_SDK_PLATFORM" = "iphoneos" ]]! then! SF_OTHER_PLATFORM=iphonesimulator! else! SF_OTHER_PLATFORM=iphoneos! fi! ! if [[ "$BUILT_PRODUCTS_DIR" =~ (.*)$SF_SDK_PLATFORM$ ]]! then! SF_OTHER_BUILT_PRODUCTS_DIR="${BASH_REMATCH[1]}${SF_OTHER_PLATFORM}"! else! echo "Could not find platform name from build products directory: $BUILT_PRODUCTS_DIR"! exit 1! fi!!# Build the other platform.! 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! !# Smash the two static libraries into one fat binary and store it in the .framework! 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}"! !# Copy the binary to the other architecture folder to have a complete framework in both.! 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}"! ! rm -rf "${PROJECT_DIR}/Framework/"! mkdir "${PROJECT_DIR}/Framework/"! cp -rf "${BUILT_PRODUCTS_DIR}/${SF_WRAPPER_NAME}" "${PROJECT_DIR}/Framework/"! cp -rf "${BUILT_PRODUCTS_DIR}/${SF_BUNDLE_NAME}" "${PROJECT_DIR}/Framework/" 2>/dev/null || :
  • 11. • Add the Framework Project to your Application Project • Select your project in the Project Navigator and open the "Build Phases" tab. Expand the "Target Dependencies" group and click the + button. Select the static library target and click “Add". • Expand the "Link Binary With Libraries" phase and click the + button. Select the .a file that's exposed by your framework's project and then click add.
  • 12. • git clone git://github.com/tomaz/appledoc.git • sudo sh install-appledoc.sh • Select Editor menu > Add Build Phase > Add Run Script Build Phase #appledoc Xcode script! # Start constants! company="alexruperez";! companyID="com.alexruperez";! companyURL="http://alexruperez.com";! target="iphoneos";! outputPath="~/help";! # End constants! /usr/local/bin/appledoc ! --project-name "${PROJECT_NAME}" ! --project-company "${company}" ! --company-id "${companyID}" ! --docset-atom-filename "${company}.atom" ! --docset-feed-url "${companyURL}/${company}/%DOCSETATOMFILENAME" ! --docset-package-url "${companyURL}/${company}/%DOCSETPACKAGEFILENAME" ! --docset-fallback-url "${companyURL}/${company}" ! --output "${outputPath}" ! --ignore "Private" ! --publish-docset ! --docset-platform-family "${target}" ! --logformat xcode ! --keep-intermediate-files ! --no-repeat-first-par ! --no-warn-invalid-crossref ! --exit-threshold 2 ! "${PROJECT_DIR}"! rm -rf "${PROJECT_DIR}/Documentation/"! mkdir "${PROJECT_DIR}/Documentation/"! cp -rf ~/help/html/ "${PROJECT_DIR}/Documentation/"
  • 13. /// Simple description ! ! ! /** * Description. * * @warning Warning * @param Param A * @param Param B * @return Return */
  • 14. Addendum • alexruperez/FrameworkExample • jverkoey/iOS-Framework • tomaz/appledoc