Skip to content

Commit

Permalink
Merge 'main' into 'dev/1.0.0' (#153)
Browse files Browse the repository at this point in the history
* build: Sync  with eclipse-zenoh/zenoh@9d09742 from 2024-06-11 (#109)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@ed6c636 from 2024-06-12 (#112)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@8160b01 from 2024-06-13 (#115)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* Enable releasing from any branch (#114)

* build: Sync  with eclipse-zenoh/zenoh@7adad94 from 2024-06-14 (#117)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@93f93d2 from 2024-06-17 (#118)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@2500e5a from 2024-06-20 (#119)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@869ace6 from 2024-07-02 (#120)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@b93ca84 from 2024-07-03 (#121)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* Enabling snapshot publications for dev/1.0.0 on the CI

* fix: wrong syntax in ci workflow (#124)

* build: Sync  with eclipse-zenoh/zenoh@b3e42ce from 2024-07-08 (#126)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* Update main release workflow (#133)

* Using 'android' property to enable/disable Android configuration (#127)

* Enabling snapshot publications for dev/1.0.0

* refactor(gradle): using 'android' property to enable/disable Android configuration

Examples:
- `gradle build -Pandroid=true` enables build with android
- `gradle build` won't consider any android configuration
- `gradle publishAndroidReleaseToMavenLocal -Pandroid=true` publishes to maven local,
	without `-Pandroid=true` it won't work.

* refactor(gradle): updating publication workflows

* refactor(gradle): updating readme instructions

---------

Co-authored-by: zettascale-bot <[email protected]>

* fix(local publication): triggering compilation of zenoh jni when publishing jvm to maven local (#128)

* Update actions (#130)

* chore: Update setup-java to v4

* chore: update gradle action to newer version

* chore: update gradle/wrapper-validation-action@v3

---------

Co-authored-by: Darius Maitia <[email protected]>
Co-authored-by: zettascale-bot <[email protected]>

* fix: Update gradle actions to newer versions (#134)

* fix: Update buildDir usage for gradle 8

* Update gradle wrapper action to newer version

* calling gradle action via arguments is deprecated

* fix: remove unnecessary call to buildDir()

* fix: add -Pandroid to gradle dokkaHtml call

Otherwise the docs won't build

* Fix documentation publication error on CI (#136)

* build: Sync  with eclipse-zenoh/zenoh@0a969cb from 2024-07-25 (#141)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@e587aa9 from 2024-07-26 (#144)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@2d88c7b from 2024-07-29 (#147)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* Fix JVM crash when finalizing a session that wasn't properly initialized (#139) (#140)

* Fix snapshot publications on the CI (#149)

* Fix ZPubThr example imports (#142)

---------

Co-authored-by: eclipse-zenoh-bot <[email protected]>
Co-authored-by: eclipse-zenoh-bot <[email protected]>
Co-authored-by: Mahmoud Mazouz <[email protected]>
Co-authored-by: kydos <[email protected]>
Co-authored-by: Diogo Matsubara <[email protected]>
Co-authored-by: zettascale-bot <[email protected]>
Co-authored-by: Jonathan Hepp <[email protected]>
  • Loading branch information
8 people authored Aug 5, 2024
1 parent c283f7c commit 2600933
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-dokka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
link-to-sdk: true

- name: Build doc
run: gradle -Pandroid dokkaHtml
run: gradle -Pandroid=true dokkaHtml

- name: Deploy doc
if: ${{ inputs.live-run || false }}
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ on:
type: string
description: Release number of Zenoh
required: false
branch:
type: string
description: Release branch
required: false

jobs:
tag:
Expand All @@ -45,6 +49,7 @@ jobs:
repo: ${{ github.repository }}
live-run: ${{ inputs.live-run || false }}
version: ${{ inputs.version }}
branch: ${{ inputs.branch }}
github-token: ${{ secrets.BOT_TOKEN_WORKFLOW }}

- name: Checkout this repository
Expand Down
7 changes: 5 additions & 2 deletions zenoh-kotlin/src/commonMain/kotlin/io/zenoh/Session.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import java.time.Duration
*/
class Session private constructor(private val config: Config) : AutoCloseable {

private var jniSession: JNISession? = JNISession()
private var jniSession: JNISession? = null

private var declarations = mutableListOf<SessionDeclaration>()

Expand Down Expand Up @@ -440,7 +440,10 @@ class Session private constructor(private val config: Config) : AutoCloseable {

/** Launches the session through the jni session, returning the [Session] on success. */
private fun launch(): Result<Session> = runCatching {
return jniSession!!.open(config).map { this@Session }
jniSession = JNISession()
return jniSession!!.open(config)
.map { this@Session }
.onFailure { jniSession = null }
}
}

8 changes: 7 additions & 1 deletion zenoh-kotlin/src/commonTest/kotlin/io/zenoh/SessionTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package io.zenoh
import io.zenoh.exceptions.SessionException
import io.zenoh.keyexpr.KeyExpr
import io.zenoh.keyexpr.intoKeyExpr
import io.zenoh.sample.Sample
import kotlinx.coroutines.runBlocking
import java.nio.file.Path
import kotlin.test.*

class SessionTest {
Expand All @@ -42,6 +42,12 @@ class SessionTest {
assertFalse(session.isOpen())
}

@Test
fun sessionOpeningFailure() {
val invalidConfig = Config.from(Path.of("invalid"))
assertFailsWith<SessionException> { Session.open(invalidConfig).getOrThrow() }
}

@Test
fun sessionClose_succeedsDespiteNotFreeingAllDeclarations() {
val session = Session.open().getOrThrow()
Expand Down

0 comments on commit 2600933

Please sign in to comment.