From 96d534185290b4f4fcec26f2af37891aed510c03 Mon Sep 17 00:00:00 2001 From: vvlevchenko Date: Wed, 12 Jul 2017 06:43:45 -0700 Subject: [PATCH] [backend][properties] try suffixied property first and common then (#735) * [backend][properties] try suffixied property first and common then This is temporal version and should be replaced with some unified version shared between interior tool and kaitlin compiler. --- .../jetbrains/kotlin/backend/konan/util/Properties.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/util/Properties.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/util/Properties.kt index 22b9c2405c6..21f36b47751 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/util/Properties.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/util/Properties.kt @@ -37,8 +37,13 @@ fun Properties.saveToFile(file: File) = file.saveProperties(this) fun Properties.propertyString(key: String, suffix: String? = null): String? = this.getProperty(key.suffix(suffix)) +/** + * TODO: this method working with suffixes should be replaced with + * functionality borrowed from def file parser and unified for interop tool + * and kotlin compiler. + */ fun Properties.propertyList(key: String, suffix: String? = null): List { - val value = this.getProperty(key.suffix(suffix)) + val value = this.getProperty(key.suffix(suffix)) ?: this.getProperty(key) return value?.split(' ') ?: emptyList() } @@ -47,6 +52,6 @@ fun Properties.hasProperty(key: String, suffix: String? = null): Boolean fun String.suffix(suf: String?): String = if (suf == null) this - else "${this}.${suf}" + else "${this}.$suf"