title: How to define a variable in build.gradle file whose value is passed dynamically by jenkins
body: <p>I have a Gradle task 'runRegression' in my build.gradle which is calling a Gulp task 'runEndtoEnd' and passing a parameter 'param1' to it.</p>
  
  <pre><code>task runRegression(type: Exec){
    executable "xvfb-run"
    args "gulp", "runEndtoEnd", param1
  }
  </code></pre>
  
  <p>The Gradle task is called by jenkins which will pass the value for 'param1' using command:<br><code>gradle runRegression -Pparam1=Dev</code></p>
  
  <p>When I execute the command, I can see the gradle task executing the gulp task and pass the parameter to it through 'param1'.<br><br>
  The issue comes when we do a 'gradle build'.
  It is not able to resolve the parameter 'param1'.
  <br>Getting error:<br>
  <em>A problem occurred evaluating project:.
  Could not find property 'param1' on task 'runRegression'.</em>
  <br><br>Any solution to this? Thanks in advance.</p>