Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
naotiki committed Jul 2, 2023
2 parents 260698b + 4ad56b2 commit 92d8965
Show file tree
Hide file tree
Showing 10 changed files with 421 additions and 283 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
if: startsWith( inputs.version || github.ref_name , 'v' )
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
os: [windows-latest, ubuntu-latest,macos-latest]
uses: ./.github/workflows/build-client.yml
with:
version: ${{ inputs.version || github.ref_name }}
Expand Down
43 changes: 29 additions & 14 deletions chiiugo-protocol-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import org.jetbrains.kotlin.gradle.targets.js.npm.PackageJson
import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinPackageJsonTask
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJsCompilation
import org.jetbrains.kotlin.gradle.targets.js.npm.PublicPackageJsonTask

plugins {
kotlin("multiplatform")
Expand All @@ -21,36 +21,51 @@ dependencies {

}


kotlin {
targets {
js {
compilations.all{
packageJson {
//name="@naotiki/chiiugo"
private=false
}
}
}
}
jvm()
js(IR) {
compilations.getByName("main"){
packageJson {
name="@naotiki/chiiugo"
private=false
}
}
binaries.executable()

nodejs {
this.runTask {

}
}
generateTypeScriptDefinitions()
}
sourceSets{
val commonMain by getting{
dependencies {
//testImplementation(kotlin("test"))
//implementation("org.jetbrains.kotlinx:kotlinx-nodejs:0.0.7")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:1.5.1")
}
sourceSets {
val commonMain by getting {
dependencies {
//testImplementation(kotlin("test"))
//implementation("org.jetbrains.kotlinx:kotlinx-nodejs:0.0.7")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:1.5.1")
}


}
val jsMain by getting{
val jsMain by getting {
dependencies {
implementation(enforcedPlatform(kotlinw("wrappers-bom:$kotlinWrappersVersion")))
implementation(kotlinw("node"))
}
}
val jvmMain by getting{
val jvmMain by getting {

}
}
Expand Down
1 change: 1 addition & 0 deletions chiiugo-protocol-core/src/commonMain/kotlin/Event.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ sealed class Event{
data class SuccessBuild(val buildId:String) : Event()
@Serializable
data class FailedBuild(val buildId:String): Event()
@Suppress("NON_EXPORTABLE_TYPE")
@Serializable
data class Typed(val char: Char): Event()
@Serializable
Expand Down
2 changes: 1 addition & 1 deletion chiiugo-protocol-core/src/jsMain/kotlin/Client.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Client(val clientData: ClientData):Disposable {
var socket: Socket? = null

fun startServer(): Promise<Unit> {
return Promise { resolve, reject ->
return Promise { resolve, _ ->
val s = Socket()
s.once(Event.ERROR) {
console.log("Error")
Expand Down
8 changes: 6 additions & 2 deletions client-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies {
implementation(compose.desktop.currentOs)
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
implementation(compose.desktop.components.animatedImage)
implementation(compose.materialIconsExtended)


implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
Expand All @@ -47,7 +48,7 @@ dependencies {
implementation("org.jetbrains.exposed:exposed-jdbc:$exposedVersion")
implementation("org.jetbrains.exposed:exposed-kotlin-datetime:$exposedVersion")
implementation("com.h2database:h2:2.1.214")

implementation("com.1stleg:jnativehook:2.1.0")
implementation(project(":chiiugo-protocol-core"))
}

Expand All @@ -58,7 +59,7 @@ compose.desktop {
jvmArgs += listOf("-Dfile.encoding=UTF-8")
nativeDistributions {
modules("java.sql")
targetFormats( TargetFormat.Msi, TargetFormat.Deb, TargetFormat.Rpm)
targetFormats( TargetFormat.Msi, TargetFormat.Deb, TargetFormat.Rpm,TargetFormat.Dmg)
packageName = "Chiiugo"
description = "Chiiugo Client App"
vendor="Naotiki"
Expand All @@ -68,6 +69,9 @@ compose.desktop {
shortcut = true
iconFile.set(file("Chiiugo.png"))
}
macOS{
packageVersion=appVersion.generateMacVersion()
}
windows {
perUserInstall=true
packageVersion = appVersion.generateWindowsVersion()
Expand Down
6 changes: 6 additions & 0 deletions client-app/buildSrc/src/main/kotlin/AppVersion.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ data class AppVersion(
}
}
}
fun generateMacVersion():String{
val winPatch=if (preRelease!=null&&preReleaseNumber!=null){
(patch shl 8) or (preRelease.ordinal shl 6) or preReleaseNumber
}else (patch shl 8) or (0b11 shl 6)
return "${major+1}.$minor.$winPatch"
}
fun generateWindowsVersion(): String {
val winPatch=if (preRelease!=null&&preReleaseNumber!=null){
(patch shl 8) or (preRelease.ordinal shl 6) or preReleaseNumber
Expand Down
Loading

0 comments on commit 92d8965

Please sign in to comment.