Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
92e1080
Added CI article
Jun 14, 2011
baae3d1
Added missing screenshots.
Jun 14, 2011
ff61f98
Fixes after review.
Jun 14, 2011
c26abf8
Fixed table of contents
Jun 14, 2011
d111e17
Removed unversioned file.
Jun 14, 2011
2086b16
Renamed article directories.
Jun 15, 2011
f10dab7
Removed obsolete files
Jun 15, 2011
fbda6e7
Added new articles and author.
Jun 15, 2011
5bcdfa1
Fixed printing errors.
Jun 15, 2011
58e17b0
Fixed repository structure requirements.
Jun 16, 2011
99ba37b
Added emails.
Jun 16, 2011
ec47908
added certificates directory description.
Jun 16, 2011
36b8088
Started presentation creation.
Jun 16, 2011
1e8baa9
Fixed background and added first slide.
Jun 17, 2011
3650632
Added more slides.
Jun 17, 2011
f0868ef
Added CI problems description slides.
dodikk Jun 18, 2011
0476096
Added script descriptions.
dodikk Jun 20, 2011
03a0864
changed background
dodikk Jun 21, 2011
8f15cc4
fixed result pdf
dodikk Jun 21, 2011
33b29a6
Added build script description. Fixed deployment diagrams. Fixed text…
dodikk Jun 22, 2011
963a290
Result pdf update
dodikk Jun 22, 2011
cad97d2
Added CI tools social feedback.
dodikk Jun 23, 2011
3c025bd
Added screenshot replacements for "library howto"
dodikk Jun 23, 2011
5c1d4cd
Added openoffice temporary files to black list.
dodikk Jun 23, 2011
84d658a
Fixed bad quality images. Fixed contacts page. Added missing images.
dodikk Jun 23, 2011
3e24630
Added arrows for "No xCode GUI" page.
dodikk Jun 23, 2011
64aaf37
Updated result pdf.
dodikk Jun 23, 2011
aebcde0
Updated result pdf.
dodikk Jun 24, 2011
8f2bebd
Some Coding style changes
volodg Jun 24, 2011
e259e92
Fixed spacings. Removed unwanted duplicated pages.
dodikk Jun 24, 2011
b4f363c
Ignore *.pdf#
dodikk Jun 24, 2011
cf2008d
Added backgrounds.
dodikk Jun 24, 2011
26e067d
Fixed "different background" problems. Fixed obvious letter capitaliz…
dodikk Jun 25, 2011
3f1ec0d
Fixed letter capitalization mistakes.
dodikk Jun 25, 2011
0e19012
Fixed grammar errors (page 1..15)
dodikk Jun 25, 2011
e278767
Fixed grammar errors. Highlighted uncertain places
dodikk Jun 26, 2011
306cd56
Added speech text (UTF8/linux)
dodikk Jun 28, 2011
84660e4
Made web backups MS windows friendly
dodikk Jun 28, 2011
6d48565
Made web backups MS windows friendly
dodikk Jun 28, 2011
388056d
Added speech split by pages.
dodikk Jun 29, 2011
1f08fdb
Page12 : Fixed arrow position.
dodikk Jun 29, 2011
f610c7a
Fixed grammar errors.
dodikk Jun 29, 2011
05f22a3
Made web backups user friendly.
dodikk Jun 29, 2011
4b82fa0
Made the presentation windows friendly.
dodikk Jul 2, 2011
f23e60f
Fixed slides order.
dodikk Jul 2, 2011
d089f6c
Fixed speech.
dodikk Jul 2, 2011
8c43131
Fixed last page.
dodikk Jul 2, 2011
0864ff2
Added habr quiz results.
dodikk Jul 3, 2011
6d1835f
Fixed artifact
dodikk Jul 3, 2011
717f3e7
Fixed artifacts. Fixed table borders.
dodikk Jul 4, 2011
8d3d1b9
Fixed images backrounds. Converted them to *.png format
dodikk Jul 6, 2011
b72fa1a
add presentation
volodg Jul 13, 2011
8c7fd9b
Added slides about:
dodikk Oct 9, 2011
1c6e229
Added xcode-select notes
dodikk Oct 14, 2011
ab0496b
Added block identation materials. Adopted some materials for ARC pers…
dodikk Feb 15, 2012
0f70f7b
fixed table of contents
dodikk Feb 15, 2012
52ed77c
added short biography notes
dodikk Feb 16, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.svn
*.DS_Store
*.odp#
*.pdf#

