Skip to content

Commit e0eb71c

Browse files
committed
Update Fleet dependency to 1.29
It required updating fleet gradle plugin and kotlin plugin as well
1 parent 1b6325a commit e0eb71c

File tree

9 files changed

+33
-34
lines changed

9 files changed

+33
-34
lines changed

fleet-plugin/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import org.jetbrains.fleet.dsl.FleetKotlinDependencyHandler
22

33
plugins {
44
idea
5-
id("org.jetbrains.fleet-plugin") version "0.2.99"
5+
id("org.jetbrains.fleet-plugin") version "0.3.121"
66
}
77

88
idea {

fleet-plugin/src/commonImpl/java/module-info.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
module com.jetbrains.edu.fleet.common {
22
requires kotlin.stdlib;
33
requires kotlinx.coroutines.core;
4-
requires fleet.rhizomedb;
54
requires fleet.common;
5+
requires fleet.kernel.plugins;
6+
requires fleet.rhizomedb;
7+
requires fleet.util.network;
68

79
requires com.jetbrains.edu.format;
8-
requires fleet.util.network;
910
requires retrofit2;
1011
requires com.fasterxml.jackson.databind;
1112
requires okhttp3;

fleet-plugin/src/frontendImpl/kotlin/com/jetbrains/edu/fleet/frontend/EduFrontendPlugin.kt

+7-6
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import fleet.kernel.*
2424
import fleet.kernel.plugins.ContributionScope
2525
import fleet.kernel.plugins.Plugin
2626
import fleet.kernel.plugins.PluginScope
27+
import fleet.kernel.plugins.worker
2728
import kotlinx.coroutines.launch
2829
import kotlinx.coroutines.supervisorScope
2930
import noria.NoriaContext
@@ -37,8 +38,8 @@ class EduFrontendPlugin : Plugin<Unit> {
3738

3839
override fun ContributionScope.load(pluginScope: PluginScope) {
3940
actions(
40-
createImportCourseAction(),
41-
createImportMarketplaceCourseAction(),
41+
createImportCourseAction(pluginScope),
42+
createImportMarketplaceCourseAction(pluginScope),
4243
courseViewAction
4344
)
4445
entityRenderer(CourseIdDialogEntity::class, NoriaContext::courseIdDialog)
@@ -56,21 +57,21 @@ class EduFrontendPlugin : Plugin<Unit> {
5657
// launchOnEachEntity<FrontendEntity> {
5758
// val shipParams = it.shipParams as? OpenLocalWorkspace ?: return@launchOnEachEntity
5859
// val courseId = shipParams.extra["courseId"] ?: return@launchOnEachEntity
59-
// createCourse(courseId, kernel)
60+
// createCourse(courseId, pluginScope)
6061
// }
6162
// }
6263
// }
6364
// }
6465
}
6566
}
6667

67-
private suspend fun createCourse(id: String?, kernel: Kernel) {
68+
private suspend fun createCourse(id: String?, pluginScope: PluginScope) {
6869
val courseId = id?.toInt() ?: return
6970
MarketplaceConnector.loadCourse(courseId) { course ->
70-
kernel.saga {
71+
pluginScope.saga {
7172
val window = lastFocusedEntity(WindowEntity::class) ?: return@saga
7273
showSelectFolderDialog(window) { item, showValidationError ->
73-
kernel.saga {
74+
pluginScope.saga {
7475
val fileAddress = item.child(course.name)
7576
val success = CourseProjectGenerator().createCourse(fileAddress, course)
7677
if (success) {

fleet-plugin/src/frontendImpl/kotlin/com/jetbrains/edu/fleet/frontend/actions/EduImportCourseAction.kt

+10-12
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
package com.jetbrains.edu.fleet.frontend.actions
22

3-
import fleet.api.child
43
import com.jetbrains.edu.fleet.common.CourseEntity
54
import com.jetbrains.edu.fleet.common.generation.CourseProjectGenerator
65
import com.jetbrains.edu.fleet.common.marketplace.MarketplaceConnector
76
import com.jetbrains.edu.fleet.common.yaml.YamlFormatSynchronizer
87
import com.jetbrains.edu.fleet.frontend.EduTriggers
98
import com.jetbrains.edu.fleet.frontend.ui.newCourseTreeView
109
import com.jetbrains.edu.fleet.frontend.ui.showCourseIdDialog
10+
import fleet.api.child
1111
import fleet.frontend.actions.FleetDataKeys
12-
import fleet.frontend.actions.kernel
1312
import fleet.frontend.actions.sagaAction
1413
import fleet.frontend.actions.windowEntity
1514
import fleet.frontend.fsd.showSelectFolderDialog
@@ -18,37 +17,36 @@ import fleet.frontend.layout.ShowOpts
1817
import fleet.frontend.layout.WindowEntity
1918
import fleet.frontend.layout.openTool
2019
import fleet.frontend.navigation.attachToWorkspace
21-
import fleet.kernel.Kernel
2220
import fleet.kernel.change
21+
import fleet.kernel.plugins.PluginScope
2322
import fleet.kernel.saga
2423
import noria.model.Action
2524
import noria.model.ActionPresentation
2625

27-
internal fun createImportMarketplaceCourseAction(): Action {
26+
internal fun createImportMarketplaceCourseAction(pluginScope: PluginScope): Action {
2827
return Action(
2928
perform = sagaAction { actionContext ->
3029
val window = actionContext.windowEntity
31-
val kernel = actionContext.kernel
32-
kernel.changeAsync {
30+
pluginScope.changeAsync {
3331
showCourseIdDialog(window) {
34-
kernel.saga {
35-
createCourse(it, window, kernel)
32+
pluginScope.saga {
33+
createCourse(it, window, pluginScope)
3634
}
3735
}
3836
}
3937
},
4038
identifier = "import-marketplace-course",
41-
requirements = setOf(FleetDataKeys.Kernel, FleetDataKeys.Window),
39+
requirements = setOf(FleetDataKeys.Window),
4240
triggers = setOf(EduTriggers.ImportMarketplace),
4341
defaultPresentation = ActionPresentation("Import Marketplace Course"))
4442
}
4543

46-
private suspend fun createCourse(id: String?, window: WindowEntity, kernel: Kernel) {
44+
private suspend fun createCourse(id: String?, window: WindowEntity, pluginScope: PluginScope) {
4745
val courseId = id?.toInt() ?: return
4846
MarketplaceConnector.loadCourse(courseId) { course ->
49-
kernel.saga {
47+
pluginScope.saga {
5048
showSelectFolderDialog(window) { item, showValidationError ->
51-
kernel.saga {
49+
pluginScope.saga {
5250
val fileAddress = item.child(course.name)
5351
val success = CourseProjectGenerator().createCourse(fileAddress, course)
5452
if (success) {

fleet-plugin/src/frontendImpl/kotlin/com/jetbrains/edu/fleet/frontend/actions/EduImportLocalCourseAction.kt

+4-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import fleet.frontend.layout.ShowOpts
1818
import fleet.frontend.layout.openTool
1919
import fleet.frontend.navigation.attachToWorkspace
2020
import fleet.kernel.change
21-
import fleet.kernel.kernel
21+
import fleet.kernel.plugins.PluginScope
2222
import fleet.kernel.saga
2323
import kotlinx.coroutines.Dispatchers
2424
import kotlinx.coroutines.withContext
@@ -28,11 +28,10 @@ import java.io.File
2828
import java.nio.charset.StandardCharsets
2929
import java.util.zip.ZipFile
3030

31-
internal fun createImportCourseAction(): Action {
31+
internal fun createImportCourseAction(pluginScope: PluginScope): Action {
3232
return Action(
3333
perform = sagaAction { actionContext ->
3434
val window = actionContext.windowEntity
35-
val kernel = kernel()
3635

3736
showOpenDialog(window) { item ->
3837
withContext(Dispatchers.IO) {
@@ -43,7 +42,7 @@ internal fun createImportCourseAction(): Action {
4342
val course = readCourseJson(reader) ?: return@showOpenDialog ConfirmDialogCommand.CLOSE
4443

4544
showSelectFolderDialog(window) { item, showValidationError ->
46-
kernel.saga {
45+
pluginScope.saga {
4746
val fileAddress = item.child(course.name)
4847
val success = CourseProjectGenerator().createCourse(fileAddress, course)
4948
if (success) {
@@ -64,7 +63,7 @@ internal fun createImportCourseAction(): Action {
6463
}
6564
},
6665
identifier = "import-local-course",
67-
requirements = setOf(FleetDataKeys.Kernel, FleetDataKeys.Window),
66+
requirements = setOf(FleetDataKeys.Window),
6867
triggers = setOf(EduTriggers.Import),
6968
defaultPresentation = ActionPresentation("Import Course"))
7069
}

fleet-plugin/src/frontendImpl/kotlin/com/jetbrains/edu/fleet/frontend/ui/CourseIdDialogEntity.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.jetbrains.edu.fleet.frontend.ui
22

3+
import fleet.frontend.PluginScopeKey
34
import fleet.frontend.layout.*
4-
import fleet.frontend.ui.db.KernelKey
55
import fleet.kernel.ChangeScope
66
import fleet.util.plus
77
import noria.NoriaContext
@@ -29,13 +29,13 @@ fun ChangeScope.showCourseIdDialog(window: WindowEntity, onConfirm: (String?) ->
2929
}
3030

3131
fun NoriaContext.courseIdDialog(courseDialog: CourseIdDialogEntity) {
32+
val pluginScope = PluginScopeKey.value
3233
dialog {
33-
val kernel = requireNotNull(bindings[KernelKey])
3434
hbox(align = Align.Center) {
3535
uiText("Enter course id: ")
3636
gap(width = 2)
3737
textInput("", onInput = { newValue ->
38-
kernel.changeAsync {
38+
pluginScope.changeAsync {
3939
courseDialog.id = newValue
4040
}
4141
})

fleet-plugin/src/frontendImpl/kotlin/com/jetbrains/edu/fleet/frontend/ui/CourseViewEntity.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ val courseViewAction = Action(
6060
}
6161
},
6262
identifier = "open-course-tree",
63-
requirements = setOf(FleetDataKeys.Kernel, FleetDataKeys.Window),
63+
requirements = setOf(FleetDataKeys.Window),
6464
triggers = setOf(EduTriggers.CourseView)
6565
)

gradle.properties

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ eduFormatSourcesArtifactPath=build/distributions/edu-format-sources.jar
4040
## Fleet properties
4141
fleetIntegration=false
4242

43-
fleetRuntimeVersion=1.27.47
44-
fleetRuntimeMinVersion=1.26.0
45-
fleetRuntimeMaxVersion=1.27.999
43+
fleetRuntimeVersion=1.29.14
44+
fleetRuntimeMinVersion=1.29.0
45+
fleetRuntimeMaxVersion=1.29.999
4646

4747
# See `Setup` section in `fleet-plugin/README.md`
4848
spaceUsername=

gradle/libs.versions.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[versions]
2-
kotlin = "1.9.0"
2+
kotlin = "1.9.21"
33
jackson = "2.14.3"
44
okhttp = "4.10.0"
55
retrofit = "2.9.0"

0 commit comments

Comments
 (0)