Class ProcessedResourcesSpec

java.lang.Object
com.gradle.develocity.agent.gradle.test.ProcessedResourcesSpec

public class ProcessedResourcesSpec extends Object
Configuration for a named set of resource files whose contents reference absolute paths that need to be rewritten when tests are executed on remote test execution agents.

When Test Distribution executes tests on a remote agent, files produced on the local machine may contain absolute paths that are not valid on the agent. Registering such files as processed resources causes Test Distribution to scan their contents and rewrite any references to local workspace paths so that they point to the equivalent locations on the agent.

Specs are registered on the processedResources container, for example:

 test {
     distribution {
         processedResources {
             resources {
                 files.from('src/test/resources')
                 charset = java.nio.charset.StandardCharsets.UTF_8
             }
         }
     }
 }
 
  • Constructor Details

    • ProcessedResourcesSpec

      @Inject public ProcessedResourcesSpec(String name, ObjectFactory objectFactory)
  • Method Details

    • getName

      public String getName()
      The name that identifies this spec within the processedResources container.
      Returns:
      the name of this spec
    • getFiles

      public ConfigurableFileCollection getFiles()
      The set of files whose contents should be scanned and have absolute path references rewritten before tests are executed on remote test execution agents.
      Returns:
      the files to process
    • getCharset

      public Property<Charset> getCharset()
      The charset used to read the files when scanning their contents.

      Defaults to the JVM's default charset.

      Returns:
      the charset used to read the files