Skip to content

Commit

Permalink
Merge pull request gradle#9156 from gradle/bamboo/master/polish-setti…
Browse files Browse the repository at this point in the history
…ngs.gradle.kts

Polish `settings.gradle.kts`
  • Loading branch information
bamboo authored Apr 17, 2019
2 parents 61c8bd3 + c66772c commit a67e47b
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ fun String.toKebabCase() =

rootProject.name = "gradle"

// List of subprojects that have a Groovy DSL build script.
// List of sub-projects that have a Groovy DSL build script.
// The intent is for this list to diminish until it disappears.
val groovyBuildScriptProjects = listOf(
val groovyBuildScriptProjects = hashSetOf(
"distributions",
"wrapper",
"docs",
Expand All @@ -135,7 +135,8 @@ val groovyBuildScriptProjects = listOf(
"testing-junit-platform",
"test-kit",
"smoke-test",
"version-control")
"version-control"
)

fun buildFileNameFor(projectDirName: String) =
"$projectDirName${buildFileExtensionFor(projectDirName)}"
Expand All @@ -147,11 +148,11 @@ for (project in rootProject.children) {
val projectDirName = project.name.toKebabCase()
project.projectDir = file("subprojects/$projectDirName")
project.buildFileName = buildFileNameFor(projectDirName)
if (!project.projectDir.isDirectory) {
throw IllegalArgumentException("Project directory ${project.projectDir} for project ${project.name} does not exist.")
require(project.projectDir.isDirectory) {
"Project directory ${project.projectDir} for project ${project.name} does not exist."
}
if (!project.buildFile.isFile) {
throw IllegalArgumentException("Build file ${project.buildFile} for project ${project.name} does not exist.")
require(project.buildFile.isFile) {
"Build file ${project.buildFile} for project ${project.name} does not exist."
}
}

Expand All @@ -168,7 +169,7 @@ val ignoredFeatures = setOf(
)

FeaturePreviews.Feature.values().forEach { feature ->
if (feature.isActive && !ignoredFeatures.contains(feature)) {
if (feature.isActive && feature !in ignoredFeatures) {
enableFeaturePreview(feature.name)
}
}
Expand Down

0 comments on commit a67e47b

Please sign in to comment.