move logo, add function to auto-init the project logo
This commit is contained in:
parent
f0b080a7fe
commit
76a661e444
4 changed files with 24 additions and 0 deletions
|
|
@ -0,0 +1,21 @@
|
|||
package kafkatorio.extensions
|
||||
|
||||
import org.gradle.api.Project
|
||||
|
||||
/** Sets a logo for project IDEs */
|
||||
fun Project.initIdeProjectLogo() {
|
||||
val logoSvg = rootProject.layout.projectDirectory.file("docs/media/img/kafkatorio-logo.svg")
|
||||
val ideaDir = rootProject.layout.projectDirectory.dir(".idea")
|
||||
|
||||
if (
|
||||
logoSvg.asFile.exists()
|
||||
&& ideaDir.asFile.exists()
|
||||
&& !ideaDir.file("icon.png").asFile.exists()
|
||||
&& !ideaDir.file("icon.svg").asFile.exists()
|
||||
) {
|
||||
copy {
|
||||
from(logoSvg) { rename { "icon.svg" } }
|
||||
into(ideaDir)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue