Class SecretCacheBuildService

java.lang.Object
io.github.arve0.onepassword.properties.SecretCacheBuildService
All Implemented Interfaces:
AutoCloseable, org.gradle.api.services.BuildService<org.gradle.api.services.BuildServiceParameters.None>

public abstract class SecretCacheBuildService extends Object implements org.gradle.api.services.BuildService<org.gradle.api.services.BuildServiceParameters.None>, AutoCloseable
Build-scoped in-memory cache for resolved 1Password secret values.

A single instance is shared across all projects in a build via a static volatile reference. When the plugin is applied to any project, it force-instantiates this service and registers it as the active instance. When the build finishes, close() clears the reference so the next build starts with an empty cache.

This means a secret reference used by multiple projects in a large monorepo is only resolved by one op read call per build, saving time when many projects share the same secrets.

  • Constructor Details

    • SecretCacheBuildService

      public SecretCacheBuildService()
  • Method Details