Skip to content

Commit a98ab82

Browse files
authored
Merge pull request #4031 from headius/split-maven-artifacts
Split maven artifacts into component libraries
2 parents 934b98a + 1f824a8 commit a98ab82

File tree

36 files changed

+423
-288
lines changed

36 files changed

+423
-288
lines changed

.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/documentation.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ jobs:
3636
- name: Check C coverage
3737
run: doxygen Doxyfile
3838
- name: Check Java coverage
39-
run: javadoc -Xdoclint:all,-missing -d ../doc/java -subpackages *
40-
working-directory: java
39+
run: javadoc -Xdoclint:all,-missing -d doc/java -sourcepath java/api/target/generated-sources/java/:java/api/src/main/java org.ruby_lang.prism
4140
- name: Generate Rust documentation
4241
run: |
4342
bundle exec rake cargo:build

.github/workflows/github-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
run: doxygen Doxyfile
5353
- name: Build with JavaDoc
5454
run: javadoc -Xdoclint:all,-missing -d ../doc/java -subpackages *
55-
working-directory: java
55+
working-directory: java/api
5656
- name: Build with rustdoc
5757
run: |
5858
bundle exec rake cargo:build

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

Lines changed: 9 additions & 5 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
@@ -44,11 +44,15 @@ jobs:
4444
java-version: '21'
4545
cache: maven
4646

47-
- name: Run the tests
48-
run: mvn -B install
49-
working-directory: java-wasm
47+
- name: Build the Java artifacts
48+
run: mvn -ntp install
49+
working-directory: java
50+
51+
- name: Run the tests from the WASM module
52+
run: mvn -ntp test
53+
working-directory: java
5054

5155
- uses: actions/upload-artifact@v7
5256
with:
5357
name: prism.wasm
54-
path: java-wasm/src/test/resources/prism.wasm
58+
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ elsif RUBY_ENGINE == "jruby"
4343
# This compiles java to make sure any templating changes produces valid code.
4444
Rake::JavaExtensionTask.new(:compile) do |ext|
4545
ext.name = "prism"
46-
ext.ext_dir = "java"
46+
ext.ext_dir = "java/api"
4747
ext.lib_dir = "tmp"
4848
ext.release = "21"
4949
ext.gem_spec = Gem::Specification.load("prism.gemspec")
@@ -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}"

docs/configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ A lot of code in prism's repository is templated from a single configuration fil
88
* `include/prism/node_new.h` - for defining the functions that create the nodes in C
99
* `javascript/src/deserialize.js` - for defining how to deserialize the nodes in JavaScript
1010
* `javascript/src/nodes.js` - for defining the nodes in JavaScript
11-
* `java/org/ruby_lang/prism/AbstractNodeVisitor.java` - for defining the visitor interface for the nodes in Java
12-
* `java/org/ruby_lang/prism/Loader.java` - for defining how to deserialize the nodes in Java
13-
* `java/org/ruby_lang/prism/Nodes.java` - for defining the nodes in Java
11+
* `java/api/target/generated-sources/java/org/ruby_lang/prism/AbstractNodeVisitor.java` - for defining the visitor interface for the nodes in Java
12+
* `java/api/target/generated-sources/java/org/ruby_lang/prism/Loader.java` - for defining how to deserialize the nodes in Java
13+
* `java/api/target/generated-sources/java/org/ruby_lang/prism/Nodes.java` - for defining the nodes in Java
1414
* `lib/prism/compiler.rb` - for defining the compiler for the nodes in Ruby
1515
* `lib/prism/dispatcher.rb` - for defining the dispatch visitors for the nodes in Ruby
1616
* `lib/prism/dot_visitor.rb` - for defining the dot visitor for the nodes in Ruby

java-wasm/README.md

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

0 commit comments

Comments
 (0)