liveBook · Manning

Incremental build

As explained in Microservices Patterns, Second Edition

An incremental build is a build process that recompiles, retests, or repackages only software elements affected by changes.

An incremental build recompiles and retests only software elements affected by a change, reusing results from earlier executions. This shortens deployment-pipeline feedback compared with rebuilding and testing everything. section 3.2.4

In a dependency-based build, the affected work is determined by changes and project relationships:

  • Retest the project containing changed files and projects that depend on it; unrelated projects can be skipped. section 4.3.1
  • Limit unnecessary dependencies to reduce build-time coupling and the number of projects affected by each change. section 5.4.4
  • Cloud pipelines often use ephemeral environments, so preserving earlier build results may require a build cache. section 3.2.4

Gradle project dependencies

In the FTGO example, changing Money in the money project triggers tests for money and dependent projects, including accounting, customer-management, and order-management. Changing Customer in customer-management affects customer-management and order-management, but not money or accounting. section 4.3.1

Figure 5.14 The time required to validate a change can be reduced by retesting only the build projects that are affected by the change: build projects containing the modified source files, and those that depend on them.
retest changed build projects

Shows how retesting only projects affected by a change reduces validation time. section 5.4.4

How Microservices Patterns, Second Edition covers it

How deep it goes
Explains task skipping and dependent-project retesting, while noting cache needs without detailing cache configuration.
Examples
Uses FTGO Gradle projects to trace the impact of changing Money or Customer classes.
What you can do after
Diagnose which build projects need recompilation and retesting after a change.
How it connects
Connects incremental builds with Gradle, deployment pipelines, build caches, and build-time coupling.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Microservices Patterns, Second Edition. The section links point to the parts of the book it draws on.