-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support grouping XSDs with different configurations (e.g. package names)
- Loading branch information
1 parent
8ed6b82
commit a237b0b
Showing
21 changed files
with
297 additions
and
98 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
plugins { | ||
base | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
org.gradle.jvmargs=-Dfile.encoding=UTF-8 | ||
org.gradle.warning.mode=fail | ||
org.gradle.priority=low |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
include( | ||
"test-producer-2x", | ||
"test-producer-3x", | ||
"test-consumer-2x", | ||
"test-consumer-3x" | ||
"test-producer-2x", | ||
"test-producer-3x", | ||
"test-producer-3x-grouped", | ||
"test-consumer-2x", | ||
"test-consumer-3x" | ||
) | ||
|
||
includeBuild("..") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ plugins { | |
} | ||
|
||
repositories { | ||
jcenter() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ plugins { | |
} | ||
|
||
repositories { | ||
jcenter() | ||
mavenCentral() | ||
} | ||
|
||
xjc { | ||
|
33 changes: 33 additions & 0 deletions
33
integration-test/test-producer-3x-grouped/build.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
plugins { | ||
id("com.github.bjornvester.xjc") | ||
id("com.github.bjornvester.xjc.internal.java-conventions") | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation(project(":test-producer-3x")) | ||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.1") | ||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.1") | ||
} | ||
|
||
tasks.test { | ||
useJUnitPlatform() | ||
} | ||
|
||
xjc { | ||
xjcVersion.set("3.0.0") | ||
|
||
groups { | ||
register("group1") { | ||
xsdFiles = files(xsdDir.file("MySchemaWithFunnyChar.xsd")) | ||
defaultPackage.set("com.example.group1") | ||
} | ||
register("group2") { | ||
xsdFiles = files(xsdDir.file("MySchemaWithFunnyChar.xsd")) | ||
defaultPackage.set("com.example.group2") | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
integration-test/test-producer-3x-grouped/src/main/resources/MyIgnoredElement.xsd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" | ||
xmlns:tsk="http://github.com/bjornvester/producer" | ||
targetNamespace="http://github.com/bjornvester/producer" | ||
elementFormDefault="qualified" | ||
version="1.0"> | ||
<xs:include schemaLocation="MySchemaWithSimpleType.xsd"/> | ||
<xs:element name="MyIgnoredElement"> | ||
<xs:complexType> | ||
<xs:sequence> | ||
<xs:element ref="tsk:MyDate"/> | ||
</xs:sequence> | ||
</xs:complexType> | ||
</xs:element> | ||
</xs:schema> |
15 changes: 15 additions & 0 deletions
15
integration-test/test-producer-3x-grouped/src/main/resources/MySchemaWithFunnyChar.xsd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" | ||
xmlns:tsk="http://github.com/bjornvester/producer" | ||
targetNamespace="http://github.com/bjornvester/producer" | ||
elementFormDefault="qualified" | ||
version="1.0"> | ||
<xs:include schemaLocation="MySchemaWithSimpleType.xsd"/> | ||
<xs:element name="MyElementØ"> | ||
<xs:complexType> | ||
<xs:sequence> | ||
<xs:element ref="tsk:MyDate"/> | ||
</xs:sequence> | ||
</xs:complexType> | ||
</xs:element> | ||
</xs:schema> |
12 changes: 12 additions & 0 deletions
12
integration-test/test-producer-3x-grouped/src/main/resources/MySchemaWithSimpleType.xsd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" | ||
xmlns:tsk="http://github.com/bjornvester/producer" | ||
targetNamespace="http://github.com/bjornvester/producer" | ||
elementFormDefault="qualified" | ||
version="1.0"> | ||
<xs:element name="MyDate" type="tsk:MyDateType"> | ||
</xs:element> | ||
<xs:simpleType name="MyDateType"> | ||
<xs:restriction base="xs:dateTime"/> | ||
</xs:simpleType> | ||
</xs:schema> |
11 changes: 11 additions & 0 deletions
11
...ation-test/test-producer-3x-grouped/src/test/java/com/github/bjornvester/xjc/XjcTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.github.bjornvester.xjc; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
class XjcTest { | ||
@Test | ||
void testXjc() { | ||
new com.example.group1.ObjectFactory().createMyElementØ(); | ||
new com.example.group2.ObjectFactory().createMyElementØ(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ plugins { | |
} | ||
|
||
repositories { | ||
jcenter() | ||
mavenCentral() | ||
} | ||
|
||
xjc { | ||
|
Oops, something went wrong.