Skip to content

Commit

Permalink
fix bug and increase to 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
mshdabiola committed May 13, 2024
1 parent d1dd0d1 commit cc93479
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 11 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/deploy_desktopjar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Deploy Desktop

on:
push:
tags:
- 'd[0-9]+.[0-9]+.[0-9]+'
#v[0-9]+.[0-9]+.[0-9]+
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
BuildBinaries:
name: Build application packages
strategy:
matrix:
runtime: [ linux-x64, osx-x64, win-x64 ]
include:
- runtime: linux-x64
arch: x64
os: ubuntu-latest
build: packageUberJarForCurrentOS

- runtime: osx-x64
os: macOS-latest
build: packageUberJarForCurrentOS packageDmg

- runtime: win-x64
os: windows-latest
build: packageUberJarForCurrentOS packageReleaseMsi

runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v3
if: ${{ matrix.runtime != 'linux-fedora-x64' }}
with:
distribution: 'temurin'
java-version: '17'

- name: Build
uses: gradle/gradle-build-action@v3
with:
arguments: >
${{ matrix.build }}
# Upload runner package tar.gz/zip as artifact
- name: Publish Artifact
uses: actions/upload-artifact@v4
with:
name: runner-package-${{ matrix.runtime }}
path: |
desktop/build/compose/binaries/main/*/
desktop/build/compose/binaries/main-release/*/
desktop/build/compose/jars/
!desktop/build/compose/binaries/main/app/
${{ env.SIGNED_RELEASE_FILE }}
# Upload runner errors
- name: Upload error logs
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: runner-errors-${{ matrix.runtime }}
path: |
desktop/build/compose/logs/
16 changes: 15 additions & 1 deletion composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ plugins {
}

group = "com.mshdabiola.skeletonapp"
version = "1.0.2"
version = "1.0.3"

dependencies {

Expand Down Expand Up @@ -226,7 +226,21 @@ android {
compose.desktop {
application {
mainClass = "com.mshdabiola.desktop.MainAppKt"

nativeDistributions {
// targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
// packageVersion = "1.0.1"
// packageName = "Skeleton"
// description = "Template"
// copyright = "© 2022 Mshdabiola. All rights reserved."
// vendor = "Mshdabiola App"
// version = "1.0.1"
// licenseFile.set(rootProject.file("LICENSE"))

modules("java.net.http", "java.sql")
}
}

}

configurations.all {
Expand Down
7 changes: 7 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ room-plugin = "2.6.1"
roomKtx = "2.6.1"
sqlite = "2.5.0-alpha01"

kermit = "2.0.3"
slf4jSimple = "2.0.12"





Expand Down Expand Up @@ -248,6 +252,9 @@ sqldelight_primitive_adapter = { module = "app.cash.sqldelight:primitive-adapter
turbine = { module = "app.cash.turbine:turbine", version.ref = "turbine" }
timber = { module = "com.jakewharton.timber:timber", version.ref = "timber" }
leakcanary-android = { module = "com.squareup.leakcanary:leakcanary-android", version.ref = "leakcanaryAndroid" }
kermit = { module = "co.touchlab:kermit", version.ref = "kermit" }
kermit-koin = { module = "co.touchlab:kermit-koin", version.ref = "kermit" }
slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4jSimple" }

robolectric = { group = "org.robolectric", name = "robolectric", version.ref = "robolectric" }
robolectric-shadows = { group = "org.robolectric", name = "shadows-framework", version.ref = "robolectric" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import com.mshdabiola.model.generalPath
import org.koin.core.module.Module
import org.koin.dsl.module
import java.io.File
import java.io.FileOutputStream
import java.io.PrintWriter

actual val databaseModule: Module
get() = module {
Expand All @@ -19,14 +21,33 @@ actual val databaseModule: Module
}

fun getDatabaseBuilder(): RoomDatabase.Builder<SkeletonDatabase> {
val dbFile =
File(
generalPath,
Constant.databaseName,
)
//File(System.getProperty("java.io.tmpdir"), Constant.databaseName)
return Room.databaseBuilder<SkeletonDatabase>(
name = dbFile.absolutePath,
)
.setDriver(BundledSQLiteDriver())
val path= File("${System.getProperty("user.home")}/AppData/Local/hydraulic")
if (path.exists().not()){
path.mkdirs()
}
val file=File(path,"error.txt")


return try {

val dbFile =
File(
generalPath,
Constant.databaseName,
)
//File(System.getProperty("java.io.tmpdir"), Constant.databaseName)
Room.databaseBuilder<SkeletonDatabase>(
name = dbFile.absolutePath,
)
.setDriver(BundledSQLiteDriver())
}catch (e:Exception){
// file.bufferedWriter()
// .write("Catch")
//file.writeText(e.stackTraceToString())
e.printStackTrace(PrintWriter(file.bufferedWriter()))
// file.close()
throw e
}


}

0 comments on commit cc93479

Please sign in to comment.