title: Moving built-in gradle tasks work to doLast/built-in tasks shourtcuts
body: <p>I want to create a simple sync task that slightly change it behaviour depending on build type (e.g. debug/release) and I use boolean variable 'dummy' decrared in gradle.taskGraph.whenReady:</p>
  
  <pre><code>gradle.taskGraph.whenReady {taskGraph -&gt;
    dummy = false
    if (taskGraph.hasTask(':dummybuild')) {
      dummy = true
    }
  }
  </code></pre>
  
  <p>The problem is that task configured by the following way has configuration scope, i.e. before whenReady so it doesn't have access to the 'dummy' variable:</p>
  
  <pre><code>task copySkins(type: Sync) {
    from skinsFrom
    into skinsInto
    rename skinsRename
    exclude symbianExclude
    if (!dummy) exclude dummyExclude
  }
  </code></pre>
  
  <p>Right now I'm using this workaround</p>
  
  <pre><code>task copySkins {
    inputs.dir skinsFrom
    outputs.dir skinsInto
  
    doLast {
      task skins(type: Sync) {
        from skinsFrom
        into skinsInto
        rename skinsRename
        exclude symbianExclude
        if (!dummy) exclude dummyExclude
      }
      skins.execute()
    }
  }
  </code></pre>
  
  <p>Is it possible to</p>
  
  <ol>
  <li>detect/setup some build properties in some other place except whenReady</li>
  <li>move sync task work to doLast</li>
  <li>or at least have some shortcut for sync task (.execute() looks quite ugly)</li>
  </ol>