4
搖籃1.11給我一個棄用警告:搖籃1.1 VS 2.0:無法確定任務的依賴關係 ':compileAcctJava'
[email protected]:~/prj> gradle --version | grep Gradle
Gradle 1.11
[email protected]:~/prj> gradle compileJava
Converting class org.gradle.api.internal.file.DefaultSourceDirectorySet to File using
toString() method has been deprecated and is scheduled to be removed in Gradle 2.0.
Please use java.io.File, java.lang.String, java.net.URL, or java.net.URI instead.
:compileAcctJava
:processAcctResources UP-TO-DATE
:acctClasses
:resources
:acct UP-TO-DATE
:beans UP-TO-DATE
:svninfo UP-TO-DATE
:settings UP-TO-DATE
:compileJava UP-TO-DATE
BUILD SUCCESSFUL
Total time: 10.865 secs
和搖籃2.0失敗的構建:
[email protected]:~/prj> /usr/local/gradle-2.0/bin/gradle --version | grep Gradle
Gradle 2.0
[email protected]:~/prj> /usr/local/gradle-2.0/bin/gradle -i compileJava
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':compileAcctJava'.
> Cannot convert the provided notation to a File or URI: acct Java source.
The following types/formats are supported:
- A String or CharSequence path, e.g 'src/main/java' or '/usr/include'
- A String or CharSequence URI, e.g 'file:/usr/include'
- A File instance.
- A URI or URL instance.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option
to get more log output.
BUILD FAILED
Total time: 3.676 secs
然而,我不知道爲什麼和在我的構建腳本中的問題在哪裏。
我已經定義源集合,如http://www.gradle.org/docs/current/userguide/java_plugin.html#sec%3asource_sets所述,這是因爲我的項目沒有遵循默認的項目佈局。
sourceSets {
...
acct {
java {
srcDir "src"
srcDirs("src") {
include "my/program/some/package/Acct.java"
}
}
}
...
}
我確實有一些依賴關係,但不適用於acct
;這只是一個簡單的枚舉,用作代碼生成的基礎。它沒有依賴關係。即使我添加如下的虛擬依賴項,我也會得到相同的錯誤。
dependencies {
...
acctCompile junit
...
}
我該如何解決這個問題,或者我該如何找到更多關於究竟出錯的信息?
我沒有找到Gradle的--debug
和--stacktrace
的輸出。