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

Configuring tasksToInstrumentPredicate does not work as documented #303

Open
wilkinsona opened this issue Sep 16, 2022 · 1 comment
Open
Labels
bug Something isn't working gradle-plugin Related to Gradle plugin

Comments

@wilkinsona
Copy link

wilkinsona commented Sep 16, 2022

Describe the bug
The documentation shows the following example for configuring the predicate:

tasksToInstrumentPredicate = t -> true

Adapting this to disable instrumentation by returning false does not work.

To Reproduce
Steps to reproduce the behavior:

plugins {
	id 'java'
	id 'org.graalvm.buildtools.native' version '0.9.13'
}

repositories {
	mavenCentral()
}

graalvmNative {
	agent {
		tasksToInstrumentPredicate = t -> false
	}
}
$ gradle test
[native-image-plugin] Instrumenting task with the native-image-agent: test

Expected behavior
Returning false for all tasks disables instrumentation for all tasks.

System Info (please complete the following information):

  • OS: N/A
  • GraalVM Version: N/A
  • Java Version: N/A
  • Plugin version: 0.9.13
  • Gradle version: 7.5.1

Additional context
It works, i.e. the log message about task instrumentation disappears, when specifically using a Predicate:

graalvmNative {
	agent {
		java.util.function.Predicate<Test> predicate = { t -> false }
		tasksToInstrumentPredicate = predicate
	}
}
@wilkinsona wilkinsona added the bug Something isn't working label Sep 16, 2022
@wilkinsona wilkinsona changed the title Configuring does not work as documented Configuring tasksToInstrumentPredicate does not work as documented Sep 16, 2022
@wilkinsona
Copy link
Author

This may be a duplicate of #301. Sorry if it is. However, I don't think that would explain (to me anyway) why the behavior is different depending on how the predicate is declared.

@lazar-mitrovic lazar-mitrovic added the gradle-plugin Related to Gradle plugin label Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gradle-plugin Related to Gradle plugin
Projects
None yet
Development

No branches or pull requests

2 participants