Created
October 15, 2019 21:04
-
-
Save sainnr/2ebb3eebb179bbb01cb75077e3f15858 to your computer and use it in GitHub Desktop.
wsimport with SBT
This file contains hidden or 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
lazy val wsdlImport = TaskKey[Unit]("wsdlImport", "Generates Java classes from WSDL") | |
wsdlImport := { | |
val wsdlSources = "./wsdl/src/main/java" | |
val d = file(wsdlSources) | |
if (d.isDirectory) { | |
// don't forget to rename to your fav one in line with WSDL generating sh | |
val gen = file(s"$wsdlSources/github/sainnr/wsdl") | |
if (!gen.exists() || gen.listFiles().isEmpty) { | |
import sys.process._ | |
println("[wsdl_import] Importing Java beans from WSDL...") | |
"./wsdl/bin/wsdl_import.sh" ! | |
} else | |
println("[wsdl_import] Looks like WSDL is already imported, skipping.") | |
} else | |
println(s"[wsdl_import] Make sure the directory ${d.absolutePath} exists.") | |
} | |
(compile in Compile) := ((compile in Compile) dependsOn wsdlImport).value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment