Skip to content

Commit 5de818c

Browse files
committed
Create WEBIMAGE_PREVIEW distribution in sdk
Replaces the SVM_WASM_API distribution and is included automatically on the boot classpath
1 parent 807fc81 commit 5de818c

File tree

6 files changed

+90
-35
lines changed

6 files changed

+90
-35
lines changed

sdk/mx.sdk/mx_sdk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def upx(args):
159159
third_party_license_files=[],
160160
dependencies=['sdkc'],
161161
jar_distributions=[],
162-
boot_jars=['sdk:NATIVEIMAGE', 'sdk:NATIVEIMAGE_LIBGRAAL'],
162+
boot_jars=['sdk:NATIVEIMAGE', 'sdk:NATIVEIMAGE_LIBGRAAL', 'sdk:WEBIMAGE_PREVIEW'],
163163
stability="supported",
164164
)
165165
mx_sdk_vm.register_graalvm_component(graalvm_sdk_native_image_component)

sdk/mx.sdk/suite.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,16 @@
456456
"javaCompliance" : "21+"
457457
},
458458

459+
"org.graalvm.webimage.api": {
460+
"subDir": "src",
461+
"sourceDirs": ["src"],
462+
"dependencies": [],
463+
"javaCompliance": "21+",
464+
"spotbugs": "true",
465+
"workingSets": "SDK",
466+
"checkstyle": "org.graalvm.word",
467+
},
468+
459469
"com.oracle.svm.core.annotate" : {
460470
"subDir" : "src",
461471
"sourceDirs" : ["src"],
@@ -906,6 +916,25 @@ class UniversalDetector {
906916
},
907917
},
908918

