Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Implementing Custom DSL with Groovy in 20 Minutes

Szymon Stepniak via YouTube

Overview

Discover how to implement custom Domain-Specific Languages (DSLs) using Apache Groovy in this comprehensive tutorial. Learn to create fluent DSLs by building a Jenkins pipeline example from scratch, using only plain Groovy without additional libraries or build tools. Explore key concepts such as closure delegation, @DelegatesTo annotation for code completion, Groovy's "with" method, and various DSL classes. Master the implementation of pipeline steps, utilize @NamedParams and @ClosureParams annotations, and run the example with static compilation enabled. Gain practical insights into Groovy DSL development and enhance your programming skills in just 23 minutes.

Syllabus

| Introduction
| Implementing "pipeline" method
| PipelineDsl Groovy class
| Introducing closure delegation
| Introducing @DelegatesTo annotation for code completion
| Implementing "environment" method
| Introducing Groovy's "with" method
| StagesDsl Groovy class
| StageDsl Groovy class
| Steps Groovy class
| Implementing "echo" pipeline step
| Implementing "sh" pipeline step
| Introducing @NamedParams annotation
| Introducing @ClosureParams annotation
| Running example with the static compilation enabled

Taught by

Szymon Stepniak

Reviews

Start your review of Implementing Custom DSL with Groovy in 20 Minutes

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.