Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Getting Groovy with iOS Development

Getting Groovy with iOS Development

My talk at GR8ConfUS 2015 that focusses on using tools from the groovy ecosystem for making iOS development easier.

Rahul Somasunderam

July 30, 2015
Tweet

More Decks by Rahul Somasunderam

Other Decks in Programming

Transcript

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

    View Slide

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

    View Slide

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

    View Slide

  4. View Slide

  5. View Slide

  6. View Slide

  7. Square Brackets
    Square Brackets Everywhere

    View Slide

  8. But Shirley, there's got to be
    documentation

    View Slide

  9. View Slide

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

    View Slide

  11. Dependency Management

    View Slide

  12. Ruby got there first.
    Deal with it!

    View Slide

  13. View Slide

  14. • 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

    View Slide

  15. Build Tools

    View Slide

  16. 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

    View Slide

  17. 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?

    View Slide

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

    View Slide

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

    View Slide

  20. 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

    View Slide

  21. 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'
    }

    View Slide

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

    View Slide

  23. Functional Testing

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  27. View Slide

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

    View Slide