Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,19 @@ dependencies {
lintChecks(libs.androidx.gradlePluginLints)
}

val docsDir = file("docs")

testing.suites {
getByName<JvmTestSuite>("test") { dependencies { implementation(libs.xmlunit) } }
register<JvmTestSuite>("documentTest") {
targets.configureEach {
testTask {
val docsDir =
file("docs").also {
if (!it.exists() || !it.isDirectory)
error("Docs dir $it does not exist or is not a directory.")
inputs.files(
fileTree(docsDir) {
// Changelog file doesn't contain code snippet to run.
exclude("changes/README.md")
}
// Add docs as an input directory to trigger ManualCodeSnippetTests re-run on changes.
inputs.dir(docsDir)
)
}
}
}
Expand Down Expand Up @@ -232,11 +233,6 @@ buildConfig {
buildConfigField("TEST_GRADLE_VERSION", testGradleVersion)
}
sourceSets.named("documentTest") {
val docsDir =
file("docs").also {
if (!it.exists() || !it.isDirectory)
error("Docs dir $it does not exist or is not a directory.")
}
Comment on lines -235 to -239

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check(langExecutables.sumOf { it.size } > 0) { "No code snippets found." }

buildConfigField("DOCS_DIR", docsDir.absolutePath)
}
}
Expand Down