testcontainers / testcontainers/testcontainers-java

[Enhancement]: apply Gradle best practices

Open
#10,286 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type/enhancement
Dominant language
Java
Stars
8.7k
Forks
1.9k
Avg merge
2d 17h
Merged PRs (30d)
9

Description

Module

Core

Proposal

Apply Gradle build practices so the build configuration does not take ~10 sec for every execution.

Currently, the project configuration takes ~11 seconds on Apple M1 which is very noticeable.
For instance, if I add a dependency to one of the modules, I have to wait for 10 seconds for the IDE to refresh. It does not have to be that long.

The slowness might be related to creating a lot of tasks eagerly "thanks" to old Groovy DSL code.

For instance, the code like the following always creates japicmp, and check tasks even in the case they will not be executed. The tasks are not required for IDE to pick up the updated project dependencies.

tasks.japicmp {
    dependsOn(tasks.shadowJar)
}
...

    project.tasks.check.dependsOn(japicmp)

PS. It would be nice to move to Kotlin DSL as per General Gradle Best Practices as well.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Core module's Gradle configuration and measure the reported roughly 11-second configuration time on an Apple M1. Inspect the eager task declarations shown in the issue and compare configuration behavior before and after the changes. Done means unnecessary tasks are not created during IDE dependency refresh and configuration time is reduced.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, kotlin
Domain
build-system, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.