From ddbb12869296e4a4d7426bac4a8e3140897cbbed Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Fri, 21 May 2021 16:11:48 +0300 Subject: [PATCH] Fix snapshot detection --- .../mipt/npm/gradle/KScienceProjectPlugin.kt | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/main/kotlin/ru/mipt/npm/gradle/KScienceProjectPlugin.kt b/src/main/kotlin/ru/mipt/npm/gradle/KScienceProjectPlugin.kt index 9a4e0d2..4092836 100644 --- a/src/main/kotlin/ru/mipt/npm/gradle/KScienceProjectPlugin.kt +++ b/src/main/kotlin/ru/mipt/npm/gradle/KScienceProjectPlugin.kt @@ -87,20 +87,18 @@ open class KScienceProjectPlugin : Plugin { override fun apply(target: Project): Unit = target.run { apply() - - - if (!isSnapshot()) { - configure { - version = project.version.toString() - } - } - apply() apply() - if (isSnapshot()) { - configure { - validationDisabled = true + afterEvaluate { + if (isSnapshot()) { + configure { + validationDisabled = true + } + } else { + configure { + version = project.version.toString() + } } }