To see more descriptive errors or want to skip some tasks, see command line documentation.
Running tests
IntelliJ
Certain unit tests may depend on the results of running gradle tasks. One such example is the testing of OSGi Services using OSGi Mocks where in order to run a test, the SCR metadata must be available for a class. Running a test like this in IntelliJ results in errors because the IDE is not aware of the Bundle plugin.
This can be worked around by configuring IntelliJ to delegate test execution to Gradle. In order to set this up, go to Settings > Build, Execution, Deployment > Gradle > Runner and set your IDE to delegate IDE build/run actions to Gradle. Alternatively, you can use a dropdown menu to use a specific runner or to decide on a test-by-test basis.
Attaching debugger
Execute build with options -Dorg.gradle.debug=true --no-daemon, it will suspend,
Attach debugger on port 5005,
Suspension will be released and build should stop at breakpoint.
The easiest way to implement custom plugins and use them in project is a technique related with buildSrc/ directory.
For more details please read documentation.
请发表评论