Skip to content

Any example of running a gradle task with the Launcher API? #3719

Closed Answered by sbrannen
wazzeps asked this question in Q&A
Discussion options

You must be logged in to vote

I would like to understand how I can run a Gradle task that will only run tests using the Launcher API.

Gradle actually uses the Launcher API itself to run tests on the JUnit Platform.

Or is there Gradle integration with the JUnit Platform?

Yes, Gradle has built-in support for the JUnit Platform in the test task.

https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html

Should this be a simple main method call?

If you need something different than what Gradle's test task offers, yes, you could create your own main() method or custom Gradle task to interact with the Launcher API as you wish.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by wazzeps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants