對於gradle,從命令行執行特定測試應該從版本1.0(或1.1)開始工作,但它不適用於版本2.7。它不適用於gradle從命令行執行特定測試
下面我試着命令:
gradle test --tests com.mk.myfirstapp.MyUT
gradle這個輸出 '未知CMDLINE optiions':
FAILURE: Build failed with an exception.
* What went wrong:
Problem configuring task :app:test from command line.
> Unknown command-line option '--tests'.
* Try:
Run gradle help --task :app:test to get task usage details. 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.505 secs
同樣像
gradle -Dtest.single=abc test
另一個命令
有誰知道這是一個錯誤還是我的濫用?謝謝。
詳情
和我一樣的歐寶(下同),但我有一個差的結果。我的gradle出現了什麼問題: - ?
[email protected]:~/StudioProjects/MyFirstApp$ gradle -v ------------------------------------------------------------ Gradle 2.7 ------------------------------------------------------------ Build time: 2015-09-14 07:26:16 UTC Build number: none Revision: c41505168da69fb0650f4e31c9e01b50ffc97893 Groovy: 2.3.10 Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013 JVM: 1.8.0_51 (Oracle Corporation 25.51-b03) OS: Linux 3.5.0-44-generic amd64 [email protected]:~/StudioProjects/MyFirstApp$ gradle test --tests BlogFeedEndpointSpec WARNING: Dependency org.apache.httpcomponents:httpclient:4.5.1 is ignored for debug as it may be conflicting with the internal version provided by Android. In case of problem, please repackage it with jarjar to change the class packages WARNING: Dependency org.apache.httpcomponents:httpclient:4.5.1 is ignored for debug as it may be conflicting with the internal version provided by Android. In case of problem, please repackage it with jarjar to change the class packages WARNING: Dependency org.json:json:20150407-jdk16 is ignored for debug as it may be conflicting with the internal version provided by Android. In case of problem, please repackage with jarjar to change the class packages WARNING: Dependency org.apache.httpcomponents:httpclient:4.5.1 is ignored for release as it may be conflicting with the internal version provided by Android. In case of problem, please repackage it with jarjar to change the class packages WARNING: Dependency org.apache.httpcomponents:httpclient:4.5.1 is ignored for release as it may be conflicting with the internal version provided by Android. In case of problem, please repackage it with jarjar to change the class packages WARNING: Dependency org.json:json:20150407-jdk16 is ignored for release as it may be conflicting with the internal version provided by Android. In case of problem, please repackage with jarjar to change the class packages FAILURE: Build failed with an exception. * What went wrong: Problem configuring task :app:test from command line. > Unknown command-line option '--tests'. * Try: Run gradle help --task :app:test to get task usage details. 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.574 secs
的gradle哪個版本您使用的? – Opal