我正在按照下面的教程使用Gradle生成Xsd2Java
https://github.com/nilsmagnus/wsdl2java
我想知道如何将命令行参数传递给ant.xjc任务。
这是我的示例,但似乎没有使用我的3参数([extension:true],[value:'-Xtbs'])
xsd2java {
def contractDir = "$buildDir/extractedContracts"
File perContract = new File("$contractDir/Enterprise.xsd")
File adContract = new File("$contractDir/AdFpc.xsd")
File adListContract = new File("$contractDir/AdListData.xsd")
xsdsToGenerate = [
[file("$perContract"), 'com.performance.contract',[extension: true], [ value: '-Xtbs']],
[file("$adContract"), 'ad.contract',[extension: true],[value: '-Xtbs']],
[file("$adListContract"), 'ad.list.contract',[extension: true], [value: '-Xtbs']],
]
generatedXsdDir = file(project.ext.generatedSrcDir)
}
-xtbs生成toString,哈希码和equals方法
有没有人对xsd2java有任何建议或示例
谢谢
最佳答案
I would like to know how can i pass command line argument to ant.xjc task.
在description of the ant-task for xjc中,您可以找到以下引号:
arg
Additional command line arguments passed to the XJC. For details about the syntax, see the relevant section in the Ant manual. This nested element can be used to specify various options not natively supported in the xjc Ant task. For example, currently there is no native support for the following xjc command-line options:
- nv
- use-runtime
- schema
- dtd
- relaxng
- Xlocator
- Xsync-methods
在上面提到的relevant section中,有足够的示例说明了如何执行此操作。
关于gradle - xsd2java-no.nils.wsdl2java,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32576968/