Skip to content

Commit

Permalink
Require subprojects build file is named after itself
Browse files Browse the repository at this point in the history
  • Loading branch information
ciscoo committed Apr 25, 2024
1 parent 2524b50 commit 203a7e8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,23 @@ dependencyResolutionManagement {
}
}

fun ProjectDescriptor.ensureBuildFileExists() {
buildFileName = "$name.gradle.kts"
require(buildFile.isFile) { "$buildFile must exist" }
}

fun requireBuildFileName(projectDescriptor: ProjectDescriptor) {
projectDescriptor.ensureBuildFileExists()
projectDescriptor.children.forEach {
requireBuildFileName(it)
}
}

rootProject.children.forEach {
it.ensureBuildFileExists()
requireBuildFileName(it)
}

enableFeaturePreview("STABLE_CONFIGURATION_CACHE")

startParameter.showStacktrace = ShowStacktrace.ALWAYS_FULL
Expand Down

0 comments on commit 203a7e8

Please sign in to comment.