• Stars
    star
    526
  • Rank 80,905 (Top 2 %)
  • Language
    Java
  • License
    MIT License
  • Created almost 11 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Source code for the Manning book "Gradle in Action"

Source code for "Gradle in Action" Build Status

Book cover

Building the code

All source code used in the book is based on Gradle 1.7. Please use the checked-in Wrapper to execute the samples. Please be aware that a later version of Gradle might not be compatible with the source code.

The source code is organized into individual chapters. Chapter 1 contains Ant and Maven build scripts. Please refer to the build tool's online manual for instructions to install the runtime and execute the build script. You can find more information here:

Starting with chapter 2, all source code can be run using the Gradle Wrapper which means no runtime will have to be installed. For example to run the "Hello World" build script from chapter 2 open a shell/command prompt and navigate to the directory. You can execute the build script by referencing the Gradle Wrapper command line script and providing the task you would like to run.

Windows:

> cd gradle-in-action-source/chapter02/helloworld-task-doLast
> ../../gradlew.bat helloWorld

*nix:

$ cd gradle-in-action-source/chapter02/helloworld-task-doLast 
$ ../../gradlew helloWorld

Putting it all together

Gradle in Action demonstrates how to implement build logic needed for various stages of a Continuous Delivery pipeline. While the book discusses specific functionality step by step, you might want to see it all put together. You can find the sample To Do application extended by typical project automation functionality (like testing strategies, publishing and deployment logic etc.) in a dedicated repository. Furthermore, you can find an updated version of the To Do application implemented with Spring Boot, built on a declarative Jenkins pipeline and deployed to Heroku in the blog post "Build pipelines with Jenkins 2 by example".

Going further

The book discusses how to integrate third-party functionality by writing custom tasks or plugins. Some of the examples have been developed further and are available as full-fledged binary plugins ready to be used in your own projects.

Unfortunately, I could not cover all topics readers were interested in. Here's a list of example projects that should get you started:

Continuous Integration

Most of the source code listings are automatically executed with the help of the Gradle tooling API. Whenever there's a change to the code, a corresponding job is triggered. Each build works through a list of predefined tasks for each chapter and verifies the expected outcome.

More Repositories

1

gradle-docker-plugin

Gradle plugin for managing Docker images and containers.
Java
1,204
star
2

ckad-crash-course

In-depth and hands-on practice for acing the exam.
JavaScript
680
star
3

gradle-tomcat-plugin

Gradle plugin supporting deployment of your web application to an embedded Tomcat web container
Groovy
533
star
4

ckad-prep

Exercises demonstrated as part of the video course "Certified Kubernetes Application Developer (CKAD) Prep Course" published by O'Reilly Media.
504
star
5

gradle-nexus-plugin

Gradle plugin for configuring and uploading artifacts to Sonatype Nexus
Groovy
290
star
6

gradle-cargo-plugin

Gradle plugin that provides deployment capabilities to local and remote containers via Cargo
Groovy
254
star
7

cka-crash-course

In-depth and hands-on practice for acing the exam.
Shell
248
star
8

ckad-study-guide

Code example from the book "Certified Kubernetes Application Developer (CKAD) Study Guide" published by O'Reilly Media.
JavaScript
171
star
9

cka-study-guide

Code example from the book "Certified Kubernetes Administrator (CKA) Study Guide" published by O'Reilly Media.
Shell
126
star
10

gradle-android-examples

Demonstrates the use of Gradle for Android projects
Shell
95
star
11

cks-crash-course

In-depth and hands-on practice for acing the exam.
Shell
75
star
12

gradle-clover-plugin

Gradle plugin for generating a code coverage report using Clover
Groovy
73
star
13

go-testing-frameworks

Demonstrates the use of different test frameworks for Go code.
Go
69
star
14

gradle-gae-plugin

Gradle plugin that provides tasks for uploading, running and managing Google App Engine projects
Groovy
64
star
15

gradle-izpack-plugin

Gradle plugin that provides support for packaging applications for the Java platform via IzPack.
Groovy
63
star
16

cje-crash-course

In-depth and hands-on practice for acing the exam.
62
star
17

cta-crash-course

In-depth and hands-on practice for acing the exam.
HCL
52
star
18

gradle-vagrant-plugin

Gradle plugin for managing Vagrant boxes.
Groovy
48
star
19

gradle-initializr

A web-based quickstart generator for Gradle projects
Java
45
star
20

testing-go-projects

The exercises and samples for the training "Testing Go Projects".
Go
39
star
21

docker-for-jvm-projects

The exercises and samples for the training "Docker for JVM projects".
Java
39
star
22

practical-go-modules

The exercises and samples for the training "Practical Go Modules".
Go
36
star
23

todo

A sample To Do web application built with Gradle.
Java
33
star
24

link-verifier

A tool for verifying links in text-based files
Go
27
star
25

testcontainers-integration-testing

The exercises and samples for the training "Integration Testing with Docker and Testcontainers".
Java
26
star
26

grails-google-visualization

Grails plugin that provides a taglib for the interactive charts of the Google Visualization API
Groovy
25
star
27

cje-prep

Exercises demonstrated as part of the video course "Certified Jenkins Engineer (CJE) Prep Course" published by O'Reilly Media.
22
star
28

cks-study-guide

