Skip to content

Commit 4807bec

Browse files
committed
Remove samples in favor of those in separate repository
Closes gh-852
1 parent c7717f1 commit 4807bec

File tree

154 files changed

+9
-26563
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+9
-26563
lines changed

build.gradle

+1-45
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@ allprojects {
1818
}
1919
}
2020

21-
apply plugin: "samples"
2221
apply plugin: "io.spring.nohttp"
2322
apply from: "${rootProject.projectDir}/gradle/publish-maven.gradle"
2423

2524
nohttp {
26-
source.exclude "samples/rest-notes-slate/slate/**"
2725
source.exclude "buildSrc/.gradle/**"
2826
source.exclude "**/build/**"
2927
source.exclude "**/target/**"
@@ -114,44 +112,6 @@ subprojects { subproject ->
114112

115113
}
116114

117-
samples {
118-
dependOn "spring-restdocs-core:publishToMavenLocal"
119-
dependOn "spring-restdocs-mockmvc:publishToMavenLocal"
120-
dependOn "spring-restdocs-restassured:publishToMavenLocal"
121-
dependOn "spring-restdocs-webtestclient:publishToMavenLocal"
122-
dependOn "spring-restdocs-asciidoctor:publishToMavenLocal"
123-
124-
restNotesSpringHateoas {
125-
workingDir "$projectDir/samples/rest-notes-spring-hateoas"
126-
}
127-
128-
restNotesSpringDataRest {
129-
workingDir "$projectDir/samples/rest-notes-spring-data-rest"
130-
}
131-
132-
testNg {
133-
workingDir "$projectDir/samples/testng"
134-
}
135-
136-
restAssured {
137-
workingDir "$projectDir/samples/rest-assured"
138-
}
139-
140-
webTestClient {
141-
workingDir "$projectDir/samples/web-test-client"
142-
}
143-
144-
slate {
145-
workingDir "$projectDir/samples/rest-notes-slate"
146-
build false
147-
}
148-
149-
junit5 {
150-
workingDir "$projectDir/samples/junit5"
151-
}
152-
153-
}
154-
155115
task api (type: Javadoc) {
156116
group = "Documentation"
157117
description = "Generates aggregated Javadoc API documentation."
@@ -179,7 +139,7 @@ task api (type: Javadoc) {
179139
}
180140
}
181141

182-
task docsZip(type: Zip, dependsOn: [":docs:asciidoctor", ":api", ":restNotesSpringHateoasGradle"]) {
142+
task docsZip(type: Zip, dependsOn: [":docs:asciidoctor", ":api"]) {
183143
group = "Distribution"
184144
archiveBaseName = "spring-restdocs"
185145
archiveClassifier = "docs"
@@ -193,10 +153,6 @@ task docsZip(type: Zip, dependsOn: [":docs:asciidoctor", ":api", ":restNotesSpri
193153
from(api) {
194154
into "api"
195155
}
196-
197-
from(file("samples/rest-notes-spring-hateoas/build/docs/asciidoc")) {
198-
into "samples/restful-notes"
199-
}
200156
}
201157

202158
publishing {

buildSrc/build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
plugins {
22
id "java-gradle-plugin"
3-
id "groovy-gradle-plugin"
43
}

buildSrc/src/main/groovy/org/springframework/restdocs/build/samples/SampleBuildConfigurer.groovy

-164
This file was deleted.

buildSrc/src/main/groovy/org/springframework/restdocs/build/samples/SamplesExtension.groovy

-49
This file was deleted.

buildSrc/src/main/groovy/org/springframework/restdocs/build/samples/SamplesPlugin.groovy

-31
This file was deleted.

buildSrc/src/main/resources/META-INF/gradle-plugins/samples.properties

-1
This file was deleted.

ci/scripts/build-pr-project.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ set -e
44
source $(dirname $0)/common.sh
55

66
pushd git-repo > /dev/null
7-
./gradlew -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false --no-daemon --max-workers=4 --continue build buildSamples
7+
./gradlew -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false --no-daemon --max-workers=4 --continue build
88
popd > /dev/null

ci/scripts/build-project.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ source $(dirname $0)/common.sh
55
repository=$(pwd)/distribution-repository
66

77
pushd git-repo > /dev/null
8-
./gradlew -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false --no-daemon --max-workers=4 -PdeploymentRepository=${repository} build buildSamples publishAllPublicationsToDeploymentRepository
8+
./gradlew -Dorg.gradle.internal.launcher.welcomeMessageEnabled=false --no-daemon --max-workers=4 -PdeploymentRepository=${repository} build publishAllPublicationsToDeploymentRepository
99
popd > /dev/null

docs/src/docs/asciidoc/documenting-your-api.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ include::{examples-dir}/com/example/Constraints.java[tags=constraints]
11291129
<2> Get the descriptions of the `name` property's constraints.
11301130
This list contains two descriptions: one for the `NotNull` constraint and one for the `Size` constraint.
11311131

1132-
The {samples}/rest-notes-spring-hateoas/src/test/java/com/example/notes/ApiDocumentation.java[`ApiDocumentation`] class in the Spring HATEOAS sample shows this functionality in action.
1132+
The {samples}/restful-notes-spring-hateoas/src/test/java/com/example/notes/ApiDocumentation.java[`ApiDocumentation`] class in the Spring HATEOAS sample shows this functionality in action.
11331133

11341134

11351135

@@ -1191,7 +1191,7 @@ Validator:
11911191
* `URL`
11921192

11931193
To override the default descriptions or to provide a new description, you can create a resource bundle with a base name of `org.springframework.restdocs.constraints.ConstraintDescriptions`.
1194-
The Spring HATEOAS-based sample contains {samples}/rest-notes-spring-hateoas/src/test/resources/org/springframework/restdocs/constraints/ConstraintDescriptions.properties[an example of such a resource bundle].
1194+
The Spring HATEOAS-based sample contains {samples}/restful-notes-spring-hateoas/src/test/resources/org/springframework/restdocs/constraints/ConstraintDescriptions.properties[an example of such a resource bundle].
11951195

11961196
Each key in the resource bundle is the fully-qualified name of a constraint plus a `.description`.
11971197
For example, the key for the standard `@NotNull` constraint is `jakarta.validation.constraints.NotNull.description`.
@@ -1209,7 +1209,7 @@ To take complete control, you can create `ConstraintDescriptions` with a custom
12091209
Once you have a constraint's descriptions, you are free to use them however you like in the generated snippets.
12101210
For example, you may want to include the constraint descriptions as part of a field's description.
12111211
Alternatively, you could include the constraints as <<documenting-your-api-customizing-including-extra-information, extra information>> in the request fields snippet.
1212-
The {samples}/rest-notes-spring-hateoas/src/test/java/com/example/notes/ApiDocumentation.java[`ApiDocumentation`] class in the Spring HATEOAS-based sample illustrates the latter approach.
1212+
The {samples}/restful-notes-spring-hateoas/src/test/java/com/example/notes/ApiDocumentation.java[`ApiDocumentation`] class in the Spring HATEOAS-based sample illustrates the latter approach.
12131213

12141214

12151215

0 commit comments

Comments
 (0)