Don't offer updates for @snapshot@ plugin version
This commit is contained in:
@@ -133,16 +133,21 @@ class KotlinPluginUpdater(val propertiesComponent: PropertiesComponent) : Dispos
|
|||||||
|
|
||||||
private fun updateCheck(callback: (PluginUpdateStatus) -> Boolean) {
|
private fun updateCheck(callback: (PluginUpdateStatus) -> Boolean) {
|
||||||
var updateStatus: PluginUpdateStatus
|
var updateStatus: PluginUpdateStatus
|
||||||
try {
|
if (KotlinPluginUtil.isSnapshotVersion()) {
|
||||||
updateStatus = checkUpdatesInMainRepository()
|
updateStatus = PluginUpdateStatus.LatestVersionInstalled
|
||||||
|
|
||||||
for (host in RepositoryHelper.getPluginHosts().filterNotNull()) {
|
|
||||||
val customUpdateStatus = checkUpdatesInCustomRepository(host)
|
|
||||||
updateStatus = updateStatus.mergeWith(customUpdateStatus)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch(e: Exception) {
|
else {
|
||||||
updateStatus = PluginUpdateStatus.fromException("Kotlin plugin update check failed", e)
|
try {
|
||||||
|
updateStatus = checkUpdatesInMainRepository()
|
||||||
|
|
||||||
|
for (host in RepositoryHelper.getPluginHosts().filterNotNull()) {
|
||||||
|
val customUpdateStatus = checkUpdatesInCustomRepository(host)
|
||||||
|
updateStatus = updateStatus.mergeWith(customUpdateStatus)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(e: Exception) {
|
||||||
|
updateStatus = PluginUpdateStatus.fromException("Kotlin plugin update check failed", e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lastUpdateStatus = updateStatus
|
lastUpdateStatus = updateStatus
|
||||||
|
|||||||
@@ -37,6 +37,10 @@ public class KotlinPluginUtil {
|
|||||||
return plugin.getVersion();
|
return plugin.getVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isSnapshotVersion() {
|
||||||
|
return "@snapshot@".equals(getPluginVersion());
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isAndroidGradleModule(@NotNull Module module) {
|
public static boolean isAndroidGradleModule(@NotNull Module module) {
|
||||||
return KotlinModuleTypeManager.getInstance().isAndroidGradleModule(module);
|
return KotlinModuleTypeManager.getInstance().isAndroidGradleModule(module);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ data class VersionedLibrary(val library: Library, val version: String?, val used
|
|||||||
|
|
||||||
fun findOutdatedKotlinLibraries(project: Project): List<VersionedLibrary> {
|
fun findOutdatedKotlinLibraries(project: Project): List<VersionedLibrary> {
|
||||||
val pluginVersion = KotlinPluginUtil.getPluginVersion()
|
val pluginVersion = KotlinPluginUtil.getPluginVersion()
|
||||||
if ("@snapshot@" == pluginVersion) return emptyList() // plugin is run from sources, can't compare versions
|
if (KotlinPluginUtil.isSnapshotVersion()) return emptyList() // plugin is run from sources, can't compare versions
|
||||||
|
|
||||||
// user already clicked suppress
|
// user already clicked suppress
|
||||||
if (pluginVersion == PropertiesComponent.getInstance(project).getValue(SUPPRESSED_PROPERTY_NAME)) {
|
if (pluginVersion == PropertiesComponent.getInstance(project).getValue(SUPPRESSED_PROPERTY_NAME)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user