Skip to content

Commit a3a99c4

Browse files
committed
2 parents 0d848b5 + 2fa9a38 commit a3a99c4

File tree

4 files changed

+59
-5
lines changed

4 files changed

+59
-5
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.classpath
2+
.project
3+
.settings/
4+

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).

compiler/src/test/java/org/hisrc/jsonix/xml/xsom/tests/MultiplicityCounterElementRef01Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class MultiplicityCounterElementRef01Test {
2121
@Before
2222
public void loadModel() throws Exception {
2323
model = MModelInfoLoader.INSTANCE
24-
.loadModel("jsonschema/minmaxoccurs/elementref01.xsd");
24+
.loadModel("jsonschema/minmaxoccurs/elementRef01.xsd");
2525
}
2626

2727
@Test

compiler/src/test/java/org/hisrc/jsonix/xml/xsom/tests/MultiplicityCounterElementRefs01Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class MultiplicityCounterElementRefs01Test {
2121
@Before
2222
public void loadModel() throws Exception {
2323
model = MModelInfoLoader.INSTANCE
24-
.loadModel("jsonschema/minmaxoccurs/elementrefs01.xsd");
24+
.loadModel("jsonschema/minmaxoccurs/elementRefs01.xsd");
2525
}
2626

2727
@Test

0 commit comments

Comments
 (0)