Skip to content

Commit

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

Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com>

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

Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com>

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

Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com>

* Enable releasing from any branch (eclipse-zenoh#114)

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

Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com>

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

Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com>

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

Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com>

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

Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com>

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

Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com>

* Enabling snapshot publications for dev/1.0.0 on the CI

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

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

Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com>

* Update main release workflow (eclipse-zenoh#133)

* Using 'android' property to enable/disable Android configuration (eclipse-zenoh#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 <161707711+zettascale-bot@users.noreply.github.com>

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

* Update actions (eclipse-zenoh#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 <darius@zettascale.tech>
Co-authored-by: zettascale-bot <161707711+zettascale-bot@users.noreply.github.com>

* fix: Update gradle actions to newer versions (eclipse-zenoh#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 (eclipse-zenoh#136)

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

Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com>

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

Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com>

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

Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com>

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

* Fix snapshot publications on the CI (eclipse-zenoh#149)

* Fix ZPubThr example imports (eclipse-zenoh#142)

---------

Co-authored-by: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com>
Co-authored-by: eclipse-zenoh-bot <eclipse-zenoh-bot@users.noreply.github.com>
Co-authored-by: Mahmoud Mazouz <mazouz.mahmoud@outlook.com>
Co-authored-by: kydos <kydos@protonmail.com>
Co-authored-by: Diogo Matsubara <diogo.matsubara@zettascale.tech>
Co-authored-by: zettascale-bot <161707711+zettascale-bot@users.noreply.github.com>
Co-authored-by: Jonathan Hepp <jonathan.hepp@gmail.com>
  • Loading branch information
8 people committed Aug 16, 2024
1 parent 62b5ee3 commit 70a6d6f
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 @@ -54,7 +54,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 @@ -897,7 +897,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 70a6d6f

Please sign in to comment.