Skip to content

Comments

Optimize Gradle build performance with advanced configuration#357

Merged
hossain-khan merged 2 commits intomainfrom
copilot/optimize-ci-build-time
Nov 26, 2025
Merged

Optimize Gradle build performance with advanced configuration#357
hossain-khan merged 2 commits intomainfrom
copilot/optimize-ci-build-time

Conversation

Copy link
Contributor

Copilot AI commented Nov 26, 2025

Applies Gradle performance optimizations from device-catalog-app#74 to reduce CI build times. Clean build + tests: ~3.5min → ~1min (~68% faster).

Changes

gradle.properties

  • JVM args: G1GC, soft ref tuning, 256MB code cache, 4GB heap
  • Kotlin daemon: Same GC opts, 320MB code cache
  • Parallel execution: org.gradle.parallel=true
  • Configuration cache: org.gradle.configuration-cache=true with parallel mode
  • Disable unused features: resvalues, shaders

app/build.gradle.kts

  • Fix getGitCommitHash() for configuration cache compatibility:
// Before: ProcessBuilder (incompatible with config cache)
fun getGitCommitHash(): String {
    val processBuilder = ProcessBuilder("git", "rev-parse", "--short", "HEAD")
    // ...
}

// After: providers.exec (config cache safe)
fun getGitCommitHash(): String {
    return providers.exec {
        commandLine("git", "rev-parse", "--short", "HEAD")
    }.standardOutput.asText.get().trim()
}

Reference: Now in Android gradle.properties

Original prompt

This section details on the original issue you should resolve

<issue_title>Faster CI build</issue_title>
<issue_description>Can the build be made faster by adopting some changes from hossain-khan/device-catalog-app#74 ?</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: hossain-khan <99822+hossain-khan@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve CI build speed based on suggestions from pull request 74 Optimize Gradle build performance with advanced configuration Nov 26, 2025
Copilot AI requested a review from hossain-khan November 26, 2025 08:43
@hossain-khan hossain-khan marked this pull request as ready for review November 26, 2025 08:55
@github-actions
Copy link

Code Coverage Report

View Coverage Report

@hossain-khan hossain-khan merged commit 8f93856 into main Nov 26, 2025
4 checks passed
@hossain-khan hossain-khan deleted the copilot/optimize-ci-build-time branch November 26, 2025 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Faster CI build

2 participants