小编mak*_*112的帖子

从 xsd 生成 kotlin 类

有一个 xsd 架构。需要根据 xsd 描述生成 Kotlin 类。我怎样才能做到这一点?使用下面的代码,我可以获得java类。但我需要 kotlin 课程

plugins {
    id 'org.jetbrains.kotlin.jvm' version '1.3.21'
    // Apply the application plugin to add support for building a CLI application.
    id 'application'
    /* Generate Java code from XSD */
    id 'org.unbroken-dome.xjc' version '1.4.3'
}
group 'org.example'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
xjc {
    includeInMainCompilation = false
}
xjcGenerate {
    source = fileTree('src/main/schema') { include '*.xsd' }
    bindingFiles = fileTree('src/main/jaxb') { include '*.xjb' }
    catalogs = fileTree('src/main/catalog') { include '*.cat' }
}
sourceSets …
Run Code Online (Sandbox Code Playgroud)

xsd kotlin

6
推荐指数
1
解决办法
5024
查看次数

标签 统计

kotlin ×1

xsd ×1