Skip to content

Commit 2fa9a38

Browse files
committed
Update README.md
1 parent 8f4c091 commit 2fa9a38

File tree

1 file changed

+53
-3
lines changed

1 file changed

+53
-3
lines changed

README.md

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,68 @@ Please refer to [Wiki](https://github.com/highsource/jsonix-schema-compiler/wiki
66

77
## Using in command-line
88

9+
Download `jsonix-schema-compiler-full-<VERSION>.jar` from [releases](https://github.com/highsource/jsonix-schema-compiler/releases) and run it with `java -jar` from the command line:
10+
911
```
10-
java -jar jsonix-schema-compiler-full.jar
12+
java -jar jsonix-schema-compiler-full-<VERSION>.jar
1113
[-compact -logLevel TRACE]
1214
schema.xsd
1315
[-b bindings.xjb]
1416
```
1517

1618
See [Command-Line Usage](https://github.com/highsource/jsonix-schema-compiler/wiki/Command-Line-Usage).
1719

20+
## Using with NPM
21+
22+
From the command line:
23+
24+
```
25+
npm install jsonix-schema-compiler
26+
java -jar node_modules/jsonix-schema-compiler/lib/jsonix-schema-compiler-full.jar schema.xsd
27+
```
28+
29+
Or add `jsonix-schema-compiler` as dependency and invoke in `scripts/prepublish`.
30+
31+
```json
32+
{
33+
"name": "mypackage",
34+
...
35+
"dependencies": {
36+
...
37+
"jsonix": "<VERSION>",
38+
"jsonix-schema-compiler": "<VERSION>"
39+
},
40+
"scripts": {
41+
...
42+
"prepublish" : "java -jar node_modules/jsonix/lib/jsonix-schema-compiler-full.jar schema.xsd"
43+
}
44+
}
45+
```
46+
47+
See [NPM Usage](https://github.com/highsource/jsonix-schema-compiler/wiki/NPM-Usage).
48+
1849
## Using with Ant
1950

20-
TBD
51+
* Include `jsonix-schema-compiler-plugin-<VERSION>.jar` into `xjc/classpath`.
52+
* Include `-Xjsonix` and further `-Xjsonix-...` [[command-line options|Command-Line usage]] into `arg/@line`.
53+
54+
```xml
55+
<xjc destdir="${basedir}/target/generated-sources/xjc" extension="true">
56+
<arg line="-Xjsonix -Xjsonix-compact"/>
57+
<binding dir="${basedir}/src/main/resources">
58+
<include name="**/*.xjb"/>
59+
</binding>
60+
<schema dir="${basedir}/src/main/resources">
61+
<include name="**/*.xsd"/>
62+
</schema>
63+
<!-- Plugins -->
64+
<classpath>
65+
<fileset dir="${basedir}/lib">
66+
<include name="jsonix-*.jar"/>
67+
</fileset>
68+
</classpath>
69+
</xjc>
70+
```
2171

2272
See [Ant Usage](https://github.com/highsource/jsonix-schema-compiler/wiki/Ant-Usage).
2373

@@ -44,4 +94,4 @@ See [Ant Usage](https://github.com/highsource/jsonix-schema-compiler/wiki/Ant-Us
4494
</plugin>
4595
```
4696

47-
See [Maven Usage](https://github.com/highsource/jsonix-schema-compiler/wiki/Maven-Usage).
97+
See [Maven Usage](https://github.com/highsource/jsonix-schema-compiler/wiki/Maven-Usage).

0 commit comments

Comments
 (0)