Skip to content

Commit 0400230

Browse files
committed
Move Java wrapper build instructions into the project README
Fixes #6.
1 parent 71fd598 commit 0400230

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,18 @@ A specific compiler can be chosen by setting the CC argument for example:
103103

104104
make CC=clang
105105

106+
107+
#### Development targets
108+
106109
There are a number of other targets that are useful for library development
107110
purposes:
108111

109112
make test [SANITIZE=yes] # Run the unit test suite, optionally building using LLVM sanitizers.
110113
make fuzzer # Build fuzzers for exercising the individual encoders. Requires LLVM libfuzzer.
111114

115+
116+
#### JavaScript / WASM build
117+
112118
The WASM build artifacts can be generated by first installing and activating
113119
the Emscripten SDK and then running:
114120

@@ -120,6 +126,24 @@ launched from the project home directory with:
120126
docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) emscripten/emsdk make -C src/c-lib wasm [JSONLY=yes]
121127

122128

129+
#### Java wrapper
130+
131+
The Java wrapper for the Syntax Engine can be built by first compiling the
132+
Syntax Engine C library as a static library, and then building the wrapper
133+
itself:
134+
135+
make -C src/c-lib -j `nproc` libstatic
136+
ant -f src/java/build.xml test
137+
138+
To use the wrapper in a Java project it is sufficient to place the generated
139+
`src/java/libgs1encoders.{jar,so}` files into accessible locations, then:
140+
141+
* At compile time and runtime, add the .jar file into the project's
142+
classpath.
143+
* At runtime, add the directory containing the .so file into
144+
`java.library.path`.
145+
146+
123147
Installing the Pre-built Demo Console Application
124148
-------------------------------------------------
125149

src/java/build.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1515
See the License for the specific language governing permissions and
1616
limitations under the License.
1717
18-
19-
This solution builds a JNI library (.jar and .so files) that wraps the GS1
20-
Syntax Engine.
21-
22-
It is sufficient to place the built libgs1encoders.{jar,so} files into
23-
accessible locations, then at runtime:
24-
25-
- Add the .jar file into the classpath.
26-
- Add the directory containing the .so file into java.library.path.
27-
2818
-->
2919

3020
<project name="gs1encoders" default="all" basedir="." xmlns:if="ant:if" xmlns:unless="ant:unless">

0 commit comments

Comments
 (0)