mirror of
https://github.com/InsanusMokrassar/KotlinPublicationScriptsBuilder.git
synced 2025-11-27 08:15:35 +00:00
partially go over with compose
This commit is contained in:
@@ -1,17 +1,13 @@
|
||||
plugins {
|
||||
id "org.jetbrains.kotlin.multiplatform"
|
||||
id "org.jetbrains.kotlin.plugin.serialization"
|
||||
id("org.jetbrains.compose") version "$compose_version"
|
||||
alias(libs.plugins.jb.compose)
|
||||
}
|
||||
|
||||
apply from: "$mppJavaProjectPresetPath"
|
||||
|
||||
kotlin {
|
||||
jvm {
|
||||
compilations.main.kotlinOptions {
|
||||
jvmTarget = "11"
|
||||
}
|
||||
}
|
||||
jvm()
|
||||
sourceSets {
|
||||
commonMain {
|
||||
dependencies {
|
||||
@@ -22,7 +18,7 @@ kotlin {
|
||||
jvmMain {
|
||||
dependencies {
|
||||
implementation(compose.desktop.currentOs)
|
||||
api "io.ktor:ktor-client-cio:$ktor_version"
|
||||
implementation libs.ktor.client.cio
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package dev.inmo.kmppscriptbuilder.desktop.utils
|
||||
|
||||
import dev.inmo.kmppscriptbuilder.core.models.Config
|
||||
import dev.inmo.kmppscriptbuilder.core.ui.utils.FileFilter
|
||||
import dev.inmo.kmppscriptbuilder.core.utils.serialFormat
|
||||
import java.io.File
|
||||
import javax.swing.JFileChooser
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package dev.inmo.kmppscriptbuilder.desktop.utils
|
||||
|
||||
import java.io.File
|
||||
import javax.swing.filechooser.FileFilter
|
||||
|
||||
fun FileFilter(description: String, fileFilter: (File) -> Boolean) = object : FileFilter() {
|
||||
override fun accept(f: File?): Boolean {
|
||||
return fileFilter(f ?: return false)
|
||||
}
|
||||
|
||||
override fun getDescription(): String = description
|
||||
}
|
||||
|
||||
fun FileFilter(description: String, nameRegex: Regex) = FileFilter(description) {
|
||||
it.name.matches(nameRegex)
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package dev.inmo.kmppscriptbuilder.desktop.utils
|
||||
|
||||
import java.awt.Desktop
|
||||
import java.net.URI
|
||||
|
||||
fun openLink(link: String): Boolean {
|
||||
val desktop = if (Desktop.isDesktopSupported()) Desktop.getDesktop() else null
|
||||
if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {
|
||||
try {
|
||||
desktop.browse(URI(link))
|
||||
return true
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
Reference in New Issue
Block a user