Skip to content

Commit ba1d4ab

Browse files
committed
Polish "Split ConventionsPlugin into separate, more focussed classes"
See gh-20805
1 parent 65f325c commit ba1d4ab

File tree

3 files changed

+10
-27
lines changed

3 files changed

+10
-27
lines changed

buildSrc/src/main/java/org/springframework/boot/build/ConventionsPlugin.java

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
* Plugin to apply conventions to projects that are part of Spring Boot's build.
2727
* Conventions are applied in response to various plugins being applied.
2828
*
29-
* When the {@link JavaBasePlugin} is applied, the conventions in *
30-
* {@link JavaConventions} are applied.
29+
* When the {@link JavaBasePlugin} is applied, the conventions in {@link JavaConventions}
30+
* are applied.
3131
*
3232
* When the {@link MavenPublishPlugin} is applied, the conventions in
3333
* {@link MavenPublishingConventions} are applied.
@@ -43,21 +43,9 @@ public class ConventionsPlugin implements Plugin<Project> {
4343

4444
@Override
4545
public void apply(Project project) {
46-
applyJavaConventions(project);
47-
applyMavenPublishingConventions(project);
48-
applyAsciidoctorConventions(project);
49-
}
50-
51-
private void applyJavaConventions(Project project) {
5246
new JavaConventions().apply(project);
53-
}
54-
55-
private void applyAsciidoctorConventions(Project project) {
47+
new MavenPublishingConventions().apply(project);
5648
new AsciidoctorConventions().apply(project);
5749
}
5850

59-
private void applyMavenPublishingConventions(Project project) {
60-
new MavenPublishingConventions().applyPublishingConventions(project);
61-
}
62-
6351
}

buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,8 @@
4848
import org.springframework.util.FileCopyUtils;
4949

5050
/**
51-
* Applies Java Plugin conventions to projects that are part of Spring Boot's build.
52-
* Conventions are applied in response to various plugins being applied.
53-
* <p/>
54-
*
55-
* When the {@link JavaBasePlugin Java base plugin} is applied:
56-
*
57-
* <p/>
51+
* Conventions that are applied in the presence of the {@link JavaBasePlugin}. When the
52+
* plugin is applied:
5853
*
5954
* <ul>
6055
* <li>{@code sourceCompatibility} is set to {@code 1.8}

buildSrc/src/main/java/org/springframework/boot/build/MavenPublishingConventions.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@
3131
import org.gradle.api.publish.maven.plugins.MavenPublishPlugin;
3232

3333
/**
34-
* Applies Maven Publishing conventions to projects that are part of Spring Boot's build.
35-
* Conventions are applied in response to various plugins being applied.
36-
*
37-
* When the {@link MavenPublishPlugin Maven Publish plugin} is applied:
34+
* Conventions that are applied in the presence of the {@link MavenPublishPlugin}. When
35+
* the plugin is applied:
3836
*
3937
* <ul>
4038
* <li>If the {@code deploymentRepository} property has been set, a
4139
* {@link MavenArtifactRepository Maven artifact repository} is configured to publish to
4240
* it.
4341
* <li>The poms of all {@link MavenPublication Maven publications} are customized to meet
4442
* Maven Central's requirements.
43+
* <li>If the {@link JavaPlugin Java plugin} has also been applied, creation of Javadoc
44+
* and source jars is enabled.
4545
* </ul>
4646
*
4747
* <p/>
@@ -52,7 +52,7 @@
5252
*/
5353
class MavenPublishingConventions {
5454

55-
void applyPublishingConventions(Project project) {
55+
void apply(Project project) {
5656
project.getPlugins().withType(MavenPublishPlugin.class).all((mavenPublish) -> {
5757
PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class);
5858
if (project.hasProperty("deploymentRepository")) {

0 commit comments

Comments
 (0)