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