Skip to content

Commit

Permalink
Polish "Add Configuration for Kotlin's All-Open Plugin for JPA Entities"
Browse files Browse the repository at this point in the history
  • Loading branch information
mhalbritter committed Oct 11, 2024
1 parent 413a7f2 commit 7460b7b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*
* @author Stephane Nicoll
* @author Moritz Halbritter
* @author Sijun Yang
*/
public class BuildMetadataResolver {

Expand Down Expand Up @@ -66,16 +65,4 @@ public boolean hasFacet(Build build, String facet) {
return dependencies(build).anyMatch((dependency) -> dependency.getFacets().contains(facet));
}

/**
* Checks if the given {@link Build} contains dependencies with the given
* {@code groupId}.
* @param build the build to query
* @param groupId the groupId to query
* @return {@code true} if this build defines at least a dependency with that groupId,
* {@code false} otherwise
*/
public boolean hasGroupId(Build build, String groupId) {
return dependencies(build).anyMatch((dependency) -> dependency.getGroupId().equals(groupId));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ BuildCustomizer<Build> kotlinDependenciesConfigurer() {
}

@Bean
@ConditionalOnBuildSystem(value = GradleBuildSystem.ID, dialect = GradleBuildSystem.DIALECT_KOTLIN)
@ConditionalOnBuildSystem(id = GradleBuildSystem.ID, dialect = GradleBuildSystem.DIALECT_KOTLIN)
KotlinJpaGradleBuildCustomizer kotlinJpaGradleBuildCustomizerKotlinDsl(InitializrMetadata metadata,
KotlinProjectSettings settings, ProjectDescription projectDescription) {
return new KotlinJpaGradleBuildCustomizer(metadata, settings, projectDescription, '\"');
}

@Bean
@ConditionalOnBuildSystem(value = GradleBuildSystem.ID, dialect = GradleBuildSystem.DIALECT_GROOVY)
@ConditionalOnBuildSystem(id = GradleBuildSystem.ID, dialect = GradleBuildSystem.DIALECT_GROOVY)
KotlinJpaGradleBuildCustomizer kotlinJpaGradleBuildCustomizerGroovyDsl(InitializrMetadata metadata,
KotlinProjectSettings settings, ProjectDescription projectDescription) {
return new KotlinJpaGradleBuildCustomizer(metadata, settings, projectDescription, '\'');
Expand All @@ -89,13 +89,13 @@ KotlinJpaMavenBuildCustomizer kotlinJpaMavenBuildCustomizer(InitializrMetadata m
}

@Bean
@ConditionalOnBuildSystem(value = GradleBuildSystem.ID, dialect = GradleBuildSystem.DIALECT_KOTLIN)
@ConditionalOnBuildSystem(id = GradleBuildSystem.ID, dialect = GradleBuildSystem.DIALECT_KOTLIN)
KotlinGradleBuildCustomizer kotlinBuildCustomizerKotlinDsl(KotlinProjectSettings kotlinProjectSettings) {
return new KotlinGradleBuildCustomizer(kotlinProjectSettings, '\"');
}

@Bean
@ConditionalOnBuildSystem(value = GradleBuildSystem.ID, dialect = GradleBuildSystem.DIALECT_GROOVY)
@ConditionalOnBuildSystem(id = GradleBuildSystem.ID, dialect = GradleBuildSystem.DIALECT_GROOVY)
KotlinGradleBuildCustomizer kotlinBuildCustomizerGroovyDsl(KotlinProjectSettings kotlinProjectSettings) {
return new KotlinGradleBuildCustomizer(kotlinProjectSettings, '\'');
}
Expand Down

0 comments on commit 7460b7b

Please sign in to comment.