Skip to content

Optimize Gradle build performance for faster iteration#193

Merged
em3s merged 4 commits intomainfrom
feat/optimize-gradle-build-performance
Feb 9, 2026
Merged

Optimize Gradle build performance for faster iteration#193
em3s merged 4 commits intomainfrom
feat/optimize-gradle-build-performance

Conversation

@em3s
Copy link
Copy Markdown
Contributor

@em3s em3s commented Feb 9, 2026

Summary

Optimize Gradle build/test cycle for faster AI-assisted iterative development. Eliminates unnecessary tasks (spotlessCheck, javadoc, sourcesJar) from default builds and enables parallel execution.

Plan

Created by claude code (opus 4.6)

  • Step 1: gradle.properties — enable parallel builds, increase JVM memory
  • Step 2: BaseConventionsPlugin.kt — decouple spotlessCheck from check lifecycle
  • Step 3: BaseConventionsPlugin.kt — make javadocJar/sourcesJar CI-only
  • Step 4: BaseConventionsPlugin.kt — reduce test logging verbosity
  • Step 5: Verify build + test pass, confirm task count reduction

Details

Change What Why
org.gradle.parallel=true Build independent modules concurrently 6 modules currently built sequentially
org.gradle.daemon=true Keep Gradle JVM alive between runs Eliminates ~3-5s cold start on repeat builds
-Xmx2g -XX:+UseParallelGC More heap + parallel GC Default 512MB causes GC pressure with 6 modules
Decouple spotlessCheck Remove from check task ~10 tasks removed from every build
CI-only javadoc/sources Skip locally, keep in CI ~10 tasks removed from every build
Test logging: FAILED only Hide PASSED/SKIPPED output Reduce I/O noise

Not included: org.gradle.configuration-cache — incompatible with ProjectExt.kt (runs git commands during configuration phase). Separate task.

Progress

🤖 Generated with Claude Code

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. maintenance Maintenance work. labels Feb 9, 2026
- Enable parallel builds and increase daemon heap to 2GB with ParallelGC
- Decouple spotlessCheck from build lifecycle (enforceCheck=false)
- Skip javadocJar/sourcesJar on local builds (CI-only)
- Reduce test output to FAILED events only
- Add explicit spotlessCheck to CI workflow

Build tasks reduced from 131 to 91 (30% reduction).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@em3s em3s force-pushed the feat/optimize-gradle-build-performance branch from 54a378c to 550ad8f Compare February 9, 2026 06:04
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Feb 9, 2026
Copy link
Copy Markdown
Contributor Author

@em3s em3s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review — claude code (opus 4.6)

Overall the approach is sound — decouple expensive tasks locally, keep them enforced in CI. No critical issues.


MEDIUM

1. org.gradle.daemon=true is redundant (gradle.properties:6)

  • Gradle daemon is enabled by default since Gradle 3.0. This line is a no-op. Remove it or add a comment that it's intentional documentation.

2. System.getenv("CI") at configuration time (BaseConventionsPlugin.kt:62)

  • Works correctly, but creates an implicit undocumented dependency on the CI env var. With org.gradle.caching=true, switching environments could cause stale cache behavior since System.getenv() isn't tracked as a configuration cache input.
  • Consider using a Gradle property instead (-PgenerateJars=true), which integrates better with caching. At minimum, add a comment explaining why.

3. Format violations won't be caught locally

  • setEnforceCheck(false) means ./gradlew build no longer runs spotless. CI compensates correctly (spotlessCheck build), but developers will only discover violations after push. Consider documenting that ./gradlew spotlessApply should be run before pushing, or adding a lightweight pre-commit hook.

LOW

4. SKIPPED tests are now invisible (BaseConventionsPlugin.kt:78)

  • Logging only FAILED hides skipped tests, which can indicate forgotten @Disabled annotations or environment issues. Consider:
events = setOf(TestLogEvent.FAILED, TestLogEvent.SKIPPED)

5. println in convention plugins (BaseConventionsPlugin.kt:18)

  • Pre-existing (not introduced by this PR), but worth a follow-up ticket to replace with project.logger.lifecycle() across all convention plugins.

Positive

  • CI workflow change is correct — spotlessCheck build ensures formatting is still enforced
  • org.gradle.parallel=true will meaningfully speed up the multi-module build
  • maxParallelForks logic is safe and well-implemented
  • The overall strategy (fast local, strict CI) is pragmatic

Verdict: Approve with minor changes. The MEDIUM items are worth addressing before merge but nothing is blocking.

em3s and others added 2 commits February 9, 2026 15:16
- Remove redundant org.gradle.daemon=true (default since Gradle 3.0)
- Add SKIPPED to test log events for visibility into disabled tests
- Replace println with project.logger.lifecycle() in convention plugins
- Add comments explaining CI-only jar generation and spotless workflow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… convention plugins

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Feb 9, 2026
@em3s
Copy link
Copy Markdown
Contributor Author

em3s commented Feb 9, 2026

Changes Summary — claude code (opus 4.6)

Original PR

  • gradle.properties — enable parallel builds, increase JVM memory
  • BaseConventionsPlugin — decouple spotlessCheck, CI-only javadoc/sources, reduce test log verbosity
  • CI workflow — explicitly run spotlessCheck build

Review Fixes

  • Remove redundant org.gradle.daemon=true (default since Gradle 3.0)
  • Add SKIPPED back to test log events for visibility
  • Add comments explaining CI-only jar generation and spotless workflow
  • Replace println with project.logger.lifecycle() in all 9 convention plugins

…ntion plugins

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@em3s em3s merged commit 83dff43 into main Feb 9, 2026
7 checks passed
@em3s em3s self-assigned this Feb 9, 2026
@em3s em3s changed the title chore(build): optimize Gradle build performance for faster iteration Optimize Gradle build performance for faster iteration Feb 12, 2026
@em3s em3s deleted the feat/optimize-gradle-build-performance branch March 1, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Maintenance work. size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant