title: Custom Task needs to be executed when gradle build is executed
body: <p>I am working on Java/JNI project. Under parent, I have different modules for java and C codebase.Java module needs to generate JNI header file. Since, I couldn't find any existing task/plugin that supported javah, so I wrote my custom task for javah to generate JNI interface. So, when I do 
  <code>
  gradle javah
  </code></p>
  
  <p>I am getting the desired output. </p>
  
  <ol>
  <li>However, I want that whenever I invoke <code>gradle build</code>, it should also execute javah task once either after classes are generated or build task ends.</li>
  <li>Also, is it possible to generate the shared libraries in such a mixed project when I just do <code>gradle build</code>? Currently, I have to do <code>gradle &lt;project-name&gt;SharedLibrary</code></li>
  </ol>