Class OnePasswordGradlePropertiesPlugin

java.lang.Object
io.github.arve0.onepassword.properties.OnePasswordGradlePropertiesPlugin
All Implemented Interfaces:
org.gradle.api.Plugin<org.gradle.api.Project>

public final class OnePasswordGradlePropertiesPlugin extends Object implements org.gradle.api.Plugin<org.gradle.api.Project>
A Gradle plugin that exposes 1Password secret references as lazy Provider<String> extra properties.

For each project property whose value starts with op://, the plugin:

  1. Validates the reference eagerly (fail-fast at configuration time for obviously invalid refs).
  2. Registers a Provider<String> backed by OpReadValueSource in extra properties, without resolving the secret immediately.

Whether the secret ends up in the configuration cache depends on when the caller calls .get() on the provider:

  • Execution time (e.g. inside doLast): secret is NOT stored in the cache; op is called once per build at execution time.
  • Configuration time (e.g. for repository credentials): Gradle fingerprints the value and stores it in the cache; op is called on every build for fingerprint validation.
  • Constructor Details

    • OnePasswordGradlePropertiesPlugin

      public OnePasswordGradlePropertiesPlugin()
  • Method Details

    • apply

      public void apply(org.gradle.api.Project project)
      Specified by:
      apply in interface org.gradle.api.Plugin<org.gradle.api.Project>