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

[pull] main from gkd-kit:main #31

Merged
merged 3 commits into from
May 24, 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
2 changes: 1 addition & 1 deletion .github/workflows/Build-Apk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- '**'
paths-ignore:
- 'LICENSE'
- 'README.md'
- '*.md'
- '.github/**'

jobs:
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/kotlin/li/songe/gkd/util/NetworkExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import java.net.NetworkInterface

fun getIpAddressInLocalNetwork(): List<String> {
val networkInterfaces = try {
// android.system.ErrnoException: getifaddrs failed: EACCES (Permission denied)
NetworkInterface.getNetworkInterfaces().iterator().asSequence()
NetworkInterface.getNetworkInterfaces().asSequence()
} catch (e: Exception) {
// android.system.ErrnoException: getifaddrs failed: EACCES (Permission denied)
toast("获取host失败:" + e.message)
emptySequence()
return emptyList()
}
val localAddresses = networkInterfaces.flatMap {
it.inetAddresses.asSequence().filter { inetAddress ->
Expand All @@ -17,4 +17,4 @@ fun getIpAddressInLocalNetwork(): List<String> {
}.map { inetAddress -> inetAddress.hostAddress }
}
return localAddresses.toList()
}
}
24 changes: 15 additions & 9 deletions selector/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.kotlin.serialization)
}

kotlin {
jvm {
compilations.all {
kotlinOptions.jvmTarget = JavaVersion.VERSION_17.majorVersion
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}
// https://kotlinlang.org/docs/js-to-kotlin-interop.html#kotlin-types-in-javascript
Expand All @@ -20,12 +22,16 @@ kotlin {
all {
languageSettings.optIn("kotlin.js.ExperimentalJsExport")
}
}
sourceSets["commonMain"].dependencies {
implementation(libs.kotlin.stdlib.common)
}
sourceSets["jvmTest"].dependencies {
implementation(libs.kotlinx.serialization.json)
implementation(libs.junit)
commonMain {
dependencies {
implementation(libs.kotlin.stdlib.common)
}
}
jvmTest {
dependencies {
implementation(libs.kotlinx.serialization.json)
implementation(libs.junit)
}
}
}
}
14 changes: 9 additions & 5 deletions wasm_matches/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
alias(libs.plugins.kotlin.multiplatform)
}

kotlin {
jvm {
compilations.all {
kotlinOptions.jvmTarget = JavaVersion.VERSION_17.majorVersion
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}
wasmJs {
Expand All @@ -18,8 +20,10 @@ kotlin {
all {
languageSettings.optIn("kotlin.js.ExperimentalJsExport")
}
}
sourceSets["commonMain"].dependencies {
implementation(libs.kotlin.stdlib.common)
commonMain {
dependencies {
implementation(libs.kotlin.stdlib.common)
}
}
}
}