Skip to content

Commit

Permalink
Issue #11.
Browse files Browse the repository at this point in the history
  • Loading branch information
highsource committed Dec 24, 2014
1 parent 66b35ba commit 016a944
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 0 deletions.
1 change: 1 addition & 0 deletions npm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib
2 changes: 2 additions & 0 deletions npm/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules
pom.xml
40 changes: 40 additions & 0 deletions npm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Jsonix Schema Compiler

Generates [Jsonix](https://github.com/highsource/jsonix) mappings for XML Schemas.

Please refer to [Wiki](https://github.com/highsource/jsonix-schema-compiler/wiki) for documentation.

This package provides the Jsonix Schema Compiler (under `lib/jsonix-schema-compiler-full.jar`).
So you can invoke the schema compiler via [[command line|Command-Line Usage]] as follows:

```
java -jar node_modules/jsonix-schema-compiler/lib/jsonix-schema-compiler-full.jar schema.xsd
```

# Usage

Typical usage is as follows:

* Make your package depend on `jsonix-schema-compiler`.
* Invoke the Jsonix Schema Compiler in the `scripts/preinstall`

## Example

```javascript
{
"name": "mypackage",
...
"dependencies": {
...
"jsonix-schema-compiler": "~<VERSION>"
...
},
...
"scripts": {
...
"preinstall" : "java -jar node_modules/jsonix-schema-compiler/lib/jsonix-schema-compiler-full.jar schema.xsd"
...
}
...
}
```
1 change: 1 addition & 0 deletions npm/jsonix-schema-compiler.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// No JavaScript here as the sole purpose of this package is to provide lib/jsonix-schema-compiler-full.jar
37 changes: 37 additions & 0 deletions npm/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name" : "jsonix-schema-compiler",
"version" : "2.3.1",
"description" : "Jsonix Schema Compiler generates Jsonix mappings from XML Schemas",
"keywords" : [
"json", "xml", "unmarshal", "unmarshalling", "marshal",
"marshalling", "parse", "parsing", "serialize", "serializing",
"javascript objects", "dom", "util", "utility", "jaxb",
"jsonix", "jsonix-schema-compiler",
"xs", "xsd", "xml schema", "wsdl", "dtd", "relax ng", "relaxng", "relax ng compact", "relaxng compact"
],
"homepage" : "https://github.com/highsource/jsonix-schema-compiler",
"bugs" : {
"url" : "http://github.com/highsource/jsonix-schema-compiler/issues"
},
"repository": {
"type": "git",
"url": "git://github.com/highsource/jsonix-schema-compiler.git"
},
"licenses" : [ {
"type" : "BSD-3-Clause",
"url" : "http://github.com/highsource/jsonix-schema-compiler/raw/master/LICENSE"
} ],
"author" : {
"name" : "Alexey Valikov",
"url" : "http://github.com/highsource"
},
"contributors" : [ {
"name" : "Conrad Pankoff",
"url" : "https://github.com/deoxxa"
} ],
"main" : "jsonix-schema-compiler.js",
"repository" : {
"type" : "git",
"url" : "http://github.com/highsource/jsonix-schema-compiler.git"
}
}
66 changes: 66 additions & 0 deletions npm/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>jsonix-schema-compiler-npm</artifactId>
<packaging>pom</packaging>
<name>Jsonix Schema Compiler NPM Package</name>
<parent>
<groupId>org.hisrc.jsonix</groupId>
<artifactId>jsonix-schema-compiler-project</artifactId>
<version>2.3.1-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>jsonix-schema-compiler-full</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>unpack</id>
<phase>generate-sources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>jsonix-schema-compiler-full</artifactId>
<version>${jsonix-schema-compiler.version}</version>
<overWrite>true</overWrite>
<outputDirectory>${basedir}/lib</outputDirectory>
<destFileName>jsonix-schema-compiler-full.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<arguments>
<argument>install</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 016a944

Please sign in to comment.