Skip to content

Commit 66787cd

Browse files
committed
Broaden compatibility testing for Asciidoctor 2.x
Closes gh-630
1 parent 3597ebc commit 66787cd

File tree

8 files changed

+16
-15
lines changed

8 files changed

+16
-15
lines changed

gradle.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ javaFormatVersion=0.0.15
33
org.gradle.daemon=false
44
asciidoctorj15Version=1.5.8.1
55
asciidoctorj16Version=1.6.2
6-
asciidoctorj20Version=2.0.0-RC.3
6+
asciidoctorj20Version=2.0.0
7+
asciidoctorj21Version=2.1.0

settings.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ include 'docs'
44
include 'spring-restdocs-asciidoctor'
55
include 'spring-restdocs-asciidoctor-1.5'
66
include 'spring-restdocs-asciidoctor-1.6'
7-
include 'spring-restdocs-asciidoctor-2.0'
7+
include 'spring-restdocs-asciidoctor-2.x'
88
include 'spring-restdocs-asciidoctor-support'
99
include 'spring-restdocs-core'
1010
include 'spring-restdocs-mockmvc'

spring-restdocs-asciidoctor-2.0/build.gradle renamed to spring-restdocs-asciidoctor-2.x/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
description = 'AsciidoctorJ 2.0 extensions for Spring REST Docs'
1+
description = 'AsciidoctorJ 2.x extensions for Spring REST Docs'
22

33
dependencies {
44
compileOnly "org.asciidoctor:asciidoctorj:$asciidoctorj20Version"
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
* @author Andy Wilkinson
2828
*/
29-
final class DefaultAttributesAsciidoctorJ20Preprocessor extends Preprocessor {
29+
final class DefaultAttributesAsciidoctorJ2xPreprocessor extends Preprocessor {
3030

3131
private final SnippetsDirectoryResolver snippetsDirectoryResolver = new SnippetsDirectoryResolver();
3232

Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@
2020
import org.asciidoctor.jruby.extension.spi.ExtensionRegistry;
2121

2222
/**
23-
* AsciidoctorJ 2.0 {@link ExtensionRegistry} for Spring REST Docs.
23+
* AsciidoctorJ 2.x {@link ExtensionRegistry} for Spring REST Docs.
2424
*
2525
* @author Andy Wilkinson
2626
*/
27-
public final class RestDocsAsciidoctorJ20ExtensionRegistry implements ExtensionRegistry {
27+
public final class RestDocsAsciidoctorJ2xExtensionRegistry implements ExtensionRegistry {
2828

2929
@Override
3030
public void register(Asciidoctor asciidoctor) {
31-
asciidoctor.javaExtensionRegistry().preprocessor(new DefaultAttributesAsciidoctorJ20Preprocessor());
31+
asciidoctor.javaExtensionRegistry().preprocessor(new DefaultAttributesAsciidoctorJ2xPreprocessor());
3232
asciidoctor.rubyExtensionRegistry()
33-
.loadClass(RestDocsAsciidoctorJ20ExtensionRegistry.class
33+
.loadClass(RestDocsAsciidoctorJ2xExtensionRegistry.class
3434
.getResourceAsStream("/extensions/operation_block_macro.rb"))
3535
.blockMacro("operation", "OperationBlockMacro");
3636
}
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
import static org.assertj.core.api.Assertions.assertThat;
2727

2828
/**
29-
* Tests for {@link DefaultAttributesAsciidoctorJ20Preprocessor}.
29+
* Tests for {@link DefaultAttributesAsciidoctorJ2xPreprocessor}.
3030
*
3131
* @author Andy Wilkinson
3232
*/
33-
public class DefaultAttributesAsciidoctorJ20PreprocessorTests {
33+
public class DefaultAttributesAsciidoctorJ2xPreprocessorTests {
3434

3535
@Test
3636
public void snippetsAttributeIsSet() {
@@ -60,7 +60,7 @@ private Options createOptions(String attributes) {
6060

6161
private Asciidoctor createAsciidoctor() {
6262
Asciidoctor asciidoctor = Asciidoctor.Factory.create();
63-
asciidoctor.javaExtensionRegistry().preprocessor(new DefaultAttributesAsciidoctorJ20Preprocessor());
63+
asciidoctor.javaExtensionRegistry().preprocessor(new DefaultAttributesAsciidoctorJ2xPreprocessor());
6464
return asciidoctor;
6565
}
6666

spring-restdocs-asciidoctor/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ configurations {
66
dependencies {
77
merge project(':spring-restdocs-asciidoctor-1.5')
88
merge project(':spring-restdocs-asciidoctor-1.6')
9-
merge project(':spring-restdocs-asciidoctor-2.0')
9+
merge project(':spring-restdocs-asciidoctor-2.x')
1010
testCompile 'org.apache.pdfbox:pdfbox'
1111
testCompile 'org.asciidoctor:asciidoctorj:1.5.8.1'
1212
testCompile 'org.assertj:assertj-core'
@@ -18,14 +18,14 @@ dependencies {
1818
jar {
1919
dependsOn ':spring-restdocs-asciidoctor-1.5:jar'
2020
dependsOn ':spring-restdocs-asciidoctor-1.6:jar'
21-
dependsOn ':spring-restdocs-asciidoctor-2.0:jar'
21+
dependsOn ':spring-restdocs-asciidoctor-2.x:jar'
2222
from configurations.merge.collect { file -> zipTree(file) }
2323
}
2424

2525
matrixTest {
2626
asciidoctorj {
2727
group = 'org.asciidoctor'
2828
artifact = 'asciidoctorj'
29-
versions = [ asciidoctorj16Version, asciidoctorj20Version ]
29+
versions = [ asciidoctorj16Version, asciidoctorj20Version, asciidoctorj21Version ]
3030
}
3131
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
org.springframework.restdocs.asciidoctor.RestDocsAsciidoctorJ20ExtensionRegistry
1+
org.springframework.restdocs.asciidoctor.RestDocsAsciidoctorJ2xExtensionRegistry

0 commit comments

Comments
 (0)