xCode4_commandline/dumps/XCODE4_LEGACY_VARIABLES.txt
xCode4_commandline/dumps/XCODE4_VARIABLES.txt
Expand Down
File renamed without changes.
File renamed without changes.
Binary file added 1-CodeStyle/ObjectiveC_Coding_Standard.odt
Binary file not shown.
Binary file added 1-CodeStyle/ObjectiveC_Coding_Standard.pdf
Binary file not shown.
Binary file added 1-CodeStyle/images/1-ViewControllerNaming.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 2-xCode4_commandline/images/._sdk_list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added 3-iContiniousIntegration/ciPresentation.odp
Binary file not shown.
Binary file added 3-iContiniousIntegration/ciPresentation.pdf
Binary file not shown.
10 changes: 10 additions & 0 deletions 3-iContiniousIntegration/habr_ci.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Что вы используете для Continuous Integration?

0.78% (7)Apache Continuum
3.12% (28)Bamboo
9.7% (87)CruiseControl
18.17% (163)Hudson / Jenkins
11.04% (99)TeamCity
6.91% (62)Другой вариант
50.28% (451)Работаем без Continuous Integration
Проголосовало 897 человек. Воздержалось 386 человек.
18 changes: 18 additions & 0 deletions 3-iContiniousIntegration/habr_lib_usage.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
���������� ��� Apple iOS > ������ �� �� ���������� ��� ����� iOS ��������?
4.76%
(1)
���� ���� ����������. �������� �� ��� "Cocoa touch->static library project"
9.52%
(2)
���� ���� ����������. ����� ��� � ���������� ������. ��������� ���� ���������� �������� � ���� framework, SDK ��� "Universal Binary".
23.81%
(5)
����� ��������� �� ����. ��������� ��������� ���������� ����� ����������� ���������� � ���� ������
28.57%
(6)
����� ��������� �� ����. ��������� ��������� ����������, ����������� ��� "Cocoa touch->static library project", framework, SDK ��� "Universal Binary".
33.33%
(7)
����� ��������� �� ����. ��������� ������ ���� ������������ � frameworks, ������� ������������� Apple

������������ 21 �������. ������������ 95 �������.
18 changes: 18 additions & 0 deletions 3-iContiniousIntegration/habr_test_usage.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
���������� ��� Apple iOS > ����� unit testing framework �� ����������� ��� ����� iOS ��������?
7.14%
(3)
Sen Testing Kit (�����������, �� iOS SDK)
2.38%
(1)
Google toolbox
2.38%
(1)
GHUnit
2.38%
(1)
��������� ������ Unit test framework
85.71%
(36)
�� ��������� Unit tests � ����� iOS ��������

������������� 42 ��������. ������������ 110 �������.
Binary file not shown.
Binary file not shown.
Binary file added 3-iContiniousIntegration/images-presentation.zip
Binary file not shown.
3,066 changes: 3,066 additions & 0 deletions 3-iContiniousIntegration/images-presentation/TouchXmlInstall.mht

Large diffs are not rendered by default.

Binary file added 3-iContiniousIntegration/images/2-NoLocalGit.png
Binary file added 3-iContiniousIntegration/speech.odt
Binary file not shown.
Binary file added 3-iContiniousIntegration/speech.pdf
Binary file not shown.
324 changes: 324 additions & 0 deletions 3-iContiniousIntegration/speech.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,324 @@
Slide1

Всем привет.
Меня зовут Александр Додатко. Я работаю в компании EPAM system.

Сейчас я расскажу вам о нашем опыте Continuous integration для iOS приложений.
-------------------------------------





Slide2

Речь пойдет о работе с проектами в xCode, сборке из командной строки (без запуска GUI), создании библиотек для iOS (как обычных, так и "Universal binary" ), а также поставке версий для тестирования (deployment).
-------------------------------------




Slide3

Также мы рассмотрим unit-testing с помощью GHUnit и настройку hudson build server.
Запуск приложений без запуска xCode будет полезен вашим тестировщикам (QA).
-------------------------------------





