File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -134,20 +134,16 @@ fun getOverriddenKotlinVersion(project: Project): String? =
134134/* *
135135 * Checks if the project is built with a snapshot version of Kotlin compiler.
136136 */
137- fun isSnapshotTrainEnabled (project : Project ): Boolean =
138- when (project.rootProject.properties[" build_snapshot_train" ]) {
139- null -> false
140- " " -> false
141- else -> true
142- }
137+ fun isSnapshotTrainEnabled (project : Project ): Boolean {
138+ val buildSnapshotTrain = project.rootProject.properties[" build_snapshot_train" ] as ? String
139+ return ! buildSnapshotTrain.isNullOrBlank()
140+ }
143141
144142fun shouldUseLocalMaven (project : Project ): Boolean {
145- var someDependencyIsSnapshot = false
146- project.rootProject.properties.forEach { key, value ->
147- if (key.endsWith(" _version" ) && value is String && value.endsWith(" -SNAPSHOT" )) {
148- println (" NOTE: USING SNAPSHOT VERSION: $key =$value " )
149- someDependencyIsSnapshot = true
143+ val hasSnapshotDependency = project.rootProject.properties.any { (key, value) ->
144+ key.endsWith(" _version" ) && value is String && value.endsWith(" -SNAPSHOT" ).also {
145+ if (it) println (" NOTE: USING SNAPSHOT VERSION: $key =$value " )
150146 }
151147 }
152- return isSnapshotTrainEnabled(project) || someDependencyIsSnapshot
148+ return hasSnapshotDependency || isSnapshotTrainEnabled(project)
153149}
You can’t perform that action at this time.
0 commit comments