Skip to content

Commit

Permalink
Polish "Add beans for Java, Kotlin and Groovy SourceCodeWriters"
Browse files Browse the repository at this point in the history
  • Loading branch information
mhalbritter committed Sep 25, 2024
1 parent e2d1f42 commit 80f374f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,17 @@ public class GroovyProjectGenerationConfiguration {

private final ProjectDescription description;

private final IndentingWriterFactory indentingWriterFactory;

public GroovyProjectGenerationConfiguration(ProjectDescription description,
IndentingWriterFactory indentingWriterFactory) {
public GroovyProjectGenerationConfiguration(ProjectDescription description) {
this.description = description;
this.indentingWriterFactory = indentingWriterFactory;
}

@Bean
public GroovySourceCodeWriter groovySourceCodeWriter() {
return new GroovySourceCodeWriter(this.indentingWriterFactory);
GroovySourceCodeWriter groovySourceCodeWriter(IndentingWriterFactory indentingWriterFactory) {
return new GroovySourceCodeWriter(indentingWriterFactory);
}

@Bean
public MainSourceCodeProjectContributor<GroovyTypeDeclaration, GroovyCompilationUnit, GroovySourceCode> mainGroovySourceCodeProjectContributor(
MainSourceCodeProjectContributor<GroovyTypeDeclaration, GroovyCompilationUnit, GroovySourceCode> mainGroovySourceCodeProjectContributor(
ObjectProvider<MainApplicationTypeCustomizer<?>> mainApplicationTypeCustomizers,
ObjectProvider<MainCompilationUnitCustomizer<?, ?>> mainCompilationUnitCustomizers,
ObjectProvider<MainSourceCodeCustomizer<?, ?, ?>> mainSourceCodeCustomizers,
Expand All @@ -74,7 +70,7 @@ public MainSourceCodeProjectContributor<GroovyTypeDeclaration, GroovyCompilation
}

@Bean
public TestSourceCodeProjectContributor<GroovyTypeDeclaration, GroovyCompilationUnit, GroovySourceCode> testGroovySourceCodeProjectContributor(
TestSourceCodeProjectContributor<GroovyTypeDeclaration, GroovyCompilationUnit, GroovySourceCode> testGroovySourceCodeProjectContributor(
ObjectProvider<TestApplicationTypeCustomizer<?>> testApplicationTypeCustomizers,
ObjectProvider<TestSourceCodeCustomizer<?, ?, ?>> testSourceCodeCustomizers,
GroovySourceCodeWriter groovySourceCodeWriter) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,17 @@ public class JavaProjectGenerationConfiguration {

private final ProjectDescription description;

private final IndentingWriterFactory indentingWriterFactory;

public JavaProjectGenerationConfiguration(ProjectDescription description,
IndentingWriterFactory indentingWriterFactory) {
public JavaProjectGenerationConfiguration(ProjectDescription description) {
this.description = description;
this.indentingWriterFactory = indentingWriterFactory;
}

@Bean
public JavaSourceCodeWriter javaSourceCodeWriter() {
return new JavaSourceCodeWriter(this.indentingWriterFactory);
JavaSourceCodeWriter javaSourceCodeWriter(IndentingWriterFactory indentingWriterFactory) {
return new JavaSourceCodeWriter(indentingWriterFactory);
}

@Bean
public MainSourceCodeProjectContributor<JavaTypeDeclaration, JavaCompilationUnit, JavaSourceCode> mainJavaSourceCodeProjectContributor(
MainSourceCodeProjectContributor<JavaTypeDeclaration, JavaCompilationUnit, JavaSourceCode> mainJavaSourceCodeProjectContributor(
ObjectProvider<MainApplicationTypeCustomizer<?>> mainApplicationTypeCustomizers,
ObjectProvider<MainCompilationUnitCustomizer<?, ?>> mainCompilationUnitCustomizers,
ObjectProvider<MainSourceCodeCustomizer<?, ?, ?>> mainSourceCodeCustomizers,
Expand All @@ -74,7 +70,7 @@ public MainSourceCodeProjectContributor<JavaTypeDeclaration, JavaCompilationUnit
}

@Bean
public TestSourceCodeProjectContributor<JavaTypeDeclaration, JavaCompilationUnit, JavaSourceCode> testJavaSourceCodeProjectContributor(
TestSourceCodeProjectContributor<JavaTypeDeclaration, JavaCompilationUnit, JavaSourceCode> testJavaSourceCodeProjectContributor(
ObjectProvider<TestApplicationTypeCustomizer<?>> testApplicationTypeCustomizers,
ObjectProvider<TestSourceCodeCustomizer<?, ?, ?>> testSourceCodeCustomizers,
JavaSourceCodeWriter javaSourceCodeWriter) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,17 @@ public class KotlinProjectGenerationConfiguration {

private final ProjectDescription description;

private final IndentingWriterFactory indentingWriterFactory;

public KotlinProjectGenerationConfiguration(ProjectDescription description,
IndentingWriterFactory indentingWriterFactory) {
public KotlinProjectGenerationConfiguration(ProjectDescription description) {
this.description = description;
this.indentingWriterFactory = indentingWriterFactory;
}

@Bean
public KotlinSourceCodeWriter kotlinSourceCodeWriter() {
return new KotlinSourceCodeWriter(this.description.getLanguage(), this.indentingWriterFactory);
KotlinSourceCodeWriter kotlinSourceCodeWriter(IndentingWriterFactory indentingWriterFactory) {
return new KotlinSourceCodeWriter(this.description.getLanguage(), indentingWriterFactory);
}

@Bean
public MainSourceCodeProjectContributor<KotlinTypeDeclaration, KotlinCompilationUnit, KotlinSourceCode> mainKotlinSourceCodeProjectContributor(
MainSourceCodeProjectContributor<KotlinTypeDeclaration, KotlinCompilationUnit, KotlinSourceCode> mainKotlinSourceCodeProjectContributor(
ObjectProvider<MainApplicationTypeCustomizer<?>> mainApplicationTypeCustomizers,
ObjectProvider<MainCompilationUnitCustomizer<?, ?>> mainCompilationUnitCustomizers,
ObjectProvider<MainSourceCodeCustomizer<?, ?, ?>> mainSourceCodeCustomizers,
Expand All @@ -81,7 +77,7 @@ public MainSourceCodeProjectContributor<KotlinTypeDeclaration, KotlinCompilation
}

@Bean
public TestSourceCodeProjectContributor<KotlinTypeDeclaration, KotlinCompilationUnit, KotlinSourceCode> testKotlinSourceCodeProjectContributor(
TestSourceCodeProjectContributor<KotlinTypeDeclaration, KotlinCompilationUnit, KotlinSourceCode> testKotlinSourceCodeProjectContributor(
ObjectProvider<TestApplicationTypeCustomizer<?>> testApplicationTypeCustomizers,
ObjectProvider<TestSourceCodeCustomizer<?, ?, ?>> testSourceCodeCustomizers,
KotlinSourceCodeWriter kotlinSourceCodeWriter) {
Expand Down

0 comments on commit 80f374f

Please sign in to comment.