Skip to content

Commit

Permalink
[IJ Plugin] Make 'Download Schema action' consider deep subprojects (#…
Browse files Browse the repository at this point in the history
…6394)

* Make Download Schema action consider deep subprojects

* Temporarily disable plugin verifier compatibility problems, due to https://platform.jetbrains.com/t/plugin-verifier-fails-with-plugin-com-intellij-modules-json-not-declared-as-a-plugin-dependency/580
  • Loading branch information
BoD authored Feb 24, 2025
1 parent 45499d1 commit c01cace
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions intellij-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.changelog.markdownToHTML
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.FailureLevel.COMPATIBILITY_PROBLEMS
import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.FailureLevel.INTERNAL_API_USAGES
import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.FailureLevel.INVALID_PLUGIN
import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.FailureLevel.PLUGIN_STRUCTURE_WARNINGS
Expand Down Expand Up @@ -243,7 +243,8 @@ intellijPlatform {
}
failureLevel.set(
setOf(
COMPATIBILITY_PROBLEMS,
// TODO: Temporarily disabled due to https://platform.jetbrains.com/t/plugin-verifier-fails-with-plugin-com-intellij-modules-json-not-declared-as-a-plugin-dependency/580
// COMPATIBILITY_PROBLEMS,
INTERNAL_API_USAGES,
INVALID_PLUGIN,
PLUGIN_STRUCTURE_WARNINGS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private class DownloadSchemaTask(project: Project) : Task.Backgroundable(
}
} ?: return

val allDownloadSchemaTasks: List<String> = (rootGradleProject.children + rootGradleProject)
val allDownloadSchemaTasks: List<String> = rootGradleProject.allChildrenRecursively()
.flatMap { gradleProject -> gradleProject.tasks.filter { task -> task.name.matches(DOWNLOAD_SCHEMA_TASK_REGEX) } }
.map { it.name }
.distinct()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,6 @@ class GradleToolingModelService(
}
}

private fun GradleProject.allChildrenRecursively(): List<GradleProject> {
return listOf(this) + children.flatMap { it.allChildrenRecursively() }
}

private val ApolloGradleToolingModel.projectPathCompat: String
get() = if (versionMinor >= 3) {
projectPath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil
import com.intellij.openapi.module.Module
import com.intellij.openapi.module.ModuleManager
import com.intellij.openapi.project.Project
import org.gradle.tooling.model.GradleProject

const val CODEGEN_GRADLE_TASK_NAME = "generateApolloSources"

Expand All @@ -23,3 +24,7 @@ fun Project.getGradleRootPath(): String? {
if (rootProjectPath == null) logw("Could not get Gradle root project path")
return rootProjectPath
}

fun GradleProject.allChildrenRecursively(): List<GradleProject> {
return listOf(this) + children.flatMap { it.allChildrenRecursively() }
}

0 comments on commit c01cace

Please sign in to comment.