Slide4
Изначально build servers были нацелены на сборку Java и .NET проектов. Поддержка сборок для C и C++ выполнена гораздо хуже.
Однакоко каждый из них может и исполняет свои основные функции :
* получение исходных кодов из SVN
* сборка проекта. (для c, c++ это запуск скрипта или makefile)
* публикация результатов сборки (продуктов и unit tests)
-------------------------------------





Slide5

Теперь разберемся, что же должен делать build script.
В нашем случае он
* собирает основной проект
* собирает и запускает unit tests
* подготавливает собранные продукты и test reports к обработке с помощью build server.
* выкладывает сборку в директорию с общим доступом. ( наша команда использует dropbox. В зависимости от своих нужд вы можете использовать ftp или другие средства )
-------------------------------------





Slide6

Для начала давайте вспомним, каким образом ОБЫЧНО осуществляется повторное использование кода в iOS проектах.
На примере TouchXML мы видим что исходники просто копируются в основной проект.
-------------------------------------





Slide7

Так делать не следует. Надеюсь, всем понятно почему.
В особенности если код будет использоваться в нескольких проектах.
-------------------------------------





Slide8

Вместо копирования следует использовать статические библиотеки, выделяя их в отдельные *.xcodeproj
-------------------------------------





Slide9
Slide10

Для этого мы добавляем library sub-project.
-------------------------------------





Slide11

После чего следует добавить зависимости компоновщика и заголовков интерфейсов.
(linker and header dependencies)
-------------------------------------






Slide12

Вот и дошла очередь до Universal binaries. А что это?
Это специальным образом собранная библиотека, которая содержит символы как для device, так и для simulator.
Она используется для предоставления библиотеки сторонним разработчикам, не открывая своего драгоценного кода.
В сегодняшнем докладе о техниках защиты от дизассемблирования речь идти не будет.

В MacOS для этих целей также используют frameworks и SDK. Однако Universal binary является их важной составляющей.

Использовать Universal binary так же просто, как и обычные static libraries в вашей любимой Mac OS X/Linux/Windows.
А вот собрать ее куда сложнее.
-------------------------------------





Slide13

Для этого нужно собрать отдельные версии для device и simulator. А затем специальным образом объединить их.
Вот она - эта "уличная магия".
-------------------------------------







Slide14

Теперь поговорим о процедуре deployment под iOS.
Процедура "выкладывания в App Store" хорошо изучена и описана в документации Apple.
Поэтому мы поговорим о поставке версий для тестирования.
-------------------------------------







Slide15

Особенностью desktop applications является тот факт что сборка и исполнение производится на одной и той же системе.
Поэтому организовать Continuous Integration сравнительно просто. Для таких приложений существует множество CI tools и литературы, описывающей процесс сборки.
-------------------------------------





Slide16

Для iOS ситуация немного другая. Программы исполняются либо на реальном устройстве с iOS, либо на симуляторе.
Ситуация дополнительно усложняется системой provisioning profiles, которую навязывает apple.

Посему автоматический запуск программ, сбор результатов тестов ( *.xml JUnit reports ) будет несколько труднее чем "написать имя программы в shell script" и "открыть файл на чтение".
-------------------------------------





Slide17

Если с этим всем не разобраться, то вашим QA прийдется доставать исходные коды из системы контроля версий (SVN, GIT, mercurial), КОМПИЛИРОВАТЬ их, настраивать у себя provisioning profiles.
Наши QA одно время этим занимались.

Это неправильно. CI script должен собирать *.ipa файл, который может быть установлен на устройство с помощью iTunes.
*.ipa файл содержит в себе приложение, собранное для iPhone, iPod или iPad. А также provisioning profiles, необходимые для установки.
В принципе, profiles и application можно устанавливать на устройства отдельно. Однако с моей точки зрения, *.ipa файлы более удобны.
-------------------------------------





Slide18

Итак, приступим к сборке. Данный слайд иллюстрирует взаимосвязь между xCode command line interface и GUI.
Screenshot был взят из xCode3. Надеюсь, соответствие с xCode4 GUI вы сможете найти самостоятельно. (к моему сожалению, эти настройки разбросали по разным частям новой IDE).
-------------------------------------





Slide19

