Package org.gradle.docs.samples
Interface Sample
- All Superinterfaces:
org.gradle.api.Named,SampleSummary
- All Known Implementing Classes:
SampleInternal
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 TypeMethodDescriptionvoidcommon(org.gradle.api.Action<? super org.gradle.api.file.ConfigurableFileCollection> action) Configure common content.org.gradle.api.file.ConfigurableFileCollectionorg.gradle.api.file.ConfigurableFileCollectionBy convention, this is the "groovy" directory in the sample directory.org.gradle.api.file.ConfigurableFileCollectionBy convention, this is the "kotlin" directory in the sample directory.org.gradle.api.file.RegularFilePropertyBy Convention, this is README.adoc within the sample directory.org.gradle.api.file.DirectoryPropertyBy convention, this is the sample name off the extension's sample root directory.org.gradle.api.file.ConfigurableFileCollectionvoidgroovy(org.gradle.api.Action<? super org.gradle.api.file.ConfigurableFileCollection> action) Configure Groovy content.voidkotlin(org.gradle.api.Action<? super org.gradle.api.file.ConfigurableFileCollection> action) Configure Kotlin content.voidtests(org.gradle.api.Action<? super org.gradle.api.file.ConfigurableFileCollection> action) Configure testing content.Methods inherited from interface org.gradle.api.Named
getNameMethods 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
-