title: setting property read from local.properties inside build.gradle
body: <p>I am using grade v3.4. I have moved the following properties to a file called local.properties (same directory as build.gradle):</p>
  
  <p><strong>local.properties</strong></p>
  
  <pre><code>nexusUsername=someuser
  nexusPassword=somepassword
  </code></pre>
  
  <p><strong>build.gradle</strong></p>
  
  <pre><code>File secretPropsFile = file('./local.properties')
  if (secretPropsFile.exists()) {
      Properties p = new Properties()
      p.load(new FileInputStream(secretPropsFile))
      p.each { name, value -&gt;
         project.set name, value
      }
  } else {
      throw new IllegalStateException("secret.properties could not be located for build process")
  }
  </code></pre>
  
  <p>I am getting the following exception:</p>
  
  <pre><code>Could not find method set() for arguments [nexusUsername, someuser] on root project 'some-java-project of type org.gradle.api.Project.
  </code></pre>