Skip to content

Commit

Permalink
Merge branch 'openhab:main' into smartthingsNG
Browse files Browse the repository at this point in the history
  • Loading branch information
lo92fr authored Dec 16, 2024
2 parents 1f52adc + 9544767 commit 58be23d
Show file tree
Hide file tree
Showing 649 changed files with 3,666 additions and 2,065 deletions.
31 changes: 5 additions & 26 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [ '17', '21', 'profile-j21' ]
java: [ '21' ]
maven: [ '3.9.9' ]
os: [ 'ubuntu-24.04' ]
name: Build (Java ${{ matrix.java }}, ${{ matrix.os }})
Expand Down Expand Up @@ -46,25 +46,17 @@ jobs:
- name: Set up Java ${{ matrix.java }}
uses: actions/setup-java@v4
if: ${{ matrix.java != 'profile-j21' }}
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}

- name: Set up Java ${{ matrix.java }}
uses: actions/setup-java@v4
if: ${{ matrix.java == 'profile-j21' }}
with:
distribution: 'temurin'
java-version: ${{ 21 }}

- name: Set up Maven ${{ matrix.maven }}
uses: stCarolas/setup-maven@v5
with:
maven-version: ${{ matrix.maven }}

- name: Register Problem Matchers
if: ${{ matrix.java == '17' }}
if: ${{ matrix.java == '21' }}
id: problem_matchers
run: |
echo "::add-matcher::.github/openhab-compile-problems.json"
Expand All @@ -77,7 +69,6 @@ jobs:
format: 'csv'

- name: Build
if: ${{ matrix.java != 'profile-j21' }}
id: build
run: './.github/scripts/maven-build'
env:
Expand All @@ -88,34 +79,22 @@ jobs:
-Dmaven.wagon.httpconnectionManager.ttlSeconds=25
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
- name: Build
if: ${{ matrix.java == 'profile-j21' }}
id: build-j21
run: './.github/scripts/maven-build clean verify -B -T 1.5C -U -Pj21'
env:
CHANGED_FILES: ${{ steps.files.outputs.all }}
MAVEN_OPTS: >-
-Xmx2g
-Dmaven.wagon.http.retryHandler.count=5
-Dmaven.wagon.httpconnectionManager.ttlSeconds=25
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
- name: Upload Build Log
if: ${{ always() && ((steps.build.outcome == 'success') || (steps.build.outcome == 'failure') || (steps.build-j21.outcome == 'success') || (steps.build-j21.outcome == 'failure')) }}
if: ${{ always() && ((steps.build.outcome == 'success') || (steps.build.outcome == 'failure')) }}
uses: actions/upload-artifact@v4
with:
name: build-log-java-${{ matrix.java }}-${{ matrix.os }}
path: build.log

- name: Upload SAT Summary Report
if: ${{ matrix.java == '17' && always() && ((steps.build.outcome == 'success') || (steps.build.outcome == 'failure')) }}
if: ${{ always() && ((steps.build.outcome == 'success') || (steps.build.outcome == 'failure')) }}
uses: actions/upload-artifact@v4
with:
name: sat-summary-report
path: target/summary_report.html

- name: Report SAT Errors as Annotations
if: ${{ matrix.java == '17' && always() && ((steps.build.outcome == 'success') || (steps.build.outcome == 'failure')) }}
if: ${{ matrix.java == '21' && always() && ((steps.build.outcome == 'success') || (steps.build.outcome == 'failure')) }}
uses: ghys/checkstyle-github-action@main
with:
title: CheckStyle Violations
Expand Down
2 changes: 1 addition & 1 deletion bom/openhab-addons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.openhab.addons.bom</groupId>
<artifactId>org.openhab.addons.reactor.bom</artifactId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.addons.bom.openhab-addons</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bom/openhab-core-index/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.openhab.addons.bom</groupId>
<artifactId>org.openhab.addons.reactor.bom</artifactId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.addons.bom.openhab-core-index</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.openhab.addons</groupId>
<artifactId>org.openhab.addons.reactor</artifactId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>

