Slide 1

Slide 1 text

Getting Groovy with iOS Development Rahul Somasunderam 8 GR Conf July 2015

Slide 2

Slide 2 text

About Me lgtm.in, swaggydoc, ihe-iti ! java, groovy, objective-c ! @rahulsom

Slide 3

Slide 3 text

Where I work • We build a Health Information Exchange Population Health Tools • Used by 130 Health Systems, 600 Hospitals, 20K physicians • We love Groovy

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

Square Brackets Square Brackets Everywhere

Slide 8

Slide 8 text

But Shirley, there's got to be documentation

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

Tools • XCode bad. AppCode good • Objective-C and Swift • Dependency Management • Build Tools • Functional Testing

Slide 11

Slide 11 text

Dependency Management

Slide 12

Slide 12 text

Ruby got there first. Deal with it!

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

• Your app needs dependencies • Dependencies can be installed with Cocoapods • Cocoapods is a ruby gem • Ruby gems can be installed with Bundler • You WANT ruby in the user space; so RBENV • There is a brew formula for RBENV • brew is installed using system ruby

Slide 15

Slide 15 text

Build Tools

Slide 16

Slide 16 text

xcodebuild xcodebuild \ -scheme Todos \ -workspace Todos.xcworkspace \ -sdk iphonesimulator \ -configuration Debug \ DSTROOT=/Users/rahul/src/Todos/build/dst \ OBJROOT=/Users/rahul/src/Todos/build/obj \ SYMROOT=/Users/rahul/src/Todos/build/sym \ SHARED_PRECOMPS_DIR=/Users/rahul/src/Todos/build/shared \ -destination 'platform=iOS Simulator,id=CAB835ED-3EE2-47B6-AD74-C06675651CEF' \ test

Slide 17

Slide 17 text

xcodebuild • Too complex commands - Unruly bash scripts • Different tools for build, upload to testflight, hockeyapp • Very little documentation, very steep learning curve • What about functional testing?

Slide 18

Slide 18 text

xctool • Written in Objective-C • Needs advanced knowledge of Objective-C • What about functional testing?

Slide 19

Slide 19 text

Nomad CLI • Written in ruby • Great support for certificates, distribution profiles • Great support for distribution using iTunesConnect • What about functional testing?

Slide 20

Slide 20 text

What we need • Flexible build system • Support for distribution • Support for functional testing • Easy to install, even if you're an enterprise software company • Easy to run

Slide 21

Slide 21 text

Gradle Xcode Plugin buildscript { repositories { maven { url "https://plugins.gradle.org/m2/" } } dependencies { classpath "gradle.plugin.org.openbakery:xcodePlugin:0.11.3" } } ! apply plugin: "org.openbakery.xcodeplugin" ! xcodebuild { workspace = 'Todos.xcworkspace' scheme = 'Todos' target = 'Todos' sdk = 'iphonesimulator' }

Slide 22

Slide 22 text

• gradle xcodetest • gradle hockeyapp • gradle deploygate • gradle appstoreUpload • gradle oclint • gradle cpd • gradle crashlytics

Slide 23

Slide 23 text

Functional Testing

Slide 24

Slide 24 text

UIAutomation using Instruments • Record and Playback • DOM Tree access • Refactoring • Managing State • Tuneup JS? Bwoken?

Slide 25

Slide 25 text

Appium • Based on Selenium • Clients for several languages including Java • Makes your app stateless

Slide 26

Slide 26 text

Groovy + Spock • Spock's expressive testing • Groovy's metaprogramming to improve access to DOM

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

Code • https://github.com/rahulsom/todos-ios/