Commit Graph

25 Commits

Author SHA1 Message Date
Andy Wilkinson
cf77eabe04 Use code block switch extension from separate project
This should have been merged forwards following the changes in
70df55d413.

See gh-229
2017-05-11 15:15:00 +01:00
Andy Wilkinson
3262149283 Merge branch '1.1.x' 2017-03-24 14:46:38 +00:00
Andy Wilkinson
af0cd029c7 Ensure that samples' REST Docs version is updated before they are built 2017-03-24 14:42:09 +00:00
Andy Wilkinson
70df55d413 Use code block switch extension from separate project
Closes gh-229
2017-03-08 13:04:27 +00:00
Andy Wilkinson
b6f986556e Upgrade to Gradle 3.4
Closes gh-283
2017-03-03 21:03:39 +00:00
Andy Wilkinson
34ec9d523d Polish "Add Grails sample app" (1338df9)
The sole structural change is to rearrange the build slightly so that,
like the other samples, the version of the Grails sample's REST Docs
dependency is automatically updated.

See gh-250
2016-05-31 10:00:52 +01:00
Andy Wilkinson
68bb29937e Merge branch '1.0.x' 2016-05-05 13:26:20 +01:00
Andy Wilkinson
40a12127d7 Alternative approach to getting a stacktrace for a sample build failure 2016-05-05 13:25:10 +01:00
Andy Wilkinson
615e568dec Merge branch '1.0.x' 2016-05-05 12:32:11 +01:00
Andy Wilkinson
99b84e40f4 Output stacktrace when Gradle samples fails to build 2016-05-05 12:29:17 +01:00
Andy Wilkinson
9e84922e09 Upgrade samples to Spring Boot 1.3.3.RELEASE
Closes gh-222
2016-05-05 11:29:45 +01:00
Andy Wilkinson
d84fca4d63 Ensure that version updates are applied to Slate sample 2016-02-16 10:47:07 +00:00
Andy Wilkinson
ba76c2f843 Add a sample showing how to use Spring REST Docs with Slate
Closes gh-124
2016-02-15 17:52:08 +00:00
Andy Wilkinson
5f4541bf69 Collapse Maven and Gradle setup into one section with switchable examples
This commit adds an Asciidoctor extension that post-processes code
blocks, collapsing any secondary blocks into the preceding primary
block. The primary block is then augmented with a switch. This switch
contains one item for each block. Clicking an item causes the associated
block’s content to be displayed. Each item is named using its block’s
title.

The getting started instructions have been updated to take advantage of
this new switching support, with the Maven and Gradle instructions
being collapsed into a single section.

Closes gh-189
2016-01-27 17:02:00 +00:00
Andy Wilkinson
194e62bde3 Remove assumption that working directory will be the project’s root
The plugin for building the samples assumed that the current working
directory would be the directory containing the project’s build.gradle.
While this is generally true on the command line (it isn’t if
-project-dir is used), it isn’t true in Gradle’s IDE integration. This
was leading to an NPE as the sampleBuild task was being configured
to depend on a null task as a result of not finding the sample’s pom.xml
or build.grade file.

This commit corrects the main build.gradle to configure each sample’s
working directory relative to the root project’s directory, rather
than relying on the working directory. It also improves
SampleBuildConfigurer so that it will throw an exception if it fails to
find a sample’s build.gradle or pom.xml rather than continuing
and triggering an NPE inside Gradle.

Closes gh-185
2016-01-17 20:25:21 +00:00
Andy Wilkinson
6443ed177e Fix building Maven sample on Windows 2015-10-06 17:48:30 +01:00
Andy Wilkinson
75e965c782 Correct the name of the mvnw script on Windows 2015-10-06 17:15:47 +01:00
Andy Wilkinson
9a362abe77 Update reference to mvnw.bat when building samples on Windows 2015-10-06 17:07:46 +01:00
Andy Wilkinson
c97efcce2e Use the Maven Wrapper in the Spring Data REST-based sample
Closes gh-146
2015-10-06 16:41:34 +01:00
Andy Wilkinson
fece9547ea Automatically align version of samples' dependency with main version
This commit enhances the tasks that build the samples to
automatically update the version of their spring-restdocs dependency
to match the version of the main project.
2015-09-08 11:25:06 +01:00
Andy Wilkinson
7235a49dbc Update sample verification to look for snippets in correct location
Previously each sample was built with both Maven and Gradle and the
snippets produced by each build were verified. Now each sample is only
built with either Maven or Gradle. This commit updates the snippet
verification process to look for snippets in the location that’s
appropriate for the sample’s build system.
2015-09-03 15:05:45 +01:00
Andy Wilkinson
2b2b6fcd25 Isolate and reduce Spring Test dependencies
This commit splits Spring REST Docs into two projects –
spring-restdocs-core and spring-restdocs-mockmvc.

spring-restdocs-core contains the vast majority of the code but does not
depend on a specific test framework other than JUnit. The use of a
Spring Test TestExecutionListener has been replaced with a JUnit test
rule. The rule is declared once per test class and configured with
the output directory to which the generated snippets should be written.
This simplifies the implementation as thread local storage is no longer
required to transfer information about the test that’s running into
Spring REST Docs. Instead, this transfer is now handled by the new test
rule. It has also simplified the configuration as it’s no longer
necessary for users to provide a system property that configures the
output directory.

spring-restdocs-mockmvc contains code that’s specific to using Spring
REST Docs with Spring MVC Test’s MockMvc. This is currently the only
testing framework that’s supported, but it paves the way for adding
support for additional frameworks. REST Assured is one that users seem
particularly interested in (see gh-80 and gh-102).

Closes gh-107
2015-09-03 14:19:32 +01:00
Andy Wilkinson
8166c5e3e7 Add a task that verifies the includes in a sample’s .adoc files
Enhance buildSamples such that, once a sample has been built, it looks
at the generated HTML files and checks that they do not contain any
output that's indicative of a malformed include in a source .adoc
file.

This additional verification found another malformed include which
this commit corrects.
2015-04-21 12:32:31 +01:00
Andy Wilkinson
d1f57f530b Add the files that were accidentally excluded by .gitignore 2015-04-20 20:05:15 +01:00
Andy Wilkinson
c496cfc699 Extract the logic for building the samples into a plugin 2015-04-20 19:48:35 +01:00