File tree 1 file changed +8
-12
lines changed
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? =
134
134
/* *
135
135
* Checks if the project is built with a snapshot version of Kotlin compiler.
136
136
*/
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
+ }
143
141
144
142
fun 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 " )
150
146
}
151
147
}
152
- return isSnapshotTrainEnabled(project) || someDependencyIsSnapshot
148
+ return hasSnapshotDependency || isSnapshotTrainEnabled(project)
153
149
}
You can’t perform that action at this time.
0 commit comments