919+
"WEBIMAGE_PREVIEW": {
920+
"subDir": "src",
921+
"dependencies": [
922+
"org.graalvm.webimage.api",
923+
],
924+
"distDependencies": [],
925+
"moduleInfo": {
926+
"name": "org.graalvm.webimage.api",
927+
"exports": [
928+
"org.graalvm.webimage.api",
929+
],
930+
},
931+
"description": "The JavaScript interoperability API for GraalVM Web Image. This API is currently in preview and subject to change at any time.",
932+
"maven": {
933+
"artifactId": "webimage-preview",
934+
"tag": ["default", "public"],
935+
},
936+
},
937+
909938
"POLYGLOT_VERSION": {
910939
"type": "dir",
911940
"platformDependent": False,
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[[rule]]
2+
files = "*"
3+
all = [
4+
5+
6+
7+
]
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* The Universal Permissive License (UPL), Version 1.0
6+
*
7+
* Subject to the condition set forth below, permission is hereby granted to any
8+
* person obtaining a copy of this software, associated documentation and/or
9+
* data (collectively the "Software"), free of charge and under any and all
10+
* copyright rights in the Software, and any and all patent rights owned or
11+
* freely licensable by each licensor hereunder covering either (i) the
12+
* unmodified Software as contributed to or provided by such licensor, or (ii)
13+
* the Larger Works (as defined below), to deal in both
14+
*
15+
* (a) the Software, and
16+
*
17+
* (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
18+
* one is included with the Software each a "Larger Work" to which the Software
19+
* is contributed by such licensors),
20+
*
21+
* without restriction, including without limitation the rights to copy, create
22+
* derivative works of, display, perform, and distribute the Software and make,
23+
* use, sell, offer for sale, import, export, have made, and have sold the
24+
* Software and the Larger Work(s), and to sublicense the foregoing rights on
25+
* either these or other terms.
26+
*
27+
* This license is subject to the following condition:
28+
*
29+
* The above copyright notice and either this complete permission notice or at a
30+
* minimum a reference to the UPL must be included in all copies or substantial
31+
* portions of the Software.
32+
*
33+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
38+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
39+
* SOFTWARE.
40+
*/
41+
/**
42+
* This package provides an interface between Java code and the embedding JavaScript code.
43+
* <p>
44+
* This functionality is limited to the WebAssembly backend for Native Image.
45+
* <p>
46+
* Any functionality specified here is experimental, subject to change, and may not fully work yet.
47+
*
48+
* @since 25.0
49+
*/
50+
package org.graalvm.webimage.api;

web-image/mx.web-image/mx_web_image.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
web_image_builder = "web-image:SVM_WASM"
5959
web_image_builder_jars = [
6060
web_image_builder,
61-
"web-image:SVM_WASM_API",
6261
"web-image:SVM_WASM_JIMFS",
6362
"web-image:SVM_WASM_GUAVA",
6463
"web-image:WEBIMAGE_CLOSURE_SUPPORT",
@@ -472,7 +471,7 @@ def get_launcher_flags(names: [str], cp_suffix: str = None) -> [str]:
472471
(distributions, projects) with web image.
473472
474473
Many internal distributions directly or indirectly depend on jars in the image builder itself
475-
(e.g. svm-wasm-api.jar), which cannot be passed to the launcher again.
474+
(e.g. svm-wasm.jar), which cannot be passed to the launcher again.
476475
Because of that we omit all the flags required for the image builder jars and their dependencies (since the image
477476
builder will already have the proper paths set up for those).
478477
@@ -753,7 +752,6 @@ def create_web_image_macro_builder(
753752
priority=0,
754753
builder_jar_distributions=[
755754
"web-image:SVM_WASM",
756-
"web-image:SVM_WASM_API",
757755
"web-image:SVM_WASM_JIMFS",
758756
"web-image:SVM_WASM_GUAVA",
759757
],

web-image/mx.web-image/suite.py

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"compiler:GRAAL",
9090
"substratevm:SVM",
9191
"substratevm:SVM_CONFIGURE",
92-
"org.graalvm.webimage.api",
92+
"sdk:WEBIMAGE_PREVIEW",
9393
"SVM_WASM_JIMFS",
9494
],
9595
"requires": [
@@ -116,17 +116,6 @@
116116
"spotbugsIgnoresGenerated": True,
117117
"checkPackagePrefix": False,
118118
},
119-
"org.graalvm.webimage.api": {
120-
"subDir": "src",
121-
"sourceDirs": ["src"],
122-
"dependencies": [],
123-
"javaCompliance": "21+",
124-
"spotbugs": "true",
125-
"workingSets": "web-image",
126-
"annotationProcessors": ["compiler:GRAAL_PROCESSOR"],
127-
"checkstyle": "com.oracle.svm.webimage",
128-
"spotbugsIgnoresGenerated": True,
129-
},
130119
"com.oracle.svm.webimage.tools": {
131120
"subDir": "src",
132121
"sourceDirs": [
@@ -160,7 +149,6 @@
160149
"sourceDirs": ["src"],
161150
"dependencies": [
162151
"substratevm:SVM",
163-
"SVM_WASM_API",
164152
"WEBIMAGE_LIBRARY_SUPPORT",
165153
"mx:JUNIT",
166154
"NET_JAVA_HTML",
@@ -281,15 +269,14 @@
281269
],
282270
"distDependencies": [
283271
"substratevm:SVM",
284-
"SVM_WASM_API",
272+
"sdk:WEBIMAGE_PREVIEW",
285273
"SVM_WASM_JIMFS",
286274
],
287275
"moduleInfo": {
288276
"name": "org.graalvm.extraimage.builder",
289277
"requires": [
290278
"org.graalvm.nativeimage.pointsto",
291279
"org.graalvm.nativeimage.builder",
292-
"org.graalvm.webimage.api",
293280
"org.graalvm.collections",
294281
],
295282
"opens": [
@@ -307,20 +294,6 @@
307294
},
308295
"maven": False,
309296
},
310-
"SVM_WASM_API": {
311-
"subDir": "src",
312-
"dependencies": [
313-
"org.graalvm.webimage.api",
314-
],
315-
"distDependencies": [],
316-
"moduleInfo": {
317-
"name": "org.graalvm.webimage.api",
318-
"exports": [
319-
"org.graalvm.webimage.api",
320-
],
321-
},
322-
"maven": False,
323-
},
324297
"NATIVE_IMAGE_WASM_SUPPORT": {
325298
"native": True,
326299
"description": "Macro for the Native Image Wasm Backend",
@@ -349,7 +322,6 @@
349322
"requires": [
350323
"jdk.graal.compiler",
351324
"org.graalvm.nativeimage.builder",
352-
"org.graalvm.webimage.api",
353325
],
354326
},
355327
},
@@ -413,7 +385,6 @@
413385
"com.oracle.svm.webimage.jtt",
414386
],
415387
"distDependencies": [
416-
"SVM_WASM_API",
417388
"WEBIMAGE_LIBRARY_SUPPORT",
418389
],
419390
"exclude": [

0 commit comments

Comments
 (0)