diff --git a/gradle.properties b/gradle.properties index 98e26aa3..d7c7c7a4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,4 +3,5 @@ javaFormatVersion=0.0.15 org.gradle.daemon=false asciidoctorj15Version=1.5.8.1 asciidoctorj16Version=1.6.2 -asciidoctorj20Version=2.0.0-RC.3 +asciidoctorj20Version=2.0.0 +asciidoctorj21Version=2.1.0 diff --git a/settings.gradle b/settings.gradle index eabf9a19..458a5e3c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,7 +4,7 @@ include 'docs' include 'spring-restdocs-asciidoctor' include 'spring-restdocs-asciidoctor-1.5' include 'spring-restdocs-asciidoctor-1.6' -include 'spring-restdocs-asciidoctor-2.0' +include 'spring-restdocs-asciidoctor-2.x' include 'spring-restdocs-asciidoctor-support' include 'spring-restdocs-core' include 'spring-restdocs-mockmvc' diff --git a/spring-restdocs-asciidoctor-2.0/build.gradle b/spring-restdocs-asciidoctor-2.x/build.gradle similarity index 84% rename from spring-restdocs-asciidoctor-2.0/build.gradle rename to spring-restdocs-asciidoctor-2.x/build.gradle index 9ac719ef..f2ed1334 100644 --- a/spring-restdocs-asciidoctor-2.0/build.gradle +++ b/spring-restdocs-asciidoctor-2.x/build.gradle @@ -1,4 +1,4 @@ -description = 'AsciidoctorJ 2.0 extensions for Spring REST Docs' +description = 'AsciidoctorJ 2.x extensions for Spring REST Docs' dependencies { compileOnly "org.asciidoctor:asciidoctorj:$asciidoctorj20Version" diff --git a/spring-restdocs-asciidoctor-2.0/src/main/java/org/springframework/restdocs/asciidoctor/DefaultAttributesAsciidoctorJ20Preprocessor.java b/spring-restdocs-asciidoctor-2.x/src/main/java/org/springframework/restdocs/asciidoctor/DefaultAttributesAsciidoctorJ2xPreprocessor.java similarity index 95% rename from spring-restdocs-asciidoctor-2.0/src/main/java/org/springframework/restdocs/asciidoctor/DefaultAttributesAsciidoctorJ20Preprocessor.java rename to spring-restdocs-asciidoctor-2.x/src/main/java/org/springframework/restdocs/asciidoctor/DefaultAttributesAsciidoctorJ2xPreprocessor.java index 5ccd4919..3ed0a62c 100644 --- a/spring-restdocs-asciidoctor-2.0/src/main/java/org/springframework/restdocs/asciidoctor/DefaultAttributesAsciidoctorJ20Preprocessor.java +++ b/spring-restdocs-asciidoctor-2.x/src/main/java/org/springframework/restdocs/asciidoctor/DefaultAttributesAsciidoctorJ2xPreprocessor.java @@ -26,7 +26,7 @@ import org.asciidoctor.extension.PreprocessorReader; * * @author Andy Wilkinson */ -final class DefaultAttributesAsciidoctorJ20Preprocessor extends Preprocessor { +final class DefaultAttributesAsciidoctorJ2xPreprocessor extends Preprocessor { private final SnippetsDirectoryResolver snippetsDirectoryResolver = new SnippetsDirectoryResolver(); diff --git a/spring-restdocs-asciidoctor-2.0/src/main/java/org/springframework/restdocs/asciidoctor/RestDocsAsciidoctorJ20ExtensionRegistry.java b/spring-restdocs-asciidoctor-2.x/src/main/java/org/springframework/restdocs/asciidoctor/RestDocsAsciidoctorJ2xExtensionRegistry.java similarity index 83% rename from spring-restdocs-asciidoctor-2.0/src/main/java/org/springframework/restdocs/asciidoctor/RestDocsAsciidoctorJ20ExtensionRegistry.java rename to spring-restdocs-asciidoctor-2.x/src/main/java/org/springframework/restdocs/asciidoctor/RestDocsAsciidoctorJ2xExtensionRegistry.java index c0158d01..973b1b8c 100644 --- a/spring-restdocs-asciidoctor-2.0/src/main/java/org/springframework/restdocs/asciidoctor/RestDocsAsciidoctorJ20ExtensionRegistry.java +++ b/spring-restdocs-asciidoctor-2.x/src/main/java/org/springframework/restdocs/asciidoctor/RestDocsAsciidoctorJ2xExtensionRegistry.java @@ -20,17 +20,17 @@ import org.asciidoctor.Asciidoctor; import org.asciidoctor.jruby.extension.spi.ExtensionRegistry; /** - * AsciidoctorJ 2.0 {@link ExtensionRegistry} for Spring REST Docs. + * AsciidoctorJ 2.x {@link ExtensionRegistry} for Spring REST Docs. * * @author Andy Wilkinson */ -public final class RestDocsAsciidoctorJ20ExtensionRegistry implements ExtensionRegistry { +public final class RestDocsAsciidoctorJ2xExtensionRegistry implements ExtensionRegistry { @Override public void register(Asciidoctor asciidoctor) { - asciidoctor.javaExtensionRegistry().preprocessor(new DefaultAttributesAsciidoctorJ20Preprocessor()); + asciidoctor.javaExtensionRegistry().preprocessor(new DefaultAttributesAsciidoctorJ2xPreprocessor()); asciidoctor.rubyExtensionRegistry() - .loadClass(RestDocsAsciidoctorJ20ExtensionRegistry.class + .loadClass(RestDocsAsciidoctorJ2xExtensionRegistry.class .getResourceAsStream("/extensions/operation_block_macro.rb")) .blockMacro("operation", "OperationBlockMacro"); } diff --git a/spring-restdocs-asciidoctor-2.0/src/test/java/org/springframework/restdocs/asciidoctor/DefaultAttributesAsciidoctorJ20PreprocessorTests.java b/spring-restdocs-asciidoctor-2.x/src/test/java/org/springframework/restdocs/asciidoctor/DefaultAttributesAsciidoctorJ2xPreprocessorTests.java similarity index 92% rename from spring-restdocs-asciidoctor-2.0/src/test/java/org/springframework/restdocs/asciidoctor/DefaultAttributesAsciidoctorJ20PreprocessorTests.java rename to spring-restdocs-asciidoctor-2.x/src/test/java/org/springframework/restdocs/asciidoctor/DefaultAttributesAsciidoctorJ2xPreprocessorTests.java index e5f5ace4..4bb84aab 100644 --- a/spring-restdocs-asciidoctor-2.0/src/test/java/org/springframework/restdocs/asciidoctor/DefaultAttributesAsciidoctorJ20PreprocessorTests.java +++ b/spring-restdocs-asciidoctor-2.x/src/test/java/org/springframework/restdocs/asciidoctor/DefaultAttributesAsciidoctorJ2xPreprocessorTests.java @@ -26,11 +26,11 @@ import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; /** - * Tests for {@link DefaultAttributesAsciidoctorJ20Preprocessor}. + * Tests for {@link DefaultAttributesAsciidoctorJ2xPreprocessor}. * * @author Andy Wilkinson */ -public class DefaultAttributesAsciidoctorJ20PreprocessorTests { +public class DefaultAttributesAsciidoctorJ2xPreprocessorTests { @Test public void snippetsAttributeIsSet() { @@ -60,7 +60,7 @@ public class DefaultAttributesAsciidoctorJ20PreprocessorTests { private Asciidoctor createAsciidoctor() { Asciidoctor asciidoctor = Asciidoctor.Factory.create(); - asciidoctor.javaExtensionRegistry().preprocessor(new DefaultAttributesAsciidoctorJ20Preprocessor()); + asciidoctor.javaExtensionRegistry().preprocessor(new DefaultAttributesAsciidoctorJ2xPreprocessor()); return asciidoctor; } diff --git a/spring-restdocs-asciidoctor/build.gradle b/spring-restdocs-asciidoctor/build.gradle index c7fab675..dbcbf06f 100644 --- a/spring-restdocs-asciidoctor/build.gradle +++ b/spring-restdocs-asciidoctor/build.gradle @@ -6,7 +6,7 @@ configurations { dependencies { merge project(':spring-restdocs-asciidoctor-1.5') merge project(':spring-restdocs-asciidoctor-1.6') - merge project(':spring-restdocs-asciidoctor-2.0') + merge project(':spring-restdocs-asciidoctor-2.x') testCompile 'org.apache.pdfbox:pdfbox' testCompile 'org.asciidoctor:asciidoctorj:1.5.8.1' testCompile 'org.assertj:assertj-core' @@ -18,7 +18,7 @@ dependencies { jar { dependsOn ':spring-restdocs-asciidoctor-1.5:jar' dependsOn ':spring-restdocs-asciidoctor-1.6:jar' - dependsOn ':spring-restdocs-asciidoctor-2.0:jar' + dependsOn ':spring-restdocs-asciidoctor-2.x:jar' from configurations.merge.collect { file -> zipTree(file) } } @@ -26,6 +26,6 @@ matrixTest { asciidoctorj { group = 'org.asciidoctor' artifact = 'asciidoctorj' - versions = [ asciidoctorj16Version, asciidoctorj20Version ] + versions = [ asciidoctorj16Version, asciidoctorj20Version, asciidoctorj21Version ] } } \ No newline at end of file diff --git a/spring-restdocs-asciidoctor/src/main/resources/META-INF/services/org.asciidoctor.jruby.extension.spi.ExtensionRegistry b/spring-restdocs-asciidoctor/src/main/resources/META-INF/services/org.asciidoctor.jruby.extension.spi.ExtensionRegistry index 7ae7da38..249b935a 100644 --- a/spring-restdocs-asciidoctor/src/main/resources/META-INF/services/org.asciidoctor.jruby.extension.spi.ExtensionRegistry +++ b/spring-restdocs-asciidoctor/src/main/resources/META-INF/services/org.asciidoctor.jruby.extension.spi.ExtensionRegistry @@ -1 +1 @@ -org.springframework.restdocs.asciidoctor.RestDocsAsciidoctorJ20ExtensionRegistry +org.springframework.restdocs.asciidoctor.RestDocsAsciidoctorJ2xExtensionRegistry