После успешной сборки проекта соберем *.ipa файл для наших любимых QA и клиентов.
Для этого нам нужно 3 вещи :
* собранный *.app для iOS устройства
* DeveloperName -- строка с информацией о developer profile. Пример -- в нижней части слайда.
* Provisioning Profile -- это файл. Да-да. Тот самый файл который вы импортировали в свой Organizer.
-------------------------------------





Slide20

Следующая тема -- модульное тестирование. Мы рассмотрим
* вопрос выбора testing framework.
* технику автоматического запуска тестов на iOS simulator.
* получение результатов тестирования по завершении работы iOS simulator.
-------------------------------------





Slide21

Выбор unit test framework очень важен. Мы рассмотрели трех основных "игроков" для ObjectiveC.
SenTestingKit, GoogleToolbox, GHUnit.

SenTestingKit разрабатывается в Apple и поставляется вместе с SDK.
Он всем хорош кроме 2х вещей :
1. Отсутствие Debug. (с помощью некоторых ухищрений этого можно добиться, пожертвовав корректной работой Assert)
2. Отстутствие работы с Bundles. (для нас это важно, так как наши приложения активно взаимодействуют с web services)
Если честно, мне немного непонятен подход Apple к данному вопросу.

Google toolbox пытается быть совместимым с ним. Поэтому страдает от тех же проблем.
Хотя он содержит некоторые полезные функции. Такие как возможность сравнения screenshots приложения на предмет соответствия спецификации (при условии что она у вас есть).

GHUnit же избрал иной путь. Unit tests оформляются в виде отдельного iOS application. При желании его можно даже отправить в App Store ;)
Таким образом, эти тесты избавлены от описанных недостатков.
Однако не все так радужно. Их гораздо труднее использовать в CI из-за отсутствия интеграции с xCode и их "Application origin".


Учитывая данную сравнительную таблицу, мы выбрали для себя GHUnit. Поскольку мы не готовы жертвовать возможностями отладки тестов и работы с bundles.
-------------------------------------





Slide22

Но и это еще не все. Для использования в рамках CI приложение нужно правильно сконфигурировать.
Эта конфигурация отличается от интерактивной, используемой при development.

На слайде показано как сделать необходимые вещи :
* GHUNIT_AUTORUN -- запускать без повеления пользователя.
* WRITE_JUNIT_XML -- получить результаты теста в формате *.xml
* GHUNIT_AUTOEXIT -- завершиться после выполнения (и не мешать дальнейшей работе сценария сборки)

(** запустить проект и показать действие флагов. **)
-------------------------------------





Slide23

Здесь показана команда запуска теста. Данная утилита не входит в состав SDK. Однако вы с легкостью сможете найти ее на github и собрать самостоятельно.
Ее интерфейс до безобразия прост.
Однако следует быть осторожным с передачей пути к приложению. Программа отказывается работать с относительными путями и выдает не вполне внятные сообщения об ошибках.
-------------------------------------





Slide24

Сбор результатов тестов также достаточно прост. GHUnit записывает их во временную папку. Вот в эту (** показать **).
Теперь осталось только переместиться в нее и скопировать тесты в нужную папку.
-------------------------------------





Slide25

Еще один неочевидный момент -- необходимость "убить" процесс симулятора. Если этого не делать, то следующий тест может вообще не запуститься (это bug/feature apple SDK).
Я советую делать это перед и после запуска очередного UnitTestXXX.app
-------------------------------------









Slide26

В своих проектах мы используем следующую структуру директорий.
app - для продуктов, поставляемых в App Store
lib, lib-third-party - для библиотек. Своих и сторонних соответственно.
frameworks - для сторонних *.framework. Также в этот каталог выполняется deployment своих библиотек, оформленных как Universal Binary или framework
deployment - здесь build server будет искать собранные версии продуктов.
tests - для Unit test всех видов.
demo - для пробных проектов-прототипов, не поставляемых в App Store.
tools - для программ-утилит Mac OS X, используемых при сборке.

[остальное и так ясно]
-------------------------------------





Slide27

Спасибо за внимание.
Рабочий пример проекта и сценариев сборки можно найти на нашей странице github. Равно как и эту статью.
Те, кто не уснул, могут задать свои вопросы.
-------------------------------------



Loading