What is the most elegant way to deal with agent parameters that are passed as system properties to Gradle builds? It is possible to access the value of a system property xyz through teamcity["xyz"] in build.gradle but that only works on TeamCity. If that statement is present in a build file IDEA fails when it refreshes the project because it doesn't know about that property.
What is the most elegant way to have build files that work both on TeamCity and in the IDE? Do I need to implement special treatment (propertyMissing) for the IDE or is there a more elegant solution?