diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/src/main/kotlin/ru/mipt/npm/gradle/KScienceProjectPlugin.kt b/src/main/kotlin/ru/mipt/npm/gradle/KScienceProjectPlugin.kt index 4092836..16862e9 100644 --- a/src/main/kotlin/ru/mipt/npm/gradle/KScienceProjectPlugin.kt +++ b/src/main/kotlin/ru/mipt/npm/gradle/KScienceProjectPlugin.kt @@ -8,6 +8,7 @@ import org.gradle.api.Project import org.gradle.kotlin.dsl.* import org.jetbrains.changelog.ChangelogPlugin import org.jetbrains.changelog.ChangelogPluginExtension +import org.jetbrains.dokka.gradle.AbstractDokkaTask import org.jetbrains.dokka.gradle.DokkaPlugin import org.jetbrains.dokka.gradle.DokkaTask import ru.mipt.npm.gradle.internal.* @@ -200,7 +201,7 @@ open class KScienceProjectPlugin : Plugin { } } - tasks.withType { + tasks.withType { dependsOn(generateReadme) } diff --git a/src/main/kotlin/ru/mipt/npm/gradle/KScienceReadmeExtension.kt b/src/main/kotlin/ru/mipt/npm/gradle/KScienceReadmeExtension.kt index 53e6e71..874a166 100644 --- a/src/main/kotlin/ru/mipt/npm/gradle/KScienceReadmeExtension.kt +++ b/src/main/kotlin/ru/mipt/npm/gradle/KScienceReadmeExtension.kt @@ -36,15 +36,15 @@ class KScienceReadmeExtension(val project: Project) { data class Feature(val id: String, val description: String, val ref: String?, val name: String = id) - val features = ArrayList() + val features: MutableList = ArrayList() @Deprecated("Use lambda builder instead") fun feature(id: String, description: String, ref: String? = null, name: String = id) { - features.add(Feature(id, description, ref, name)) + features += Feature(id, description, ref, name) } fun feature(id: String, ref: String? = null, name: String = id, description: () -> String) { - features.add(Feature(id, description(), ref, name)) + features += Feature(id, description(), ref, name) } private val properties: MutableMap Any?> = mutableMapOf( @@ -55,14 +55,16 @@ class KScienceReadmeExtension(val project: Project) { ) val actualizedProperties - get() = properties.mapValues { (_, value) -> - value.invoke() - } + get() = properties.mapValues { (_, value) -> value() } fun property(key: String, value: Any?) { properties[key] = { value } } + fun property(key: String, value: () -> Any?) { + properties[key] = value + } + fun propertyByTemplate(key: String, template: String) { val actual = actualizedProperties properties[key] = { SimpleTemplateEngine().createTemplate(template).make(actual).toString() } @@ -73,7 +75,7 @@ class KScienceReadmeExtension(val project: Project) { fun propertyByTemplate(key: String, template: File) { val actual = actualizedProperties properties[key] = { SimpleTemplateEngine().createTemplate(template).make(actual).toString() } - additionalFiles.add(template) + additionalFiles += template } /**