-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
96 changed files
with
2,766 additions
and
60 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
} | ||
|
||
dependencies { | ||
compileOnly(libs.jetbrains.compose.gradle.plugin) | ||
} |
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
28 changes: 28 additions & 0 deletions
28
gradle-conventions/src/main/kotlin/intellij-compose-feature.gradle.kts
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,28 @@ | ||
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension | ||
import util.libs | ||
|
||
plugins { | ||
id("org.jetbrains.kotlin.jvm") | ||
id("org.jetbrains.compose") | ||
id("org.jetbrains.kotlin.plugin.compose") | ||
} | ||
|
||
configure<KotlinJvmProjectExtension> { | ||
jvmToolchain(17) | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
google() | ||
maven("https://packages.jetbrains.team/maven/p/kpm/public/") | ||
} | ||
|
||
dependencies { | ||
implementation(project(":tooling:core:ui")) | ||
implementation(project(":tooling:core:model")) | ||
implementation(project(":tooling:core:usecase")) | ||
implementation(libs.findLibrary("jewel").get()) | ||
implementation(compose.desktop.currentOs) { | ||
exclude(group = "org.jetbrains.compose.material") | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
plugins { | ||
alias(libs.plugins.intelliJComposeFeature) | ||
} | ||
|
||
dependencies { | ||
implementation(projects.tooling.core.shared) | ||
implementation(projects.tooling.core.database) | ||
implementation(projects.tooling.feature.log) | ||
implementation(projects.tooling.feature.inspector) | ||
implementation(projects.tooling.feature.settings) | ||
} |
77 changes: 77 additions & 0 deletions
77
tooling/app/src/main/kotlin/com/kitakkun/backintime/tooling/app/BackInTimeDebuggerApp.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,77 @@ | ||
package com.kitakkun.backintime.tooling.app | ||
|
||
import androidx.compose.desktop.ui.tooling.preview.Preview | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.CompositionLocalProvider | ||
import androidx.compose.runtime.LaunchedEffect | ||
import androidx.compose.runtime.collectAsState | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.ui.Modifier | ||
import com.kitakkun.backintime.feature.settings.SettingsScreen | ||
import com.kitakkun.backintime.tooling.core.shared.BackInTimeDebuggerService | ||
import com.kitakkun.backintime.tooling.core.shared.BackInTimeDebuggerSettings | ||
import com.kitakkun.backintime.tooling.core.shared.IDENavigator | ||
import com.kitakkun.backintime.tooling.core.shared.PluginStateService | ||
import com.kitakkun.backintime.tooling.core.ui.component.HorizontalDivider | ||
import com.kitakkun.backintime.tooling.core.ui.compositionlocal.LocalIDENavigator | ||
import com.kitakkun.backintime.tooling.core.ui.compositionlocal.LocalPluginStateService | ||
import com.kitakkun.backintime.tooling.core.ui.compositionlocal.LocalServer | ||
import com.kitakkun.backintime.tooling.core.ui.compositionlocal.LocalSettings | ||
import com.kitakkun.backintime.tooling.core.ui.preview.PreviewContainer | ||
import com.kitakkun.backintime.tooling.core.ui.theme.BackInTimeTheme | ||
import com.kitakkun.backintime.tooling.feature.log.LogScreen | ||
import com.kitakkun.backintime.tooling.model.Tab | ||
import com.kitakkunl.backintime.feature.inspector.InspectorScreen | ||
|
||
@Composable | ||
fun BackInTimeDebuggerApp() { | ||
val server = LocalServer.current | ||
val serverState = server.state | ||
val settings = LocalSettings.current | ||
|
||
val pluginStateService = LocalPluginStateService.current | ||
val pluginState by pluginStateService.stateFlow.collectAsState() | ||
|
||
LaunchedEffect(Unit) { | ||
if (!serverState.serverIsRunning) { | ||
server.restartServer(settings.getState().serverPort) | ||
} | ||
} | ||
|
||
BackInTimeTheme { | ||
Column( | ||
modifier = Modifier.fillMaxSize() | ||
) { | ||
HorizontalDivider() | ||
BackInTimeTopBar( | ||
currentTab = pluginState.globalState.activeTab, | ||
onClickInstances = { pluginStateService.updateTab(Tab.Inspector) }, | ||
onClickLog = { pluginStateService.updateTab(Tab.Log) }, | ||
onClickSettings = { pluginStateService.updateTab(Tab.Settings) }, | ||
) | ||
HorizontalDivider() | ||
when (pluginState.globalState.activeTab) { | ||
Tab.Inspector -> InspectorScreen() | ||
Tab.Log -> LogScreen() | ||
Tab.Settings -> SettingsScreen() | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
private fun BackInTimeDebuggerAppPreview() { | ||
PreviewContainer { | ||
CompositionLocalProvider( | ||
LocalSettings provides BackInTimeDebuggerSettings.Dummy, | ||
LocalServer provides BackInTimeDebuggerService.Dummy, | ||
LocalPluginStateService provides PluginStateService.Dummy, | ||
LocalIDENavigator provides IDENavigator.Noop, | ||
) { | ||
BackInTimeDebuggerApp() | ||
} | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
tooling/app/src/main/kotlin/com/kitakkun/backintime/tooling/app/BackInTimeTopBar.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,55 @@ | ||
package com.kitakkun.backintime.tooling.app | ||
|
||
import androidx.compose.desktop.ui.tooling.preview.Preview | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import com.kitakkun.backintime.tooling.core.ui.preview.PreviewContainer | ||
import com.kitakkun.backintime.tooling.model.Tab | ||
import org.jetbrains.jewel.ui.component.SelectableIconActionButton | ||
import org.jetbrains.jewel.ui.icons.AllIconsKeys | ||
|
||
@Composable | ||
fun BackInTimeTopBar( | ||
onClickSettings: () -> Unit, | ||
onClickInstances: () -> Unit, | ||
onClickLog: () -> Unit, | ||
currentTab: Tab, | ||
modifier: Modifier = Modifier, | ||
) { | ||
Row(modifier = modifier) { | ||
SelectableIconActionButton( | ||
selected = currentTab == Tab.Inspector, | ||
onClick = onClickInstances, | ||
key = AllIconsKeys.Nodes.Class, | ||
contentDescription = null, | ||
) | ||
SelectableIconActionButton( | ||
selected = currentTab == Tab.Log, | ||
onClick = onClickLog, | ||
key = AllIconsKeys.Toolwindows.InfoEvents, | ||
contentDescription = null, | ||
) | ||
Spacer(Modifier.weight(1f)) | ||
SelectableIconActionButton( | ||
selected = currentTab == Tab.Settings, | ||
onClick = onClickSettings, | ||
key = AllIconsKeys.General.Settings, | ||
contentDescription = null, | ||
) | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
private fun BackInTimeTopBarPreview() { | ||
PreviewContainer { | ||
BackInTimeTopBar( | ||
currentTab = Tab.Inspector, | ||
onClickInstances = {}, | ||
onClickLog = {}, | ||
onClickSettings = {}, | ||
) | ||
} | ||
} |
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
4 changes: 2 additions & 2 deletions
4
...ooling/database/BackInTimeDatabaseImpl.kt → ...g/core/database/BackInTimeDatabaseImpl.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
3 changes: 1 addition & 2 deletions
3
...me/tooling/database/SqlDelightDatabase.kt → ...oling/core/database/SqlDelightDatabase.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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ng/database/BackInTimeDatabaseImplTest.kt → ...re/database/BackInTimeDatabaseImplTest.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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions
11
tooling/core/model/src/commonMain/kotlin/com/kitakkun/backintime/tooling/model/Instance.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,11 @@ | ||
package com.kitakkun.backintime.tooling.model | ||
|
||
data class Instance( | ||
val id: String, | ||
val className: String, | ||
val superClassName: String, | ||
val properties: List<Property>, | ||
val events: List<InstanceEventData>, | ||
) { | ||
val totalEvents: Int get() = events.size | ||
} |
6 changes: 2 additions & 4 deletions
6
...intime/tooling/model/InstanceEventData.kt → ...intime/tooling/model/InstanceEventData.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
File renamed without changes.
File renamed without changes.
Oops, something went wrong.