Class DevelocityConventions

java.lang.Object
io.github.gradle.conventions.customvalueprovider.DevelocityConventions

public class DevelocityConventions extends Object
  • Constructor Details

    • DevelocityConventions

      public DevelocityConventions(org.gradle.api.provider.ProviderFactory providerFactory)
  • Method Details

    • customValueSearchUrl

      public Optional<String> customValueSearchUrl(Map<String,String> search)
    • getEdgeDiscovery

      public boolean getEdgeDiscovery()
    • getDevelocityServerUrl

      public String getDevelocityServerUrl()
    • isCiServer

      public boolean isCiServer()
    • getEnvVariableThenSystemProperty

      public String getEnvVariableThenSystemProperty(String envName, String systemPropertyName, String defaultValue)
    • getSystemPropertyThenEnvVariable

      public String getSystemPropertyThenEnvVariable(String systemPropertyName, String envName, String defaultValue)
    • getSystemPropertyThenEnvVariable

      @Nullable public String getSystemPropertyThenEnvVariable(String systemPropertyName, String envName)
    • getSystemProperty

      public String getSystemProperty(String name, String defaultValue)
    • getSystemProperty

      @Nullable public String getSystemProperty(String name)
    • getEnvVariable

      public String getEnvVariable(String name, String defaultValue)
    • getEnv

      @Nullable public String getEnv(String name)
    • systemPropertyProvider

      public org.gradle.api.provider.Provider<String> systemPropertyProvider(String name)
    • environmentVariableProvider

      public org.gradle.api.provider.Provider<String> environmentVariableProvider(String name)
    • setCommitId

      public void setCommitId(Path projectDir, com.gradle.develocity.agent.gradle.scan.BuildScanConfiguration buildScan, String commitId)
      Add commit ID to tags.
      Parameters:
      projectDir - the project directory
      buildScan - the build scan extension
      commitId - the commit id
    • getCommitId

      public Optional<String> getCommitId(File workDir)
    • execAndGetStdout

      public static Optional<String> execAndGetStdout(Path workingDir, String... args)
      Executes the external process and returns its standard output. An empty optional is returned when the process fails to start or returns an error code.

      Avoid using this method at configuration time to keep configuration cache compatibility. It is an error with Gradle 7.5+. Since Gradle 7.6 it is safe to use this method in buildScan.background callback. Consider implementing ValueSource if you need to obtain external process output at configuration time.

      Parameters:
      workingDir - the working directory
      args - the process to run and its command-line arguments
      Returns:
      the contents of the stdout as a string