1
声明当前没有gradle插件(https://jira.codehaus.org/browse/ENUNCIATE-815)。有什么办法可以手动触发Gradle的文档构建吗?如何在Gradle版本中生成声明文档
声明当前没有gradle插件(https://jira.codehaus.org/browse/ENUNCIATE-815)。有什么办法可以手动触发Gradle的文档构建吗?如何在Gradle版本中生成声明文档
我发现我需要提供各种JAX-RS JAR文件来通过命令行运行它时才能使用它。使用Gradle中的configurations.runtime.asPath属性非常简单,它通过了我在构建项目时已经解决的所有RESTEasy文物。
import org.apache.tools.ant.taskdefs.condition.Os
task enunciate(type:Exec) {
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
//on windows:
commandLine 'cmd', '/c',
'enunciate-1.29\\bin\\enunciate.bat -Edocs docs -f enunciate.xml -cp "' + configurations.runtime.asPath +
'" src/com/company/rest/RestApi.java'
} else {
//on linux
commandLine './enunciate-1.29/bin/enunciate -Edocs docs -f enunciate.xml -cp "' + configurations.runtime.asPath +
" src/com/company/rest/RestApi.java'
}
//store the output instead of printing to the console:
standardOutput = new ByteArrayOutputStream()
//extension method stopTomcat.output() can be used to obtain the output:
ext.output = {
return standardOutput.toString()
}
}
现在有一个声明2+的Gradle插件。请参阅https://github.com/stoicflame/enunciate-gradle – 2015-10-07 06:14:05