openhab-addons/bundles/org.openhab.automation.jsscripting/pom.xml
Florian Hotze 931f004ab8
[jsscripting] Upgrade to ECMAScript 2022 & Dependency improvements (#14093)
* [jsscripting] Remove asm from dependencies in pom

GraalJS >= 20.3.0 doesn't require org.ow2.asm as compile dependency anymore, see https://mvnrepository.com/artifact/org.graalvm.js/js/20.3.0.

* [jsscripting] Remove dependency org.graalvm.js/js-launcher as it is not required

js-launcher is GraalVM's JavaScript command line interpreter and not required in the addon.
See https://www.graalvm.org/22.1/reference-manual/js/RunOnJDK/.

* [jsscripting] Add missing com.ibm.icu dependency

GraalJS changelog says that it is not required for GraalJS >= 22.0.0 (see 685e5873af/CHANGELOG.md (version-2200)).
But GraalJS 22.3.0 attempts to load classes from it during runtime.

* [jsscripting] Update GraalJS engine options

Compat, as its additional functionality is not used by openhab-js and user code is not expected to use it.

* [jsscripting] Remove com.ibm.icu/icu4j dependency
* [jsscripting] Don't disable Nashorn compat mode as openhab-js requires it for accessors

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
2022-12-30 23:04:43 +01:00

143 lines
4.9 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>4.0.0-SNAPSHOT</version>
</parent>
<artifactId>org.openhab.automation.jsscripting</artifactId>
<name>openHAB Add-ons :: Bundles :: Automation :: JavaScript Scripting</name>
<properties>
<bnd.importpackage>
!sun.misc.*,
!sun.reflect.*,
!com.sun.management.*,
!jdk.internal.reflect.*,
!jdk.vm.ci.services
</bnd.importpackage>
<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>openhab@3.1.2</ohjs.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>embed-dependencies</id>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<excludes>META-INF/services/com.oracle.truffle.api.TruffleLanguage$Provider</excludes> <!-- we'll provide this -->
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.12.1</version>
<configuration>
<nodeVersion>v16.17.1</nodeVersion> <!-- DO NOT DOWNGRADE: NodeJS < 16 doesn't support Apple Silicon -->
<workingDirectory>target/js</workingDirectory>
</configuration>
<executions>
<execution>
<id>Install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<phase>generate-sources</phase>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install ${ohjs.version} webpack@5.75.0 webpack-cli@4.10.0</arguments> <!-- webpack-cli >= 5.0.0 doesn't properly process the given entrypoint -->
</configuration>
</execution>
<execution>
<id>npx webpack</id>
<goals>
<goal>npx</goal>
</goals>
<configuration>
<arguments>webpack -c ./node_modules/openhab/webpack.config.js --entry ./node_modules/openhab/ -o ./dist</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>add-resource</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<resources>
<resource>
<directory>target/js/dist</directory>
<targetPath>node_modules</targetPath>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.openhab.tools.sat</groupId>
<artifactId>sat-plugin</artifactId>
<configuration>
<pmdFilter>${project.basedir}/suppressions.properties</pmdFilter>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.graalvm.truffle</groupId>
<artifactId>truffle-api</artifactId>
<version>${graal.version}</version>
</dependency>
<dependency>
<groupId>org.graalvm.js</groupId>
<artifactId>js-scriptengine</artifactId>
<version>${graal.version}</version>
</dependency>
<dependency>
<groupId>org.graalvm.sdk</groupId>
<artifactId>graal-sdk</artifactId>
<version>${graal.version}</version>
</dependency>
<dependency>
<groupId>org.graalvm.regex</groupId>
<artifactId>regex</artifactId>
<version>${graal.version}</version>
</dependency>
<dependency> <!-- this must come AFTER the regex lib -->
<groupId>org.graalvm.js</groupId>
<artifactId>js</artifactId>
<version>${graal.version}</version>
</dependency>
<!-- GraalJS changelog says that com.ibm.icu/icu4j is not required for GraalJS >= 22.0.0 as it moved to org.graalvm.truffle;
but GraalJS >= 22.2.0 requires it, so we'll need to add it when we upgrade -->
</dependencies>
</project>