Skip to content

Commit 03358d5

Browse files
committed
Begin splitting the Java artifact into components
* The Loader API lives under java/api. * The current native endpoint for the Prism shared library lives under java/native. * The WASM build and binding lives under java/wasm. The libraries will be released together but can be developed and snapshotted independently. Users that copy the source from the previous java/ will want to grab both java/api/src/main/java and java/native/src/main/java contents.
1 parent 0fda21c commit 03358d5

33 files changed

Lines changed: 14433 additions & 252 deletions

File tree

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ updates:
99
patterns:
1010
- "*"
1111
- package-ecosystem: 'maven'
12-
directory: '/java-wasm'
12+
directory: '/java/wasm'
1313
schedule:
1414
interval: 'weekly'
1515
groups:

.github/workflows/java-wasm-bindings.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- "src/"
99
- "*akefile*"
1010
- "java/"
11-
- "java-wasm/"
11+
- "java/wasm/"
1212
branches:
1313
- main
1414
- ruby-4.0
@@ -46,9 +46,9 @@ jobs:
4646

4747
- name: Run the tests
4848
run: mvn -B install
49-
working-directory: java-wasm
49+
working-directory: java/wasm
5050

5151
- uses: actions/upload-artifact@v7
5252
with:
5353
name: prism.wasm
54-
path: java-wasm/src/test/resources/prism.wasm
54+
path: java/wasm/src/test/resources/prism.wasm

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ out.svg
4242
/java/org/ruby_lang/prism/AbstractNodeVisitor.java
4343
/java/org/ruby_lang/prism/Loader.java
4444
/java/org/ruby_lang/prism/Nodes.java
45-
/java-wasm/src/test/resources/prism.wasm
45+
/java/wasm/src/test/resources/prism.wasm
4646
/lib/prism/compiler.rb
4747
/lib/prism/dispatcher.rb
4848
/lib/prism/dot_visitor.rb

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ all: shared static
3131
shared: build/libprism.$(SOEXT)
3232
static: build/libprism.a
3333
wasm: javascript/src/prism.wasm
34-
java-wasm: java-wasm/src/test/resources/prism.wasm
34+
java-wasm: java/wasm/src/test/resources/prism.wasm
3535

3636
build/libprism.$(SOEXT): $(SHARED_OBJECTS)
3737
$(ECHO) "linking $@ with $(CC)"
@@ -51,7 +51,7 @@ javascript/src/prism.wasm: Makefile $(SOURCES) $(HEADERS)
5151
-Oz -g0 -flto -fdata-sections -ffunction-sections \
5252
-o $@ $(SOURCES)
5353

54-
java-wasm/src/test/resources/prism.wasm: Makefile $(SOURCES) $(HEADERS)
54+
java/wasm/src/test/resources/prism.wasm: Makefile $(SOURCES) $(HEADERS)
5555
$(ECHO) "building $@"
5656
$(Q) $(MAKEDIRS) $(@D)
5757
$(Q) $(WASI_SDK_PATH)/bin/clang \

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ The repository contains the infrastructure for both a shared library (libprism)
2929
├── include
3030
│   ├── prism header files for the shared library
3131
│   └── prism.h main header file for the shared library
32-
├── java Java bindings for the shared library
33-
├── java-wasm Java WASM bindings for the shared library
32+
├── java
33+
| ├── api Java API for Prism
34+
| ├── native Java native bindings for the shared library
35+
| └── wasm Java WASM bindings for the shared library
3436
├── javascript JavaScript WASM bindings for the shared library
3537
├── lib
3638
│   ├── prism Ruby library files

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ end
5454
CLOBBER.concat(Prism::Template::TEMPLATES)
5555
CLOBBER.concat(["build"])
5656
CLOBBER << "lib/prism/prism.#{RbConfig::CONFIG["DLEXT"]}"
57-
CLOBBER << "java-wasm/src/main/resources/prism.wasm"
57+
CLOBBER << "java/wasm/src/main/resources/prism.wasm"
5858

5959
Prism::Template::TEMPLATES.each do |filepath|
6060
desc "Generate #{filepath}"

java-wasm/pom.xml

Lines changed: 0 additions & 236 deletions
This file was deleted.

java/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
api/target
2+
native/target
3+
wasm/target
4+
.idea

java/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Prism Java API and bindings
2+
3+
This is the top-level project for the Java API and backend bindings for the Prism Ruby language parser.
4+
5+
* api/ contains the API
6+
* native/ contains a native binding for the Prism shared library
7+
* wasm/ contains a Chicory-based WASM build and binding
8+
9+
## Updating versions
10+
11+
Run the following command to update all module versions:
12+
13+
```
14+
mvn versions:set -DnewVersion=1.2.3-SNAPSHOT
15+
```
16+
17+
## Releasing
18+
19+
Snapshots can be deployed with `mvn deploy` while the versions are `-SNAPSHOT`.
20+
21+
When releasing to Maven Central, all projects should be released together using the `release` profile:
22+
23+
```
24+
mvn clean deploy -Prelease
25+
```

0 commit comments

Comments
 (0)