[英]How to set Gradle custom ant task classpath?
我在我的代碼庫中有一個自定義Ant任務,我需要在Gradle中使用它。 有很多關於如何使用打包在jar文件中的任務的示例,但這是不同的。
我的taskdef
應該類似於:
ant.taskdef(
name: 'generator',
classname: 'MyGenerator',
classpath: ???
)
在classpath
中應包括一切bin/
(其中我的代碼被編譯到),並在列出的所有罐子dependencies
構建腳本的部分。 如何填空?
我嘗試了一些不同的東西,導致像The <taskdef> type doesn't support nested text data
或典型的NoClassDefFoundError
這樣The <taskdef> type doesn't support nested text data
模糊消息。
正如Perryn Fowler所寫,您應該聲明一個configuration
和dependencies
部分。 這是我發現的一個例子: https : //github.com/openbakery/gradle-common-plugins/blob/master/webdav.gradle
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.