Interface Sample

All Superinterfaces:
org.gradle.api.Named, SampleSummary
All Known Implementing Classes:
SampleInternal

public interface Sample extends org.gradle.api.Named, SampleSummary
Represent a sample to be documented. Each sample must contain at least a Groovy or Kotlin DSL sample.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.gradle.api.Named

    org.gradle.api.Named.Namer
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    common(org.gradle.api.Action<? super org.gradle.api.file.ConfigurableFileCollection> action)
    Configure common content.
    org.gradle.api.file.ConfigurableFileCollection
     
    org.gradle.api.file.ConfigurableFileCollection
    By convention, this is the "groovy" directory in the sample directory.
    org.gradle.api.file.ConfigurableFileCollection
    By convention, this is the "kotlin" directory in the sample directory.
    org.gradle.api.file.RegularFileProperty
    By Convention, this is README.adoc within the sample directory.
    org.gradle.api.file.DirectoryProperty
    By convention, this is the sample name off the extension's sample root directory.
    org.gradle.api.file.ConfigurableFileCollection
     
    void
    groovy(org.gradle.api.Action<? super org.gradle.api.file.ConfigurableFileCollection> action)
    Configure Groovy content.
    void
    kotlin(org.gradle.api.Action<? super org.gradle.api.file.ConfigurableFileCollection> action)
    Configure Kotlin content.
    void
    tests(org.gradle.api.Action<? super org.gradle.api.file.ConfigurableFileCollection> action)
    Configure testing content.

    Methods inherited from interface org.gradle.api.Named

    getName

    Methods inherited from interface org.gradle.docs.samples.SampleSummary

    getCategory, getDescription, getDisplayName, getDsls, getPromoted, getSampleDocName
  • Method Details

    • getSampleDirectory

      org.gradle.api.file.DirectoryProperty getSampleDirectory()
      By convention, this is the sample name off the extension's sample root directory.
      Returns:
      Property for configuring the sample root directory.
    • getReadmeFile

      org.gradle.api.file.RegularFileProperty getReadmeFile()
      By Convention, this is README.adoc within the sample directory.
      Returns:
      Property for configuring the readme file for the sample in Asciidoctor format.
    • getCommonContent

      org.gradle.api.file.ConfigurableFileCollection getCommonContent()
      Returns:
      Sample content that is shared by all DSLs. By convention, this is the wrapper files and LICENSE.
    • common

      void common(org.gradle.api.Action<? super org.gradle.api.file.ConfigurableFileCollection> action)
      Configure common content.
      Parameters:
      action - configuration action
    • getGroovyContent

      org.gradle.api.file.ConfigurableFileCollection getGroovyContent()
      By convention, this is the "groovy" directory in the sample directory.
      Returns:
      Sample content that is used for Groovy DSL.
    • groovy

      void groovy(org.gradle.api.Action<? super org.gradle.api.file.ConfigurableFileCollection> action)
      Configure Groovy content.
      Parameters:
      action - configuration action
    • getKotlinContent

      org.gradle.api.file.ConfigurableFileCollection getKotlinContent()
      By convention, this is the "kotlin" directory in the sample directory.
      Returns:
      Sample content that is used for Kotlin DSL.
    • kotlin

      void kotlin(org.gradle.api.Action<? super org.gradle.api.file.ConfigurableFileCollection> action)
      Configure Kotlin content.
      Parameters:
      action - configuration action
    • getTestsContent

      org.gradle.api.file.ConfigurableFileCollection getTestsContent()
      Returns:
      Sample content that is used for Exemplar testing
    • tests

      void tests(org.gradle.api.Action<? super org.gradle.api.file.ConfigurableFileCollection> action)
      Configure testing content.
      Parameters:
      action - configuration action