<groupId>org.openhab.addons.bom</groupId>
Expand Down
2 changes: 1 addition & 1 deletion bom/runtime-index/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.openhab.addons.bom</groupId>
<artifactId>org.openhab.addons.reactor.bom</artifactId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.addons.bom.runtime-index</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bom/test-index/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.openhab.addons.bom</groupId>
<artifactId>org.openhab.addons.reactor.bom</artifactId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.addons.bom.test-index</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.automation.groovyscripting/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.automation.groovyscripting</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,15 @@ public void scopeValues(ScriptEngine scriptEngine, Map<String, Object> scopeValu
ImportCustomizer importCustomizer = new ImportCustomizer();
for (Map.Entry<String, Object> entry : scopeValues.entrySet()) {
if (entry.getValue() instanceof Class<?> clazz) {
importCustomizer.addImport(entry.getKey(), clazz.getCanonicalName());
String canonicalName = clazz.getCanonicalName();
try {
// Only add imports for classes that are available to the classloader
getClass().getClassLoader().loadClass(canonicalName);
importCustomizer.addImport(entry.getKey(), canonicalName);
logger.debug("Added import for {} as {}", entry.getKey(), canonicalName);
} catch (ClassNotFoundException e) {
logger.debug("Unable to add import for {} as {}", entry.getKey(), canonicalName, e);
}
} else {
scriptEngine.put(entry.getKey(), entry.getValue());
}
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.automation.jrubyscripting/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.automation.jrubyscripting</artifactId>
Expand Down
13 changes: 10 additions & 3 deletions bundles/org.openhab.automation.jsscripting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -809,13 +809,20 @@ See [openhab-js : actions.NotificationBuilder](https://openhab.github.io/openhab
The cache namespace provides both a private and a shared cache that can be used to set and retrieve data that will be persisted between subsequent runs of the same or between scripts.
The private cache can only be accessed by the same script and is cleared when the script is unloaded.
You can use it to store both primitives and objects, e.g. store timers or counters between subsequent runs of that script.
You can use it to store primitives and objects, e.g. store timers or counters between subsequent runs of that script.
When a script is unloaded and its cache is cleared, all timers (see [`createTimer`](#createtimer)) stored in its private cache are automatically cancelled.
The shared cache is shared across all rules and scripts, it can therefore be accessed from any automation language.
The access to every key is tracked and the key is removed when all scripts that ever accessed that key are unloaded.
If that key stored a timer, the timer will be cancelled.
You can use it to store **only primitives**, as storing objects is not thread-safe and can cause script execution failures.
You can use it to store primitives and **Java** objects, e.g. store timers or counters between multiple scripts.
Due to a multi-threading limitation in GraalJS (the JavaScript engine used by JavaScript Scripting), it is not recommended to store JavaScript objects in the shared cache.
Multi-threaded access to JavaScript objects will lead to script execution failure!
You can work-around that limitation by either serialising and deserialising JS objects or by switching to their Java counterparts.
Timers as created by [`createTimer`](#createtimer) can be stored in the shared cache.
The ids of timers and intervals as created by `setTimeout` and `setInterval` cannot be shared across scripts as these ids are local to the script where they were created.
See [openhab-js : cache](https://openhab.github.io/openhab-js/cache.html) for full API documentation.
Expand Down Expand Up @@ -1240,7 +1247,7 @@ Operations and conditions can also optionally take functions:
```javascript
rules.when().item("F1_light").changed().then(event => {
console.log(event);
console.log(event);
}).build("Test Rule", "My Test Rule");
```
Expand Down
4 changes: 2 additions & 2 deletions bundles/org.openhab.automation.jsscripting/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.automation.jsscripting</artifactId>
Expand All @@ -25,7 +25,7 @@
<!-- Remember to check if the fix https://github.com/openhab/openhab-core/pull/4437 still works when upgrading GraalJS -->
<graal.version>22.0.0.2</graal.version> <!-- DO NOT UPGRADE: 22.0.0.2 is the latest version working on armv7l / OpenJDK 11.0.16 & armv7l / Zulu 17.0.5+8 -->
<oh.version>${project.version}</oh.version>
<ohjs.version>[email protected].0</ohjs.version>
<ohjs.version>[email protected].1</ohjs.version>
</properties>

<build>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.automation.jsscriptingnashorn/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.automation.jsscriptingnashorn</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.automation.jythonscripting/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.automation.jythonscripting</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.automation.pidcontroller/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.automation.pidcontroller</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.automation.pwm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.automation.pwm</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.binding.adorne/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.adorne</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.binding.ahawastecollection/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.ahawastecollection</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.binding.airgradient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.airgradient</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.binding.airq/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.airq</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.binding.airquality/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.airquality</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.binding.airvisualnode/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.airvisualnode</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.binding.alarmdecoder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.alarmdecoder</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.binding.allplay/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.allplay</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.binding.amazondashbutton/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.amazondashbutton</artifactId>
Expand Down
Loading

0 comments on commit 58be23d

Please sign in to comment.