From da3d7a7e190179146d2788bee55552fc1ee57373 Mon Sep 17 00:00:00 2001 From: Him188 Date: Thu, 11 Feb 2021 17:58:53 +0800 Subject: [PATCH] Redirect idea-sandbox to run/idea-sandbox to avoid being cleared by task 'clean' --- tools/intellij-plugin/.gitignore | 1 + tools/intellij-plugin/build.gradle.kts | 23 +++++++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 tools/intellij-plugin/.gitignore diff --git a/tools/intellij-plugin/.gitignore b/tools/intellij-plugin/.gitignore new file mode 100644 index 000000000..ab8038013 --- /dev/null +++ b/tools/intellij-plugin/.gitignore @@ -0,0 +1 @@ +run/idea-sandbox \ No newline at end of file diff --git a/tools/intellij-plugin/build.gradle.kts b/tools/intellij-plugin/build.gradle.kts index 6cb25a591..4cf26eed7 100644 --- a/tools/intellij-plugin/build.gradle.kts +++ b/tools/intellij-plugin/build.gradle.kts @@ -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 { + // 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 { sinceBuild("201.*") untilBuild("215.*") - pluginDescription(""" + pluginDescription( + """ Plugin development support for Mirai Console

Features

@@ -59,10 +71,13 @@ tasks.withType {
  • Inspections for illegal calls.
  • Intentions for resolving serialization problems.
  • - """.trimIndent()) - changeNotes(""" + """.trimIndent() + ) + changeNotes( + """ See https://github.com/mamoe/mirai-console/releases - """.trimIndent()) + """.trimIndent() + ) } dependencies {