Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to extend the "jmh" task? #161

Closed
Vetii opened this issue Jan 22, 2020 · 2 comments
Closed

Is it possible to extend the "jmh" task? #161

Vetii opened this issue Jan 22, 2020 · 2 comments

Comments

@Vetii
Copy link

Vetii commented Jan 22, 2020

Hi!

I would like to have pre-configured versions of the "jmh" task, and I have used the snippets described in this link.

I tried to write:

task jmhMyTask(type: me.champeau.gradle.JMHTask_Decorated) {
    fork = 2,
    resultFormat="CSV"
}

But if I do that, I get the following error:

Could not set unknown property 'fork' for task ':jmhTest' of type me.champeau.gradle.JMHTask_Decorated.

(I used "JMHTask_Decorated", because that is what I get when printing tasks.jmh.getClass().

Is there a way to define pre-configured versions of the "jmh" task?

Gradle version: 5.2.1.
Plugin version: 0.4.8.

@melix
Copy link
Owner

melix commented Jan 29, 2020

Don't use _Decorated, this is something generated by Gradle for any task. Just use:

task jmhMyTask(type: me.champeau.gradle.JMHTask

@melix melix closed this as completed Jan 29, 2020
@Vetii
Copy link
Author

Vetii commented Jul 22, 2020

Hi,

I tried to use jmhTask, but the problem persists, if I write:

task jmhTest(type: me.champeau.gradle.JMHTask) {
    fork=2
    timeOnIteration="250ms"
    resultFormat="CSV"
}

Then the build fails with the following error

Could not set unknown property 'fork' for task ':jmhTest' of type me.champeau.gradle.JMHTask.

Is there some other syntax that should be used for setting the properties?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants