Skip to content

Commit

Permalink
Reverted to declaring the ComponentMetadataRule only in the platform.
Browse files Browse the repository at this point in the history
ianbrandt committed Feb 10, 2023
1 parent ee0e4a7 commit a9ae441
Showing 2 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -16,8 +16,6 @@ kotlin {

dependencies {

components.all<SpringBomAlignmentRule>()

api(platform("com.ianbrandt.platforms:app-platform"))
}

@@ -40,22 +38,3 @@ tasks {
}
}
}

abstract class SpringBomAlignmentRule : ComponentMetadataRule {
override fun execute(ctx: ComponentMetadataContext) {
ctx.details.run {
when (id.group) {
"org.springframework" ->
belongsTo(
"org.springframework:spring-framework-bom:${id.version}",
false
)
"org.springframework.boot" ->
belongsTo(
"org.springframework.boot:spring-boot-dependencies:${id.version}",
false
)
}
}
}
}
21 changes: 21 additions & 0 deletions platforms/app-platform/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -11,6 +11,8 @@ javaPlatform {

dependencies {

components.all<SpringBomAlignmentRule>()

api(platform(libs.kotlinx.coroutines.bom))
api(platform(libs.spring.bom))
api(platform(libs.spring.boot.bom))
@@ -20,3 +22,22 @@ dependencies {
api(libs.bundles.kotlinx.datetime.jvm)
}
}

abstract class SpringBomAlignmentRule : ComponentMetadataRule {
override fun execute(ctx: ComponentMetadataContext) {
ctx.details.run {
when (id.group) {
"org.springframework" ->
belongsTo(
"org.springframework:spring-framework-bom:${id.version}",
false
)
"org.springframework.boot" ->
belongsTo(
"org.springframework.boot:spring-boot-dependencies:${id.version}",
false
)
}
}
}
}

0 comments on commit a9ae441

Please sign in to comment.