This message was deleted.
# community-support
s
This message was deleted.
c
yea, Gradle is finnicky about captured variables. Try with this variation:
Copy code
tasks.register<GenerateSchemaTask>(graphql) {
  val profile = providers.gradleProperty("profile")
  onlyIf(profile.map { it != "ci" })
  schema(file("./src/datastore.graphqls"))
  federatedSchemaOut(file("./src/main/resources/schema/federated.graphqls"))
  workingDir = file("../../")
  commandLine = mutableListOf("yarn", "generate:graphql")
}
More details here. Seems like the right soln is
Copy code
tasks.register<GenerateSchemaTask>(graphql) {
  val profile = providers.gradleProperty("profile").map { it != "ci" }
  onlyIf(profile.isPresent)
  ...
}
c
that works, thanks
🙂 1
v
As you now evaluate the provider directly during configuration phase, you could also use traditional way of reading it, btw. And please, don't ping random people just to get an answer faster, that is pretty rude in practically every community. We are not paid supporters, just users like you. If you want to have more focused people having a look, use an appropriate channel like in this case #C013WEPGQF9
e
I think
Copy code
onlyIf { profile.isPresent }
is better, the provider is evaluated as late as possible
v
Indeed for configuration cache reuse it is better, yes.
👍 1