Skip to content

Commit 7ac0c85

Browse files
authored
Merge pull request #3944 from headius/java-wasm-maven-release
Prepare java-wasm artifact for release
2 parents 7820a5b + 21942dd commit 7ac0c85

12 files changed

Lines changed: 309 additions & 127 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
- "include/"
88
- "src/"
99
- "*akefile*"
10+
- "java/"
11+
- "java-wasm/"
1012
branches:
1113
- main
1214
- ruby-4.0

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +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
4546
/lib/prism/compiler.rb
4647
/lib/prism/dispatcher.rb
4748
/lib/prism/dot_visitor.rb

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ javascript/src/prism.wasm: Makefile $(SOURCES) $(HEADERS)
5454
java-wasm/src/test/resources/prism.wasm: Makefile $(SOURCES) $(HEADERS)
5555
$(ECHO) "building $@"
5656
$(Q) $(MAKEDIRS) $(@D)
57-
$(Q) $(WASI_SDK_PATH)/bin/clang $(DEBUG_FLAGS) -DPRISM_EXCLUDE_PRETTYPRINT -DPRISM_EXPORT_SYMBOLS -D_WASI_EMULATED_MMAN -lwasi-emulated-mman $(CPPFLAGS) $(JAVA_WASM_CFLAGS) -Wl,--export-all -Wl,--no-entry -mexec-model=reactor -lc++ -lc++abi -o $@ $(SOURCES)
57+
$(Q) $(WASI_SDK_PATH)/bin/clang \
58+
$(DEBUG_FLAGS) \
59+
-DPRISM_EXCLUDE_PRETTYPRINT -DPRISM_EXPORT_SYMBOLS -D_WASI_EMULATED_MMAN \
60+
-lwasi-emulated-mman $(CPPFLAGS) $(JAVA_WASM_CFLAGS) \
61+
-Wl,--export-all -Wl,--no-entry -mexec-model=reactor -lc++ -lc++abi \
62+
-o $@ $(SOURCES)
5863

5964
build/shared/%.o: src/%.c Makefile $(HEADERS)
6065
$(ECHO) "compiling $@"

java-wasm/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
This dir contains the chicory-prism artifact, a version of prism compiled to WASM and then AOT compiled to JVM bytecode by the Chicory project.
22

3+
## Building
4+
35
Generate the templated sources:
46

57
```
@@ -21,3 +23,7 @@ mvn -f java-wasm/pom.xml clean package
2123
This should build the chicory-wasm jar file and pass some basic tests.
2224

2325
The jar will be under `java-wasm/target/chicory-prism-#####-SNAPSHOT.jar` or can be installed by using `install` instead of `pacakge` in the `mvn` command line above.
26+
27+
## Releasing
28+
29+
Pass `-Prelease` to enable release plugins for Maven Central (optional for snapshots) and run the `deploy` target for `mvn`.

java-wasm/pom.xml

Lines changed: 91 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44

5-
<groupId>org.jruby</groupId>
6-
<artifactId>chicory-prism</artifactId>
5+
<groupId>org.ruby-lang</groupId>
6+
<artifactId>prism-parser</artifactId>
77
<version>0.0.1-SNAPSHOT</version>
88
<name>Java Prism</name>
9-
<description>Pure Java Prism using Chicory WASM runtime</description>
9+
<description>Java API for the Prism Ruby language parser</description>
1010

1111

1212
<properties>
@@ -15,7 +15,7 @@
1515
<maven.compiler.source>21</maven.compiler.source>
1616
<maven.compiler.target>21</maven.compiler.target>
1717

18-
<chicory.version>1.7.2</chicory.version>
18+
<chicory.version>1.7.3</chicory.version>
1919
<junit.version>6.0.3</junit.version>
2020
</properties>
2121

@@ -61,11 +61,72 @@
6161
</dependency>
6262
<dependency>
6363
<groupId>org.jruby</groupId>
64-
<artifactId>jruby-complete</artifactId>
65-
<version>10.0.3.0</version>
64+
<artifactId>jruby-stdlib</artifactId>
65+
<version>10.0.4.0</version>
66+
<scope>test</scope>
67+
</dependency>
68+
<dependency>
69+
<groupId>org.jruby</groupId>
70+
<artifactId>jruby-base</artifactId>
71+
<version>10.0.4.0</version>
72+
<scope>provided</scope>
6673
</dependency>
6774
</dependencies>
6875

