Skip to content

Commit

Permalink
Discover and verify samples embedded in asciidoc
Browse files Browse the repository at this point in the history
This change allows users to test samples embedded in Asciidoctor.

SampleDiscovery.embeddedSamples() looks within all .adoc and
.asciidoc files for blocks marked with the .testable-sample role
and extracts source blocks with a file name to a temp directory,
then extracts a terminal command beginning with "$ " and its
output and verifies that the given sources + command produce the
given output, with normalization of course.

This is one solution for issue #2.
  • Loading branch information
eriwen committed Aug 9, 2018
1 parent 38e4569 commit e73c0e6
Show file tree
Hide file tree
Showing 22 changed files with 876 additions and 229 deletions.
168 changes: 0 additions & 168 deletions README.md

This file was deleted.

21 changes: 15 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
plugins {
`build-scan`
java
}

subprojects {
allprojects {
apply(plugin = "java-library")
apply(plugin = "maven-publish")

group = "org.gradle"
version = "0.4.2"

configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
Expand All @@ -20,6 +16,13 @@ subprojects {
}
jcenter()
}
}

subprojects {
apply(plugin = "maven-publish")

group = "org.gradle"
version = "0.4.2"

configure<PublishingExtension> {
publications.create<MavenPublication>("mavenJava") {
Expand All @@ -42,6 +45,10 @@ subprojects {
}
}

dependencies {
implementation(project(":sample-check"))
}

buildScan {
setTermsOfServiceUrl("https://gradle.com/terms-of-service")
setTermsOfServiceAgree("yes")
Expand All @@ -50,3 +57,5 @@ buildScan {
tag("CI")
}
}

java.sourceSets["test"].resources.srcDirs("docs")
3 changes: 3 additions & 0 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
object Versions {
val ASCIIDOCTORJ = "1.6.0-alpha.7"
val COMMONS_IO = "2.4"
val COMMONS_LANG3 = "3.7"
val JUNIT = "4.12"
Expand All @@ -9,6 +10,8 @@ object Versions {
}

object Libraries {
val ASCIIDOCTORJ = "org.asciidoctor:asciidoctorj:${Versions.ASCIIDOCTORJ}"
val ASCIIDOCTORJ_API = "org.asciidoctor:asciidoctorj-api:${Versions.ASCIIDOCTORJ}"
val COMMONS_IO = "commons-io:commons-io:${Versions.COMMONS_IO}"
val COMMONS_LANG3 = "org.apache.commons:commons-lang3:${Versions.COMMONS_LANG3}"
val JUNIT = "junit:junit:${Versions.JUNIT}"
Expand Down
Loading

0 comments on commit e73c0e6

Please sign in to comment.