Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimal Windows setup #238

Merged
merged 4 commits into from
Jul 3, 2024
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
21 changes: 21 additions & 0 deletions zeapp/badge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ kotlin {
}
}

os.startsWith("Windows") ->
jvm("windows") {
withJavaEnabled

jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

else -> throw StopActionException("Your operating system is not supported at this time: '${os}'.")
}

Expand Down Expand Up @@ -88,6 +97,18 @@ kotlin {
}
}
}

os.startsWith("Windows") -> {
val windowsMain by getting {
dependencies {
implementation(libs.jSerialComm)
}

sourceSets {
dependsOn(sourceSets.getAt("jvmMain"))
}
}
}
milosmns marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package de.berlindroid.zekompanion

import com.fazecast.jSerialComm.SerialPort


actual typealias Environment = Any

actual fun buildBadgeManager(environment: Environment): BadgeManager = object : JvmBadgeManager() {
override fun getBadger2040s() = SerialPort.getCommPorts()
.filter {
// Device doesn't show any better descriptive name on Windows, this should be good enough
it.portDescription.contains("CircuitPython")
}
.toList()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package de.berlindroid.zekompanion

actual fun getPlatform(): String = "Windows 🪟"
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import androidx.compose.ui.unit.IntSize
import androidx.compose.ui.unit.TextUnit
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import de.berlindroid.zekompanion.BADGE_HEIGHT
import de.berlindroid.zekompanion.BADGE_WIDTH
Comment on lines +34 to +35
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if that change is needed though. Shouldn't it be included already?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dunno, refused to build without

import de.berlindroid.zekompanion.desktop.State
import kotlin.math.max

Expand Down
Loading