Szczepan.faber.gradle

39
Gradle building great tool

Transcript of Szczepan.faber.gradle

Page 1: Szczepan.faber.gradle

Gradlebuilding great tool

Page 2: Szczepan.faber.gradle

me

szczepan faber

lives in krakow/poland

lead at Mockito

core dev at Gradle

soccer junkie (idzie, idzie, idzie, …)

Page 3: Szczepan.faber.gradle

gradlewhat do you know about Gradle?

build tool

decent feature set and very active development

always open source and free

sustains its own conference

world domination in progress

Page 4: Szczepan.faber.gradle

gradleware

looks after Gradle

offers consulting

no vc

Page 5: Szczepan.faber.gradle

me @ gradleware

toolmaker

keen on quality and team efficiency

strategic clients (LinkedIn)

conferences

Page 6: Szczepan.faber.gradle

talk

automation dogfood

gradle in large projects

gradle team

Page 7: Szczepan.faber.gradle

inside Gradle

~ 7 very distributed full time engineers

frequent, regular releases (~ 6 weeks)

10000+ automated tests

contains documentation and release notes

Page 8: Szczepan.faber.gradle

automationcritical for high performing teams

allows us to achieve high quality

continuous investment

persistent problem

everyone’s responsibility

Page 9: Szczepan.faber.gradle

our business

automation + dogfood

quality focus

lots of work to make Gradle greater

Page 10: Szczepan.faber.gradle

LinkedInGradle should ‘just scale’

Page 11: Szczepan.faber.gradle

challenges

scaling Gradle off limits

dealing with single build pipeline

adding value with each release

Page 12: Szczepan.faber.gradle

Gradle in very large projects

small project: <10 subprojects

medium project: <50 subrpojects

large project: <200 subprojects

very large project: 200+ subprojects

gigantic project: 2000 subprojects (real!)

Page 13: Szczepan.faber.gradle

dealing with large projects

don’t

ant

gradle and maven

Page 14: Szczepan.faber.gradle

use the wrapper

Igor’s story

larger builds take longer to troubleshoot

make the dev environment as consistent as possible

Page 15: Szczepan.faber.gradle

use the daemon

large builds inherently provide slower feedback

use all possible ways to quicken the feedback

daemon means snappier builds

even snappier in the future

Page 16: Szczepan.faber.gradle

use Gradle 1.7+

caching of dependency metadata

smarter cross-process synchronisation

Page 17: Szczepan.faber.gradle

use Gradle 1.8+

serialisation of the dependency results

Page 18: Szczepan.faber.gradle

Use Gradle 1.9+

daemon keeps task history in memory

Page 19: Szczepan.faber.gradle

use Gradle 1.10+

daemon caches the classloaders

Page 20: Szczepan.faber.gradle

keep using latest Gradle

more coming

daemon keeps configured model in memory

daemon finds out-of-date tasks in the background

parallel configuration

Page 21: Szczepan.faber.gradle

dogfoodingdogfooding automation every day

Page 22: Szczepan.faber.gradle

IDE/Editor

Automate the “import” process

Prerequisites are java & IDE but no Gradle (thanks to Wrapper)

Provide a consistent setup

Make it possible to run frequent tasks via the IDE

Page 23: Szczepan.faber.gradle

Testing

Unit

we are fond of tests, TDD and high coverage

groovy tests (spock) for java code

Page 24: Szczepan.faber.gradle

Integration testing

every integration test can be ran in different modes:

embedded (speed, fast dev cycles, easy debugging)

forking (slower but more realistic)

daemon (excellent stress test and coverage test for the daemon)

parallel (excellent stress test and coverage test for parallel feature)

Page 25: Szczepan.faber.gradle

Integration testing

cross version integration tests (backward compatibility)

run test against a set of different versions of a 3rd party tool (e.g.building scala, running jUnit tests)

run test against a set of Gradle versions

full suite VS recent version only

tooling api cross version tests (backward and forward compatibility)

consumer & provider

Page 26: Szczepan.faber.gradle

Testing

Cross platform

Distribution

Performance

Page 27: Szczepan.faber.gradle

Testable documentation

Automatically tested documentation

samples (in user guide or in distribution)

evaluation

running arbitrary tasks and comparison of output

using samples content for integration tests

build script snippets in the javadoc - evaluation (dsl reference, javadocs)

java code snippets in the javadoc - compilation attempt (javadocs)

slideware automation

Page 28: Szczepan.faber.gradle

Documentation

Automatically deployed documentation

User guide

DSL reference

API reference

Release notes

Page 29: Szczepan.faber.gradle

Code Quality

Ensure public API is documented

License headers

Cyclical package dependencies

Static analysis (Checkstyle & Codenarc)

Page 30: Szczepan.faber.gradle

Build pipeline

Runs on every push

Identical on both branches (master & release)

TeamCity

Page 31: Szczepan.faber.gradle

Pipeline structure

Static analysis

Quick, less accurate tests (small number of platforms)

Build production like distributions

Platform tests

Execution mode tests

Performance test

Promote

Page 32: Szczepan.faber.gradle

Reusing binaries

Production like binaries built at start of pipeline

CI server pushes binaries to downstream builds

Page 33: Szczepan.faber.gradle

Release cycleA cycle is ~ 6 weeks.

Move to release branch after ~ 4 weeks

Plan new release ~ 4 weeks

Promote RC ~ 5 weeks

Promote final (end)

Merge release branch back to master (final)

Page 34: Szczepan.faber.gradle

Promotion

Separate “build” for promotion

Automatically checks out specific revision

Programatically rebuilds Gradle

Imposes the version number

Triggered by 1 click @ CI server

Page 35: Szczepan.faber.gradle

Delivery

Build, smoke test

Decorate docs with Google Analytics JS

Upload to (some bits)repo.gradle.org

Upload dists and decorated docs to Amazon S3

Checkout website repo, update data, push

Trigger pull new docs

Smoke test delivered distributions

Send notification email to team

Finish with manual processes

Page 36: Szczepan.faber.gradle

Gradle.org

Data driven

Push deploy

Updated by non technical staff

Post “release” test

Page 37: Szczepan.faber.gradle

Defect tracking/planningThree levels:

forums.gradle.org -> entry point

issues.gradle.org -> acknowledged defects

Pivotal Labs -> team planning

Automated move/sync data between systems.

Page 38: Szczepan.faber.gradle

ForumsSome interesting automations/tweaks:

Markdown/syntax highlighting

Issue number linking

Documentation linking

News

Roadmap

Page 39: Szczepan.faber.gradle

Thanks!

gradle.org

gradleware.com

Questions?