Redirect idea-sandbox to run/idea-sandbox to avoid being cleared by task 'clean'

This commit is contained in:
Him188 2021-02-11 17:58:53 +08:00
parent 3b14795942
commit da3d7a7e19
2 changed files with 20 additions and 4 deletions

1
tools/intellij-plugin/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
run/idea-sandbox

View File

@ -47,10 +47,22 @@ tasks.getByName("publishPlugin", org.jetbrains.intellij.tasks.PublishTask::class
} }
} }
fun File.resolveMkdir(relative: String): File {
return this.resolve(relative).apply { mkdirs() }
}
tasks.withType<org.jetbrains.intellij.tasks.RunIdeTask> {
// redirect config and cache files so as not to be cleared by task 'clean'
val ideaSandbox = project.file("run/idea-sandbox")
configDirectory(ideaSandbox.resolveMkdir("config"))
systemDirectory(ideaSandbox.resolveMkdir("system"))
}
tasks.withType<org.jetbrains.intellij.tasks.PatchPluginXmlTask> { tasks.withType<org.jetbrains.intellij.tasks.PatchPluginXmlTask> {
sinceBuild("201.*") sinceBuild("201.*")
untilBuild("215.*") untilBuild("215.*")
pluginDescription(""" pluginDescription(
"""
Plugin development support for <a href='https://github.com/mamoe/mirai-console'>Mirai Console</a> Plugin development support for <a href='https://github.com/mamoe/mirai-console'>Mirai Console</a>
<h3>Features</h3> <h3>Features</h3>
@ -59,10 +71,13 @@ tasks.withType<org.jetbrains.intellij.tasks.PatchPluginXmlTask> {
<li>Inspections for illegal calls.</li> <li>Inspections for illegal calls.</li>
<li>Intentions for resolving serialization problems.</li> <li>Intentions for resolving serialization problems.</li>
</ul> </ul>
""".trimIndent()) """.trimIndent()
changeNotes(""" )
changeNotes(
"""
See <a href="https://github.com/mamoe/mirai-console/releases">https://github.com/mamoe/mirai-console/releases</a> See <a href="https://github.com/mamoe/mirai-console/releases">https://github.com/mamoe/mirai-console/releases</a>
""".trimIndent()) """.trimIndent()
)
} }
dependencies { dependencies {