Switch for updating documentation; fixes gh-102
This commit is contained in:
@@ -20,15 +20,14 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
|
||||
import org.springframework.cloud.release.internal.Releaser;
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.docs.DocumentationUpdater;
|
||||
import org.springframework.cloud.release.internal.git.ProjectGitHandler;
|
||||
import org.springframework.cloud.release.internal.gradle.GradleUpdater;
|
||||
import org.springframework.cloud.release.internal.options.Parser;
|
||||
import org.springframework.cloud.release.internal.sagan.Release;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectPomUpdater;
|
||||
import org.springframework.cloud.release.internal.project.ProjectBuilder;
|
||||
import org.springframework.cloud.release.internal.sagan.SaganClient;
|
||||
import org.springframework.cloud.release.internal.sagan.SaganUpdater;
|
||||
import org.springframework.cloud.release.internal.template.TemplateGenerator;
|
||||
import org.springframework.cloud.release.internal.project.ProjectBuilder;
|
||||
import org.springframework.cloud.release.internal.git.ProjectGitHandler;
|
||||
import org.springframework.cloud.release.internal.pom.ProjectPomUpdater;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -37,28 +36,52 @@ import org.springframework.context.annotation.Configuration;
|
||||
@EnableConfigurationProperties(ReleaserProperties.class)
|
||||
class ReleaserConfiguration {
|
||||
|
||||
@Autowired ReleaserProperties properties;
|
||||
@Autowired
|
||||
ReleaserProperties properties;
|
||||
|
||||
@Bean SpringReleaser springReleaser(Releaser releaser,
|
||||
@Bean
|
||||
SpringReleaser springReleaser(Releaser releaser,
|
||||
ReleaserPropertiesUpdater updater) {
|
||||
return new SpringReleaser(releaser, this.properties, updater);
|
||||
}
|
||||
|
||||
@Bean ProjectBuilder projectBuilder() { return new ProjectBuilder(this.properties); }
|
||||
@Bean
|
||||
ProjectBuilder projectBuilder() {
|
||||
return new ProjectBuilder(this.properties);
|
||||
}
|
||||
|
||||
@Bean ProjectPomUpdater pomUpdater() { return new ProjectPomUpdater(this.properties); }
|
||||
@Bean
|
||||
ProjectPomUpdater pomUpdater() {
|
||||
return new ProjectPomUpdater(this.properties);
|
||||
}
|
||||
|
||||
@Bean ProjectGitHandler projectGitHandler() { return new ProjectGitHandler(this.properties); }
|
||||
@Bean
|
||||
ProjectGitHandler projectGitHandler() {
|
||||
return new ProjectGitHandler(this.properties);
|
||||
}
|
||||
|
||||
@Bean TemplateGenerator templateGenerator(ProjectGitHandler handler) { return new TemplateGenerator(this.properties, handler); }
|
||||
@Bean
|
||||
TemplateGenerator templateGenerator(ProjectGitHandler handler) {
|
||||
return new TemplateGenerator(this.properties, handler);
|
||||
}
|
||||
|
||||
@Bean GradleUpdater gradleUpdater() { return new GradleUpdater(this.properties); }
|
||||
@Bean
|
||||
GradleUpdater gradleUpdater() {
|
||||
return new GradleUpdater(this.properties);
|
||||
}
|
||||
|
||||
@Bean SaganUpdater saganUpdater(SaganClient saganClient) { return new SaganUpdater(saganClient); }
|
||||
@Bean
|
||||
SaganUpdater saganUpdater(SaganClient saganClient) {
|
||||
return new SaganUpdater(saganClient);
|
||||
}
|
||||
|
||||
@Bean DocumentationUpdater documentationUpdater(ProjectGitHandler handler) { return new DocumentationUpdater(handler); }
|
||||
@Bean
|
||||
DocumentationUpdater documentationUpdater(ReleaserProperties properties, ProjectGitHandler handler) {
|
||||
return new DocumentationUpdater(properties, handler);
|
||||
}
|
||||
|
||||
@Bean Releaser releaser(ProjectPomUpdater projectPomUpdater, ProjectBuilder projectBuilder,
|
||||
@Bean
|
||||
Releaser releaser(ProjectPomUpdater projectPomUpdater, ProjectBuilder projectBuilder,
|
||||
ProjectGitHandler projectGitHandler, TemplateGenerator templateGenerator,
|
||||
GradleUpdater gradleUpdater, SaganUpdater saganUpdater,
|
||||
DocumentationUpdater documentationUpdater) {
|
||||
@@ -66,11 +89,13 @@ class ReleaserConfiguration {
|
||||
templateGenerator, gradleUpdater, saganUpdater, documentationUpdater);
|
||||
}
|
||||
|
||||
@Bean ReleaserPropertiesUpdater releaserPropertiesUpdater(ApplicationContext context) {
|
||||
@Bean
|
||||
ReleaserPropertiesUpdater releaserPropertiesUpdater(ApplicationContext context) {
|
||||
return new ReleaserPropertiesUpdater(context);
|
||||
}
|
||||
|
||||
@Bean Parser optionsParser() {
|
||||
@Bean
|
||||
Parser optionsParser() {
|
||||
return new OptionsParser();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.springframework.cloud.release.internal.docs;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.springframework.cloud.release.internal.ReleaserProperties;
|
||||
import org.springframework.cloud.release.internal.git.ProjectGitHandler;
|
||||
|
||||
/**
|
||||
@@ -12,8 +13,9 @@ public class TestDocumentationUpdater extends DocumentationUpdater {
|
||||
|
||||
private final String version;
|
||||
|
||||
public TestDocumentationUpdater(ProjectGitHandler gitHandler, String version) {
|
||||
super(gitHandler);
|
||||
public TestDocumentationUpdater(ReleaserProperties properties,
|
||||
ProjectGitHandler gitHandler, String version) {
|
||||
super(properties, gitHandler);
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
|
||||
@@ -592,7 +592,8 @@ public class AcceptanceTests {
|
||||
TemplateGenerator templateGenerator = new TemplateGenerator(properties, handler);
|
||||
GradleUpdater gradleUpdater = new GradleUpdater(properties);
|
||||
SaganUpdater saganUpdater = new SaganUpdater(this.saganClient);
|
||||
DocumentationUpdater documentationUpdater = new TestDocumentationUpdater(handler, "Brixton.SR1") {
|
||||
DocumentationUpdater documentationUpdater = new TestDocumentationUpdater(properties,
|
||||
handler, "Brixton.SR1") {
|
||||
@Override public File updateDocsRepo(ProjectVersion currentProject,
|
||||
String springCloudReleaseBranch) {
|
||||
File file = super.updateDocsRepo(currentProject, springCloudReleaseBranch);
|
||||
@@ -613,7 +614,7 @@ public class AcceptanceTests {
|
||||
TemplateGenerator templateGenerator = Mockito.spy(new TemplateGenerator(properties, handler));
|
||||
GradleUpdater gradleUpdater = new GradleUpdater(properties);
|
||||
SaganUpdater saganUpdater = Mockito.spy(new SaganUpdater(this.saganClient));
|
||||
DocumentationUpdater documentationUpdater = Mockito.spy(new DocumentationUpdater(handler) {
|
||||
DocumentationUpdater documentationUpdater = Mockito.spy(new DocumentationUpdater(properties, handler) {
|
||||
@Override public File updateDocsRepo(ProjectVersion currentProject,
|
||||
String springCloudReleaseBranch) {
|
||||
File file = super.updateDocsRepo(currentProject, springCloudReleaseBranch);
|
||||
|
||||
Reference in New Issue
Block a user