Hi. I'm new to gradle but trying use it with kotli...
# gradle
a
Hi. I'm new to gradle but trying use it with kotlin DSL. Currently I have troubles with a lot of samples written for groovy config -- I can't translate them proper (probably because of lack of gradle experience). I'm trying to configure spring boot wsdl sample with kotlin dsl. I refer to official guide https://spring.io/guides/gs/producing-web-service/ as well as kotlin-dsl/samples/ant. I also found https://github.com/jacobono/gradle-jaxb-plugin that probably should simplify my config, but its samples are again for groovy config and I'm failing to translate to kotlin. Can anyone recommend the learning curve for starting using of kotlin DSL? kotlin-dsl project has a readme on plugin configuration but still it seems not to be enough for me. I'm not asking the solution for my original task, but some piece of advice how can I develop it. Thanks!
c
There are several good sources. I'll list them in the order I tend to utilize them. 1. Samples - https://github.com/gradle/kotlin-dsl/tree/master/samples 2. Google specific thing (intent or problem), search through stackoverflow 3. look through several kdsl releases' notes. 4. ask specific question here in slack.
n
I have been battling exactly the same issues in the last couple of days. In the end I have just re-written my old ant script in gradle-kotlin-dsl and it is actually quite effective:
Copy code
ant.withGroovyBuilder {
          "mkdir"("dir" to generatedJavaDir.toString())
          "taskdef"("name" to "xjc", "classname" to "com.sun.tools.xjc.XJC2Task", "classpath" to xjc.asPath)
          "xjc"("destdir" to generatedJavaDir.toString(), "package" to pkg) {
            "schema"("dir" to xsdDir.toString(), "includes" to "*.xsd")
            "arg"("value" to "-XautoNameResolution")
          }
        }