Pleasant Build Script Authoring with Kotlin

Hidden subtitle: Writing maintainable builds

Rodrigo B. de Oliveira, Paul Merlin

Who we are

Rodrigo B. de Oliveira

Paul Merlin

  • Principal Engineer at Gradle Inc.

  • Writer of Software

  • Dry Stone Builder

  • Wine Lover

Who are you?

IDE support

  • IntelliJ IDEA

  • Eclipse Buildship

Pleasant authoring experience?

Quickness

  • Quick feedback

    • the IDE helps, suggests, type-checks

  • Quick access to documentation

  • If it gets to that, quick access to source

Quickness

DEMO

Low cognitive overhead

  • You feel in control, never helpless

  • Discoverability of the dynamic model

Low cognitive overhead

DEMO

Organizing build logic

  • To take the most advantage of the IDE

  • With as less ceremony as possible

Organizing build logic

DEMO

Disclaimer

We’re not there yet!

  • Asynchronous build script classpath resolution from IDEs

  • Build logic organization refactorings in IDEs

  • Better contextual suggestions in IDEs

  • etc..

Challenges

  • Make the goodness available in all major IDEs

  • Being able to write settings.gradle.kts

  • Being able to write init scripts in Kotlin

  • Making the plugins from the plugin portal discoverable from the IDE

  • Better bridging across plugins written with only Groovy in mind

  • Moving away from the buildscript block

How does it work?

What’s next?

  • Deprecate the buildscript block in favor of the plugins block

    • Allow plugins to declare api dependencies

    • Allow script plugins to declare plugin dependencies

    • Allow to apply script plugins from the plugins block

    • Make community plugins available inside corporate environments

    • Make the plugins block work across included builds in a composite build

What’s next?

  • Deprecate the buildscript block in favor of the plugins block

  • Streamline build logic organization

    • Kotlin compiler plugins (allopen, ???)

    • Share external plugin configuration code

What’s next?

  • Deprecate the buildscript block in favor of the plugins block

  • Streamline build logic organization

  • Documentation

Call to action

Participate!

Questions?

Slides and code
https://github.com/bamboo/summit-2017-pleasant-authoring

Gradle Kotlin DSL
https://github.com/gradle/kotlin-dsl