Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ groovy = "3.0.9"
jUnit = "4.13.2"
java-diff-utils = "4.12"
javaParser = "3.24.0"
jetbrains-compose-plugin = "1.7.3"
kgx = "0.1.12"
kotest = "5.1.0"
# Keep this in sync with what is hard-coded in build-logic/settings.gradle.kts as that is upstream
Expand Down Expand Up @@ -106,6 +107,8 @@ ktlint = { id = "com.rickbusarow.ktlint", version.ref = "ktlint-gradle" }
kotlinx-apiBinaryCompatibility = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "kotlinx-binary-compatibility" }
mavenPublish = { id = "com.vanniktech.maven.publish", version.ref = "vanniktech-publish" }

jetbrains-compose = { id = "org.jetbrains.compose", version.ref = "jetbrains-compose-plugin" }

[libraries]

android-gradle-plugin = { module = "com.android.tools.build:gradle", version.ref = "agpVersion" }
Expand Down Expand Up @@ -212,6 +215,7 @@ kotlinx-binaryCompatibility-gradle-plugin = { module = "org.jetbrains.kotlinx:bi
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-rx2 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-rx2", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-swing = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-swing", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-test-common = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx-coroutines" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization-json" }
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ include(
":workflow-rx2",
":workflow-testing",
":workflow-tracing",
":workflow-trace-viewer",
":workflow-ui:compose",
":workflow-ui:compose-tooling",
":workflow-ui:core-common",
Expand Down
11 changes: 11 additions & 0 deletions workflow-trace-viewer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Workflow Trace Viewer

A Compose for Desktop app that can be used to view Workflow traces.

## Running

It can be run via Gradle using:

```shell
./gradlew :workflow-trace-viewer:run
```
15 changes: 15 additions & 0 deletions workflow-trace-viewer/api/workflow-trace-viewer.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
public final class com/squareup/workflow1/traceviewer/AppKt {
public static final fun App (Landroidx/compose/runtime/Composer;I)V
}

public final class com/squareup/workflow1/traceviewer/ComposableSingletons$MainKt {
public static final field INSTANCE Lcom/squareup/workflow1/traceviewer/ComposableSingletons$MainKt;
public fun <init> ()V
public final fun getLambda$468449326$wf1_workflow_trace_viewer ()Lkotlin/jvm/functions/Function3;
}

public final class com/squareup/workflow1/traceviewer/MainKt {
public static final fun main ()V
public static synthetic fun main ([Ljava/lang/String;)V
}

50 changes: 50 additions & 0 deletions workflow-trace-viewer/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import org.jetbrains.compose.desktop.application.dsl.TargetFormat

plugins {
id("kotlin-multiplatform")
alias(libs.plugins.jetbrains.compose)
alias(libs.plugins.compose.compiler)
}

kotlin {
jvm()

sourceSets {
jvmMain {
dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material)
implementation(compose.ui)
implementation(compose.components.resources)
implementation(compose.components.uiToolingPreview)
implementation(libs.androidx.lifecycle.viewmodel.core)
implementation(libs.androidx.lifecycle.compose)
Comment on lines +21 to +22
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a lot of these are forward looking what might be useful, right? But will these androidx ones be usable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, they're KMP now and are expected to used with Compose for Desktop.

implementation(compose.desktop.currentOs)
implementation(libs.kotlinx.coroutines.swing)
implementation(compose.materialIconsExtended)
}
}
}
}

compose {
desktop {
application {
mainClass = "com.squareup.workflow1.traceviewer.MainKt"
jvmArgs(
"-Dapple.awt.application.appearance=system",
)

nativeDistributions {
includeAllModules = true
targetFormats(TargetFormat.Dmg)
packageName = "Workflow Trace Viewer"
packageVersion = "1.0.0"
macOS {
bundleID = "com.squareup.workflow1.traceviewer"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.squareup.workflow1.traceviewer

import androidx.compose.material.Text
import androidx.compose.runtime.Composable

@Composable
fun App() {
Text("Hello world!")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.squareup.workflow1.traceviewer

import androidx.compose.ui.window.singleWindowApplication

fun main() {
singleWindowApplication(title = "Workflow Trace Viewer") {
App()
}
}