mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
RDO-3348: disable ides plugin installation for codecanvas
Merge-request: IJ-MR-157773 Merged-by: Anton Kapeliushok <Anton.Kapeliushok@jetbrains.com> (cherry picked from commit 0ee600a675822034c98bf5c054976cc2dd79bca0) IJ-MR-158217 GitOrigin-RevId: e9f4113000ac097028851c5f6feafc6c7fd4b3ef
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a270ea2c02
commit
5d2b60433d
@@ -747,12 +747,16 @@ object CodeWithMeClientDownloader {
|
|||||||
fun runFrontendProcess(
|
fun runFrontendProcess(
|
||||||
lifetime: Lifetime,
|
lifetime: Lifetime,
|
||||||
url: String,
|
url: String,
|
||||||
frontendInstallation: FrontendInstallation
|
frontendInstallation: FrontendInstallation,
|
||||||
|
enableBeforeRunHooks: Boolean = true,
|
||||||
): Lifetime {
|
): Lifetime {
|
||||||
try {
|
if (enableBeforeRunHooks) {
|
||||||
processBeforeRunHooks(frontendInstallation)
|
try {
|
||||||
} catch (e: Throwable) {
|
processBeforeRunHooks(frontendInstallation)
|
||||||
LOG.error("Could not process hooks before launching client $frontendInstallation", e)
|
}
|
||||||
|
catch (e: Throwable) {
|
||||||
|
LOG.error("Could not process hooks before launching client $frontendInstallation", e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
when (frontendInstallation) {
|
when (frontendInstallation) {
|
||||||
is EmbeddedFrontendInstallation -> {
|
is EmbeddedFrontendInstallation -> {
|
||||||
|
|||||||
@@ -38,17 +38,18 @@ object CodeWithMeGuestLauncher {
|
|||||||
clientBuild: BuildNumber?,
|
clientBuild: BuildNumber?,
|
||||||
url: String,
|
url: String,
|
||||||
@NlsContexts.DialogTitle product: String,
|
@NlsContexts.DialogTitle product: String,
|
||||||
onDone: (Lifetime) -> Unit = {}
|
enableBeforeRunHooks: Boolean,
|
||||||
|
onDone: (Lifetime) -> Unit = {},
|
||||||
) {
|
) {
|
||||||
if (!application.isDispatchThread) {
|
if (!application.isDispatchThread) {
|
||||||
// starting a task from background will call invokeLater, but with wrong modality, so do it ourselves
|
// starting a task from background will call invokeLater, but with wrong modality, so do it ourselves
|
||||||
application.invokeLater({ downloadCompatibleClientAndLaunch(lifetime, project, clientBuild, url, product, onDone) }, ModalityState.any())
|
application.invokeLater({ downloadCompatibleClientAndLaunch(lifetime, project, clientBuild, url, product, enableBeforeRunHooks, onDone) }, ModalityState.any())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
val uri = UrlUtil.parseOrShowError(url, product) ?: return
|
val uri = UrlUtil.parseOrShowError(url, product) ?: return
|
||||||
|
|
||||||
if (runAlreadyDownloadedClient(clientBuild, lifetime, project, url, onDone)) {
|
if (runAlreadyDownloadedClient(clientBuild, lifetime, project, url, enableBeforeRunHooks, onDone)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,7 +58,7 @@ object CodeWithMeGuestLauncher {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
ProgressManager.getInstance().run(DownloadAndLaunchClientTask(project, uri, lifetime, url, product, onDone))
|
ProgressManager.getInstance().run(DownloadAndLaunchClientTask(project, uri, lifetime, url, product, enableBeforeRunHooks, onDone))
|
||||||
}
|
}
|
||||||
|
|
||||||
private class DownloadAndLaunchClientTask(
|
private class DownloadAndLaunchClientTask(
|
||||||
@@ -66,7 +67,8 @@ object CodeWithMeGuestLauncher {
|
|||||||
private val lifetime: Lifetime?,
|
private val lifetime: Lifetime?,
|
||||||
private val url: String,
|
private val url: String,
|
||||||
private val product: @NlsContexts.DialogTitle String,
|
private val product: @NlsContexts.DialogTitle String,
|
||||||
private val onDone: (Lifetime) -> Unit
|
private val enableBeforeRunHooks: Boolean,
|
||||||
|
private val onDone: (Lifetime) -> Unit,
|
||||||
) : Backgroundable(project, RemoteDevUtilBundle.message("launcher.title"), true) {
|
) : Backgroundable(project, RemoteDevUtilBundle.message("launcher.title"), true) {
|
||||||
|
|
||||||
private var clientLifetime : Lifetime = Lifetime.Terminated
|
private var clientLifetime : Lifetime = Lifetime.Terminated
|
||||||
@@ -99,7 +101,8 @@ object CodeWithMeGuestLauncher {
|
|||||||
frontendInstallation = frontendInstallation,
|
frontendInstallation = frontendInstallation,
|
||||||
urlForThinClient = url,
|
urlForThinClient = url,
|
||||||
product = product,
|
product = product,
|
||||||
progressIndicator = progressIndicator
|
progressIndicator = progressIndicator,
|
||||||
|
enableBeforeRunHooks = enableBeforeRunHooks,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
catch (t: Throwable) {
|
catch (t: Throwable) {
|
||||||
@@ -120,7 +123,8 @@ object CodeWithMeGuestLauncher {
|
|||||||
aLifetime: Lifetime?,
|
aLifetime: Lifetime?,
|
||||||
project: Project?,
|
project: Project?,
|
||||||
url: String,
|
url: String,
|
||||||
onDone: (Lifetime) -> Unit
|
enableBeforeRunHooks: Boolean,
|
||||||
|
onDone: (Lifetime) -> Unit,
|
||||||
): Boolean {
|
): Boolean {
|
||||||
if (clientBuild == null) {
|
if (clientBuild == null) {
|
||||||
return false
|
return false
|
||||||
@@ -141,7 +145,8 @@ object CodeWithMeGuestLauncher {
|
|||||||
val clientLifetime = CodeWithMeClientDownloader.runFrontendProcess(
|
val clientLifetime = CodeWithMeClientDownloader.runFrontendProcess(
|
||||||
lifetime = lifetime,
|
lifetime = lifetime,
|
||||||
url = url,
|
url = url,
|
||||||
frontendInstallation = frontendInstallation
|
frontendInstallation = frontendInstallation,
|
||||||
|
enableBeforeRunHooks = enableBeforeRunHooks,
|
||||||
)
|
)
|
||||||
onDone(clientLifetime)
|
onDone(clientLifetime)
|
||||||
return true
|
return true
|
||||||
@@ -166,13 +171,15 @@ object CodeWithMeGuestLauncher {
|
|||||||
return StandaloneFrontendInstallation(guestData.targetPath, clientBuild, null)
|
return StandaloneFrontendInstallation(guestData.targetPath, clientBuild, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun runDownloadedFrontend(lifetime: Lifetime, frontendInstallation: FrontendInstallation, urlForThinClient: String,
|
fun runDownloadedFrontend(
|
||||||
@NlsContexts.DialogTitle product: String, progressIndicator: ProgressIndicator?): Lifetime {
|
lifetime: Lifetime, frontendInstallation: FrontendInstallation, urlForThinClient: String,
|
||||||
|
@NlsContexts.DialogTitle product: String, progressIndicator: ProgressIndicator?, enableBeforeRunHooks: Boolean,
|
||||||
|
): Lifetime {
|
||||||
// todo: offer to connect as-is?
|
// todo: offer to connect as-is?
|
||||||
try {
|
try {
|
||||||
progressIndicator?.text = RemoteDevUtilBundle.message("launcher.launch.client")
|
progressIndicator?.text = RemoteDevUtilBundle.message("launcher.launch.client")
|
||||||
progressIndicator?.text2 = frontendInstallation.installationHome.pathString
|
progressIndicator?.text2 = frontendInstallation.installationHome.pathString
|
||||||
val thinClientLifetime = CodeWithMeClientDownloader.runFrontendProcess(lifetime, urlForThinClient, frontendInstallation)
|
val thinClientLifetime = CodeWithMeClientDownloader.runFrontendProcess(lifetime, urlForThinClient, frontendInstallation, enableBeforeRunHooks)
|
||||||
|
|
||||||
// Wait a bit until process will be launched and only after that finish task
|
// Wait a bit until process will be launched and only after that finish task
|
||||||
Thread.sleep(3000)
|
Thread.sleep(3000)
|
||||||
|
|||||||
Reference in New Issue
Block a user