From 32d5ff0fe6200e157f56bedaefc8d98a28970667 Mon Sep 17 00:00:00 2001 From: Hao Wang Date: Wed, 23 Aug 2023 18:28:02 +0800 Subject: [PATCH 1/2] more config file extensions --- .../main/kotlin/com/metalbear/mirrord/MirrordConfigAPI.kt | 2 +- .../main/kotlin/com/metalbear/mirrord/MirrordDropDown.kt | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/core/src/main/kotlin/com/metalbear/mirrord/MirrordConfigAPI.kt b/modules/core/src/main/kotlin/com/metalbear/mirrord/MirrordConfigAPI.kt index 7b410729..ffad2c82 100644 --- a/modules/core/src/main/kotlin/com/metalbear/mirrord/MirrordConfigAPI.kt +++ b/modules/core/src/main/kotlin/com/metalbear/mirrord/MirrordConfigAPI.kt @@ -158,7 +158,7 @@ class MirrordConfigAPI(private val service: MirrordProjectService) { fun getDefaultConfig(): VirtualFile? { return getMirrordDir() ?.children - ?.filter { it.name.endsWith("mirrord.json") } + ?.filter { it.name.endsWith("mirrord.json") || it.name.endsWith("mirrord.yaml") || it.name.endsWith("mirrord.toml") } ?.minByOrNull { it.name } } diff --git a/modules/core/src/main/kotlin/com/metalbear/mirrord/MirrordDropDown.kt b/modules/core/src/main/kotlin/com/metalbear/mirrord/MirrordDropDown.kt index 50a89c9c..6f2999f3 100644 --- a/modules/core/src/main/kotlin/com/metalbear/mirrord/MirrordDropDown.kt +++ b/modules/core/src/main/kotlin/com/metalbear/mirrord/MirrordDropDown.kt @@ -193,7 +193,11 @@ class MirrordConfigIndex : ScalarIndexExtension() { override fun getInputFilter(): FileBasedIndex.InputFilter { return FileBasedIndex.InputFilter { - it.isInLocalFileSystem && !it.isDirectory && it.path.endsWith("mirrord.json") + it.isInLocalFileSystem && !it.isDirectory && ( + it.path.endsWith("mirrord.json") || + it.path.endsWith("mirrord.yaml") || + it.path.endsWith("mirrord.toml") + ) } } From 9014c881b6ee7e6933c1b6859a5fb2130e224376 Mon Sep 17 00:00:00 2001 From: Aviram Hassan Date: Wed, 20 Sep 2023 18:38:44 +0300 Subject: [PATCH 2/2] add changelog --- changelog.d/+support-yaml-and-toml.added.md | 1 + src/main/resources/META-INF/mirrord-maven.xml | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 changelog.d/+support-yaml-and-toml.added.md create mode 100644 src/main/resources/META-INF/mirrord-maven.xml diff --git a/changelog.d/+support-yaml-and-toml.added.md b/changelog.d/+support-yaml-and-toml.added.md new file mode 100644 index 00000000..f616fe70 --- /dev/null +++ b/changelog.d/+support-yaml-and-toml.added.md @@ -0,0 +1 @@ +Add support for TOML and YAML mirrord configuration files \ No newline at end of file diff --git a/src/main/resources/META-INF/mirrord-maven.xml b/src/main/resources/META-INF/mirrord-maven.xml new file mode 100644 index 00000000..3494c7f9 --- /dev/null +++ b/src/main/resources/META-INF/mirrord-maven.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file