Code example from the book "Certified Kubernetes Security Specialist (CKS) Study Guide" published by O'Reilly Media.
Shell
21
star
29

gradle-javafx-hello-world

Simple Hello World JavaFX project built with Gradle
Groovy
19
star
30

todo-spring-boot

A sample To Do web application built with Gradle and Spring Boot.
Java
19
star
31

go-project-automation

The exercises and samples for the training "Go project automation".
Go
18
star
32

todo-web-service-exercise

A RESTful web service to managing ToDo items.
Java
18
star
33

asciidoctorj-tabbed-code-extension

An AsciidoctorJ extension for rendering code on multiple tabs.
Java
17
star
34

tooling-api-custom-model

Demonstrates the use of a custom model with Gradle's tooling API.
Java
16
star
35

gradle-kubernetes-plugin

Groovy
16
star
36

getting-started-with-bazel

Materials and hand-on exercises for beginner training course on Bazel
Java
15
star
37

cva-crash-course

In-depth and hands-on practice for acing the exam.
HCL
13
star
38

lets-gopher-exercise

A flexible project generator for Go.
Go
12
star
39

jenkins-with-kubernetes

Step by step instructions on how to use the Jenkins Kubernetes plugin for different use cases.
Groovy
11
star
40

kubectl-swiftnp

A kubectl plugin for rendering details of Network Policies.
Go
11
star
41

letsgopher

A simple, yet flexible project generator for Go projects.
Go
10
star
42

groovy-sql-builders

Domain Specific Language for Groovy SQL based on builder API
Groovy
9
star
43

gradle-java2html-plugin

Gradle plugin for turning source code into HTML, RTF, TeX and XHTML using Java2HTML
Groovy
9
star
44

rules_java_war

Bazel rules for generating a Java Web Archive (WAR).
Python
8
star
45

dockerized-spring-boot-app

A dockerized Spring Boot application.
Java
8
star
46

getting-started-bazel

Getting started with Bazel with the help of Java-based examples.
Starlark
8
star
47

bazel-examples

A collection of projects built with Bazel.
Python
7
star
48

gaelyk-jsonlib-plugin

Gaelyk plugin providing JSON support via JSON-lib
Groovy
7
star
49

CKAD-exercises

A set of exercises to prepare for Certified Kubernetes Application Developer exam by Cloud Native Computing Foundation
7
star
50

gradle-junit5-kotlin-dsl

Kotlin
6
star
51

todo-web-service

A simple RESTful web service for managing ToDo items.
Java
6
star
52

whats-new-in-java-11

A test-driven approach to demonstrating new features and APIs in Java 11.
Java
6
star
53

groovy-sql-examples

Groovy SQL examples
Groovy
5
star
54

jenkins-workflow-sample

Demonstrates the use of the Jenkins Workflow plugin to model a build pipeline.
Groovy
4
star
55

junit5-vs-spock-feature-comparison

Compares JUnit 5 with Spock features by example.
Java
4
star
56

gradle-junit5-test

Demonstrates use of JUnit 5 Launcher API for discovering and executing tests
Java
4
star
57

favalike

Bookmark manager built with Grails for Google App Engine Java
JavaScript
4
star
58

gradle-custom-distribution

Custom Gradle distribution for standardizing builds across projects
Groovy
4
star
59

docker-compose-integration-testing

Integration testing using Docker Compose bootstrapped by Gradle.
Java
3
star
60

kubectl-server-version

A kubectl plugin for rendering the Kubernetes server version.
Go
3
star
61

docker-integration-testing

Integration testing against a Docker container as part of a Gradle build.
Java
3
star
62

gradle-release-strategy

Release strategy interferring project version from Git tag.
Java
3
star
63

jenkins-shared-lib-gradle

A Jenkins shared library for invoking Gradle build steps.
Groovy
3
star
64

presentations

Presentation slides and source code
Groovy
3
star
65

vagrant-build-pipeline

Virtual box built with Vagrant that implements a build pipeline
Puppet
2
star
66

todo-docker-swarm

A Vagrant setup for Docker Swarm.
2
star
67

whats-new-in-java-12

A test-driven approach to demonstrating new features and APIs in Java 12.
Java
2
star
68

groovy-payflowpro

Groovy client for PayPal Payflow Pro API
Groovy
2
star
69

todo-web-app

A To Do web application using a RESTful web service as backend.
Java
2
star
70

ide-composable-build

Java
1
star
71

dotfiles

Shell Configuration
Vim Script
1
star
72

idefiles

IDE Configuration
Java
1
star
73

gradle-issue-26802-reproducer

1
star
74

go-on-jenkins

Go
1
star
75

gradle-docker-convention-plugin

Gradle convention plugin for building and pushing Docker images for Node.js applications.
Groovy
1
star
76

gradle-in-action-errata

Errata for the Manning book "Gradle in Action"
1
star
77

trackmybucketlist

Track My Bucket List: Manage Your Life Goals
JavaScript
1
star
78

gradle-node-plugin

Java
1
star
79

bmuschko

1
star
80

passenger

Groovy
1
star
81

gradle-cloudbees-plugin

Gradle plugin that provides support for managing applications and databases on CloudBees RUN@cloud
Groovy
1
star
82

gradle-testkit-gradlebuild

Groovy
1
star
83

testcontainers-spring-boot

A Spring Boot application tested with TestContainers.
Java
1
star