title: Custom conditional configuration for Gradle project
body: <p>Having an extract from <a href="https://github.com/gradle/gradle/blob/master/build.gradle" rel="noreferrer">https://github.com/gradle/gradle/blob/master/build.gradle</a>:</p>
  
  <pre><code>ext {
    isDevBuild = {
      gradle.taskGraph.hasTask(developerBuild)
    }
  }
  
  task developerBuild {
    description = 'Builds distributions and runs pre-checkin checks'
    group = 'build'
    dependsOn testedDists
  }
  </code></pre>
  
  <p>When I used this approach to create custom configuration in my project I discovered that:</p>
  
  <pre><code>isDevBuild === true
  </code></pre>
  
  <p>i.e. it's always true because task 'developerBuild' is inside my build.gradle project, and hence in graph. They have a couple of "different" configs (isCIBuild, isCommitBuild, isFinalReleaseBuild, ...) so I suppose I got something wrong here.</p>
  
  <p>Can someone explain how to make this configs conditional based on some external parameter?</p>