76+
<profiles>
77+
<profile>
78+
<id>release</id>
79+
<build>
80+
<plugins>
81+
<plugin>
82+
<artifactId>maven-source-plugin</artifactId>
83+
<executions>
84+
<execution>
85+
<id>attach-sources</id>
86+
<goals>
87+
<goal>jar-no-fork</goal>
88+
</goals>
89+
</execution>
90+
</executions>
91+
</plugin>
92+
<plugin>
93+
<artifactId>maven-javadoc-plugin</artifactId>
94+
<executions>
95+
<execution>
96+
<id>attach-javadocs</id>
97+
<goals>
98+
<goal>jar</goal>
99+
</goals>
100+
</execution>
101+
</executions>
102+
<configuration>
103+
<doclint>none</doclint>
104+
</configuration>
105+
</plugin>
106+
<plugin>
107+
<artifactId>maven-gpg-plugin</artifactId>
108+
<version>3.2.4</version>
109+
<executions>
110+
<execution>
111+
<id>sign-artifacts</id>
112+
<phase>verify</phase>
113+
<goals>
114+
<goal>sign</goal>
115+
</goals>
116+
</execution>
117+
</executions>
118+
<configuration>
119+
<gpgArguments>
120+
<gpgArgument>--pinentry-mode</gpgArgument>
121+
<gpgArgument>loopback</gpgArgument>
122+
</gpgArguments>
123+
</configuration>
124+
</plugin>
125+
</plugins>
126+
</build>
127+
</profile>
128+
</profiles>
129+
69130
<build>
70131
<plugins>
71132
<plugin>
@@ -97,26 +158,26 @@
97158
</configuration>
98159
</plugin>
99160
<plugin>
100-
<groupId>org.apache.maven.plugins</groupId>
101-
<artifactId>maven-surefire-plugin</artifactId>
102-
<version>3.5.5</version>
161+
<groupId>org.apache.maven.plugins</groupId>
162+
<artifactId>maven-surefire-plugin</artifactId>
163+
<version>3.5.5</version>
103164
</plugin>
104165
<plugin>
105166
<groupId>org.codehaus.mojo</groupId>
106167
<artifactId>build-helper-maven-plugin</artifactId>
107168
<version>3.6.1</version>
108169
<executions>
109-
<execution>
110-
<phase>generate-sources</phase>
111-
<goals>
112-
<goal>add-source</goal>
113-
</goals>
114-
<configuration>
115-
<sources>
116-
<source>../java</source>
117-
</sources>
118-
</configuration>
119-
</execution>
170+
<execution>
171+
<phase>generate-sources</phase>
172+
<goals>
173+
<goal>add-source</goal>
174+
</goals>
175+
<configuration>
176+
<sources>
177+
<source>../java</source>
178+
</sources>
179+
</configuration>
180+
</execution>
120181
</executions>
121182
</plugin>
122183
<plugin>
@@ -130,12 +191,21 @@
130191
<goal>compile</goal>
131192
</goals>
132193
<configuration>
133-
<name>org.jruby.parser.prism.wasm.PrismParser</name>
194+
<name>org.ruby_lang.prism.wasm.PrismParser</name>
134195
<wasmFile>src/test/resources/prism.wasm</wasmFile>
135196
</configuration>
136197
</execution>
137198
</executions>
138199
</plugin>
200+
<plugin>
201+
<groupId>org.sonatype.central</groupId>
202+
<artifactId>central-publishing-maven-plugin</artifactId>
203+
<version>0.7.0</version>
204+
<extensions>true</extensions>
205+
<configuration>
206+
<publishingServerId>central</publishingServerId>
207+
</configuration>
208+
</plugin>
139209
</plugins>
140210
</build>
141211

java-wasm/src/main/java-templates/org/jruby/parser/prism/wasm/WasmResource.java renamed to java-wasm/src/main/java-templates/org/ruby_lang/prism/wasm/WasmResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.jruby.parser.prism.wasm;
1+
package org.ruby_lang.prism.wasm;
22

33
public final class WasmResource {
44
public static final String absoluteFile = "file://${project.basedir}/src/test/resources/prism.wasm";

java-wasm/src/main/java/org/jruby/parser/prism/wasm/Prism.java

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

0 commit comments

Comments
 (0)