introduce ideaPlugin task as a replacement for idea-plugin...

leave idea-plugin as a reference to the new one for compatibility
This commit is contained in:
Ilya Chernikov
2017-09-19 11:12:27 +02:00
parent 372138977d
commit b7226951b6
+9 -3
View File
@@ -127,15 +127,21 @@ fun Project.publish(body: Upload.() -> Unit = {}): Upload {
}
}
fun Project.ideaPlugin(subdir: String = "lib", body: AbstractCopyTask.() -> Unit) {
task<Copy>("idea-plugin") {
fun Project.ideaPlugin(subdir: String = "lib", body: AbstractCopyTask.() -> Unit): Copy {
val pluginTask = task<Copy>("ideaPlugin") {
body()
into(File(rootProject.extra["ideaPluginDir"].toString(), subdir).path)
rename("-${java.util.regex.Pattern.quote(rootProject.extra["build.number"].toString())}", "")
}
task("idea-plugin") {
dependsOn(pluginTask)
}
return pluginTask
}
fun Project.ideaPlugin(subdir: String = "lib") = ideaPlugin(subdir) {
fun Project.ideaPlugin(subdir: String = "lib"): Copy = ideaPlugin(subdir) {
fromRuntimeJarIfExists(this)
}