[Enhancement]: apply Gradle best practices

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

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

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

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.

Description

type/enhancement
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.

Dominant language
Java
Stars
8.8k
Forks
2k
Avg merge
2d 1h
Merged PRs (30d)
11

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

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.

More from testcontainers/testcontainers-java

All issues in testcontainers/testcontainers-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.