-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remap plugin problems when resolving plugin dependencies (#1124)
* Use problem level remapper when creating modules * Extract plugin creation to separate overridable method * Provide PluginInfo when constructing plugins * Make IDE Plugin Manager accessible in subclasses to customize creation * Introduce plugin dependency repository and a model class * Resolve dependencies while ignoring creation problems * Use original repository when tracing failed dependencies * Introduce interface that provides an IdePlugin * Simplify IdePlugin-based details
- Loading branch information
Showing
16 changed files
with
419 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...erifier-repository/src/main/java/com/jetbrains/pluginverifier/repository/WithIdePlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright 2000-2024 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. | ||
*/ | ||
|
||
package com.jetbrains.pluginverifier.repository | ||
|
||
import com.jetbrains.plugin.structure.intellij.plugin.IdePlugin | ||
|
||
/** | ||
* Indicates a [plugin info][PluginInfo] that contains a resolved [IDE Plugin][IdePlugin]. | ||
*/ | ||
interface WithIdePlugin { | ||
val idePlugin: IdePlugin | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...a/com/jetbrains/pluginverifier/repository/repositories/dependency/DependencyPluginInfo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright 2000-2024 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. | ||
*/ | ||
package com.jetbrains.pluginverifier.repository.repositories.dependency | ||
|
||
import com.jetbrains.pluginverifier.repository.PluginInfo | ||
|
||
/** | ||
* Plugin information that is resolved as a plugin dependency. | ||
*/ | ||
class DependencyPluginInfo(val pluginInfo: PluginInfo) : PluginInfo( | ||
pluginInfo.pluginId, | ||
pluginInfo.pluginName, | ||
pluginInfo.version, | ||
pluginInfo.sinceBuild, | ||
pluginInfo.untilBuild, | ||
pluginInfo.vendor | ||
) |
35 changes: 35 additions & 0 deletions
35
...jetbrains/pluginverifier/repository/repositories/dependency/DependencyPluginRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright 2000-2024 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. | ||
*/ | ||
|
||
package com.jetbrains.pluginverifier.repository.repositories.dependency | ||
|
||
import com.jetbrains.plugin.structure.intellij.version.IdeVersion | ||
import com.jetbrains.pluginverifier.repository.PluginInfo | ||
import com.jetbrains.pluginverifier.repository.PluginRepository | ||
|
||
/** | ||
* Repository wrapping another repository while mapping plugins into [dependencies][DependencyPluginInfo]. | ||
*/ | ||
class DependencyPluginRepository(private val delegateRepository: PluginRepository) : PluginRepository { | ||
override val presentableName: String = "${delegateRepository.presentableName} (used for plugin dependencies)" | ||
|
||
override fun getLastCompatiblePlugins(ideVersion: IdeVersion): List<PluginInfo> = | ||
delegateRepository.getLastCompatiblePlugins(ideVersion).asDependencies() | ||
|
||
override fun getLastCompatibleVersionOfPlugin(ideVersion: IdeVersion, pluginId: String): PluginInfo? = | ||
delegateRepository.getLastCompatibleVersionOfPlugin(ideVersion, pluginId).asDependency() | ||
|
||
override fun getAllVersionsOfPlugin(pluginId: String): List<PluginInfo> = | ||
delegateRepository.getAllVersionsOfPlugin(pluginId).asDependencies() | ||
|
||
override fun getPluginsDeclaringModule(moduleId: String, ideVersion: IdeVersion?): List<PluginInfo> = | ||
delegateRepository.getPluginsDeclaringModule(moduleId, ideVersion).asDependencies() | ||
|
||
private fun List<PluginInfo>.asDependencies(): List<DependencyPluginInfo> = map { DependencyPluginInfo(it) } | ||
|
||
private fun PluginInfo?.asDependency(): PluginInfo? = this?.let { DependencyPluginInfo(it) } | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.